fix(SharedGunSystem): Return and debug log on CreateEffect. (#29656)
Sometimes CreateEffect is called on a Invalid Entity. This now causes that to check, thus returning out and printing some hopefully helpful logs to try to track down the real source of this issue.
This commit is contained in:
parent
87f7ea8aa9
commit
ac768fe9f1
1 changed files with 8 additions and 0 deletions
|
|
@ -276,6 +276,14 @@ public sealed partial class GunSystem : SharedGunSystem
|
|||
if (!Timing.IsFirstTimePredicted)
|
||||
return;
|
||||
|
||||
// EntityUid check added to stop throwing exceptions due to https://github.com/space-wizards/space-station-14/issues/28252
|
||||
// TODO: Check to see why invalid entities are firing effects.
|
||||
if (gunUid == EntityUid.Invalid)
|
||||
{
|
||||
Log.Debug($"Invalid Entity sent MuzzleFlashEvent (proto: {message.Prototype}, user: {user})");
|
||||
return;
|
||||
}
|
||||
|
||||
var gunXform = Transform(gunUid);
|
||||
var gridUid = gunXform.GridUid;
|
||||
EntityCoordinates coordinates;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue