ignore reservations being collected in worlds other than the one the OM is attached to.
This commit is contained in:
@@ -365,5 +365,10 @@ namespace OpenRA
|
||||
server = new Server.Server(modData, settings, map);
|
||||
JoinServer(IPAddress.Loopback.ToString(), settings.Server.ListenPort);
|
||||
}
|
||||
|
||||
public static bool IsCurrentWorld(World world)
|
||||
{
|
||||
return orderManager != null && orderManager.world == world;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,11 +32,15 @@ namespace OpenRA.Mods.RA
|
||||
{
|
||||
reservedFor = forActor;
|
||||
|
||||
return new DisposableAction(() => reservedFor = null,
|
||||
() => Game.RunAfterTick(() =>
|
||||
{throw new InvalidOperationException("Attempted to finalize an undisposed DisposableAction. {0} ({1}) reserved {2} ({3})"
|
||||
.F(forActor.Info.Name, forActor.ActorID, self.Info.Name, self.ActorID));})
|
||||
);
|
||||
// NOTE: we really dont care about the GC eating DisposableActions that apply to a world *other* than
|
||||
// the one we're playing in.
|
||||
|
||||
return new DisposableAction(
|
||||
() => reservedFor = null,
|
||||
() => Game.RunAfterTick(
|
||||
() => { if (Game.IsCurrentWorld( self.World )) throw new InvalidOperationException(
|
||||
"Attempted to finalize an undisposed DisposableAction. {0} ({1}) reserved {2} ({3})"
|
||||
.F(forActor.Info.Name, forActor.ActorID, self.Info.Name, self.ActorID)); }));
|
||||
}
|
||||
|
||||
public static bool IsReserved(Actor a)
|
||||
|
||||
Reference in New Issue
Block a user