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,10 +26,13 @@ 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.
if (toClone.Event != null)
Event = toClone.Event;
}

View File

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