Don't copy null actions on the client (#10324)
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user