From 59cc50df4cb615e9cc906348bb95b7040097b482 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Sat, 18 Sep 2010 18:31:36 +1200 Subject: [PATCH] hack synchash to sync the traitdict contents (just ITick impls for now) --- OpenRA.Game/World.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/OpenRA.Game/World.cs b/OpenRA.Game/World.cs index b339a8b85e..8ac4b68390 100644 --- a/OpenRA.Game/World.cs +++ b/OpenRA.Game/World.cs @@ -175,9 +175,15 @@ namespace OpenRA { int n = 0; int ret = 0; + + // hash all the actors foreach (var a in Actors) ret += n++ * (int)a.ActorID * Sync.CalculateSyncHash(a); + // hash all the traits that tick + foreach (var x in traitDict.ActorsWithTraitMultiple(this)) + ret += n++ * (int)x.Actor.ActorID * Sync.CalculateSyncHash(x.Trait); + return ret; } }