RunUnsynced, do not recalculate sync hash on reentry. Cache debug settings.

This commit is contained in:
Vapre
2021-08-13 20:19:40 +02:00
committed by teinarss
parent b3159d7515
commit 5ae4662f08
7 changed files with 29 additions and 18 deletions

View File

@@ -56,7 +56,7 @@ namespace OpenRA.Mods.Common.Traits
foreach (var sel in a.TraitsImplementing<INotifySelected>())
sel.Selected(a);
Sync.RunUnsynced(Game.Settings.Debug.SyncCheckUnsyncedCode, world, () => world.OrderGenerator.SelectionChanged(world, actors));
Sync.RunUnsynced(world, () => world.OrderGenerator.SelectionChanged(world, actors));
foreach (var ns in worldNotifySelection)
ns.SelectionChanged();
}
@@ -66,7 +66,7 @@ namespace OpenRA.Mods.Common.Traits
if (actors.Remove(a))
{
UpdateHash();
Sync.RunUnsynced(Game.Settings.Debug.SyncCheckUnsyncedCode, world, () => world.OrderGenerator.SelectionChanged(world, actors));
Sync.RunUnsynced(world, () => world.OrderGenerator.SelectionChanged(world, actors));
foreach (var ns in worldNotifySelection)
ns.SelectionChanged();
}
@@ -121,7 +121,7 @@ namespace OpenRA.Mods.Common.Traits
foreach (var sel in a.TraitsImplementing<INotifySelected>())
sel.Selected(a);
Sync.RunUnsynced(Game.Settings.Debug.SyncCheckUnsyncedCode, world, () => world.OrderGenerator.SelectionChanged(world, actors));
Sync.RunUnsynced(world, () => world.OrderGenerator.SelectionChanged(world, actors));
foreach (var ns in worldNotifySelection)
ns.SelectionChanged();
@@ -148,7 +148,7 @@ namespace OpenRA.Mods.Common.Traits
{
actors.Clear();
UpdateHash();
Sync.RunUnsynced(Game.Settings.Debug.SyncCheckUnsyncedCode, world, () => world.OrderGenerator.SelectionChanged(world, actors));
Sync.RunUnsynced(world, () => world.OrderGenerator.SelectionChanged(world, actors));
foreach (var ns in worldNotifySelection)
ns.SelectionChanged();
}
@@ -170,7 +170,7 @@ namespace OpenRA.Mods.Common.Traits
if (removed > 0)
{
UpdateHash();
Sync.RunUnsynced(Game.Settings.Debug.SyncCheckUnsyncedCode, world, () => world.OrderGenerator.SelectionChanged(world, actors));
Sync.RunUnsynced(world, () => world.OrderGenerator.SelectionChanged(world, actors));
foreach (var ns in worldNotifySelection)
ns.SelectionChanged();
}