Don't copy null actions on the client (#10324)

This commit is contained in:
metalgearsloth
2022-08-06 14:49:55 +10:00
committed by GitHub
parent 74d13646f7
commit efe3429e0c
2 changed files with 8 additions and 3 deletions

View File

@@ -26,11 +26,14 @@ public class InstantAction : ActionType
{
base.CopyFrom(objectToClone);
// Server doesn't serialize events to us.
// As such we don't want them to bulldoze any events we may have gotten locally.
if (objectToClone is not InstantAction toClone)
return;
// Events should be re-usable, and shouldn't be modified during prediction.
Event = toClone.Event;
if (toClone.Event != null)
Event = toClone.Event;
}
public override object Clone()

View File

@@ -104,7 +104,8 @@ public class EntityTargetAction : TargetedAction
Whitelist = toClone.Whitelist;
// Events should be re-usable, and shouldn't be modified during prediction.
Event = toClone.Event;
if (toClone.Event != null)
Event = toClone.Event;
}
public override object Clone()
@@ -141,7 +142,8 @@ public class WorldTargetAction : TargetedAction
return;
// Events should be re-usable, and shouldn't be modified during prediction.
Event = toClone.Event;
if (toClone.Event != null)
Event = toClone.Event;
}
public override object Clone()