Don't copy null actions on the client (#10324)
This commit is contained in:
@@ -26,10 +26,13 @@ public class InstantAction : ActionType
|
|||||||
{
|
{
|
||||||
base.CopyFrom(objectToClone);
|
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)
|
if (objectToClone is not InstantAction toClone)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Events should be re-usable, and shouldn't be modified during prediction.
|
// Events should be re-usable, and shouldn't be modified during prediction.
|
||||||
|
if (toClone.Event != null)
|
||||||
Event = toClone.Event;
|
Event = toClone.Event;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -104,6 +104,7 @@ public class EntityTargetAction : TargetedAction
|
|||||||
Whitelist = toClone.Whitelist;
|
Whitelist = toClone.Whitelist;
|
||||||
|
|
||||||
// Events should be re-usable, and shouldn't be modified during prediction.
|
// Events should be re-usable, and shouldn't be modified during prediction.
|
||||||
|
if (toClone.Event != null)
|
||||||
Event = toClone.Event;
|
Event = toClone.Event;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -141,6 +142,7 @@ public class WorldTargetAction : TargetedAction
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// Events should be re-usable, and shouldn't be modified during prediction.
|
// Events should be re-usable, and shouldn't be modified during prediction.
|
||||||
|
if (toClone.Event != null)
|
||||||
Event = toClone.Event;
|
Event = toClone.Event;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user