NPC exits MeleeOperator on invalid EntityUid (#30005)

EntityUid 0 problem fix
This commit is contained in:
osjarw
2024-07-14 06:26:38 +03:00
committed by GitHub
parent 5d1702d280
commit 922be64290
2 changed files with 5 additions and 1 deletions

View File

@@ -143,6 +143,9 @@ public sealed class NPCJukeSystem : EntitySystem
if (!_melee.TryGetWeapon(uid, out var weaponUid, out var weapon))
return;
if (!HasComp<TransformComponent>(melee.Target))
return;
var cdRemaining = weapon.NextAttack - _timing.CurTime;
var attackCooldown = TimeSpan.FromSeconds(1f / _melee.GetAttackRate(weaponUid, uid, weapon));