Fix predicted entity deletion for damage markers (#17015)
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
using Content.Shared.Damage;
|
using Content.Shared.Damage;
|
||||||
using Content.Shared.Projectiles;
|
using Content.Shared.Projectiles;
|
||||||
using Content.Shared.Weapons.Melee.Events;
|
using Content.Shared.Weapons.Melee.Events;
|
||||||
|
using Robust.Shared.Network;
|
||||||
using Robust.Shared.Physics.Events;
|
using Robust.Shared.Physics.Events;
|
||||||
using Robust.Shared.Timing;
|
using Robust.Shared.Timing;
|
||||||
|
|
||||||
@@ -9,6 +10,7 @@ namespace Content.Shared.Weapons.Marker;
|
|||||||
public abstract class SharedDamageMarkerSystem : EntitySystem
|
public abstract class SharedDamageMarkerSystem : EntitySystem
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IGameTiming _timing = default!;
|
[Dependency] private readonly IGameTiming _timing = default!;
|
||||||
|
[Dependency] private readonly INetManager _netManager = default!;
|
||||||
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
@@ -69,13 +71,16 @@ public abstract class SharedDamageMarkerSystem : EntitySystem
|
|||||||
component.Amount--;
|
component.Amount--;
|
||||||
Dirty(marker);
|
Dirty(marker);
|
||||||
|
|
||||||
if (component.Amount <= 0)
|
if (_netManager.IsServer)
|
||||||
{
|
{
|
||||||
QueueDel(uid);
|
if (component.Amount <= 0)
|
||||||
}
|
{
|
||||||
else
|
QueueDel(uid);
|
||||||
{
|
}
|
||||||
Dirty(component);
|
else
|
||||||
|
{
|
||||||
|
Dirty(component);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user