Added: Support for not-synced traits (ITraitNotSynced)
This commit is contained in:
@@ -4,6 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.Support;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Network
|
||||
{
|
||||
@@ -37,6 +38,7 @@ namespace OpenRA.Network
|
||||
report.Traits.Clear();
|
||||
foreach (var a in orderManager.world.Queries.WithTraitMultiple<object>())
|
||||
{
|
||||
if (a.Trait is ITraitNotSynced ) continue;
|
||||
var sync = Sync.CalculateSyncHash(a.Trait);
|
||||
if (sync != 0)
|
||||
report.Traits.Add(new TraitReport()
|
||||
|
||||
@@ -190,6 +190,8 @@ namespace OpenRA.Traits
|
||||
public interface IPostRenderSelection { void RenderAfterWorld(WorldRenderer wr, Actor self); }
|
||||
public interface IPreRenderSelection { void RenderBeforeWorld(WorldRenderer wr, Actor self); }
|
||||
|
||||
public interface ITraitNotSynced{} // Traits marked with NotSynced arent sync-checked
|
||||
|
||||
public struct Target // a target: either an actor, or a fixed location.
|
||||
{
|
||||
Actor actor;
|
||||
|
||||
@@ -199,7 +199,11 @@ namespace OpenRA
|
||||
|
||||
// hash all the traits that tick
|
||||
foreach (var x in traitDict.ActorsWithTraitMultiple<object>(this))
|
||||
ret += n++ * (int)x.Actor.ActorID * Sync.CalculateSyncHash(x.Trait);
|
||||
{
|
||||
if (x.Trait is ITraitNotSynced) continue;
|
||||
|
||||
ret += n++*(int) x.Actor.ActorID*Sync.CalculateSyncHash(x.Trait);
|
||||
}
|
||||
|
||||
// Hash the shared rng
|
||||
ret += SharedRandom.Last;
|
||||
|
||||
Reference in New Issue
Block a user