Serialize the actor generation for network orders

This commit is contained in:
abcdefg30
2022-06-24 16:15:13 +02:00
committed by teinarss
parent 13145557c8
commit d1f7fb8fb8
3 changed files with 11 additions and 6 deletions

View File

@@ -118,8 +118,10 @@ namespace OpenRA
{
case TargetType.Actor:
{
if (world != null && TryGetActorFromUInt(world, r.ReadUInt32(), out var targetActor))
target = Target.FromActor(targetActor);
var actorID = r.ReadUInt32();
var actorGeneration = r.ReadInt32();
if (world != null && TryGetActorFromUInt(world, actorID, out var targetActor))
target = Target.FromSerializedActor(targetActor, actorGeneration);
break;
}
@@ -367,6 +369,7 @@ namespace OpenRA
{
case TargetType.Actor:
w.Write(UIntFromActor(Target.SerializableActor));
w.Write(Target.SerializableGeneration);
break;
case TargetType.FrozenActor:
w.Write(Target.FrozenActor.Viewer.PlayerActor.ActorID);