Use PredictedQueueDel in SharedDestructibleSystem.DestroyEntity (#40856)

feat: predict queuedel in SharedDestructibleSystem.DestroyEntity

Co-authored-by: pa.pecherskij <pa.pecherskij@interfax.ru>
This commit is contained in:
Fildrance
2025-10-12 20:54:08 +03:00
committed by GitHub
parent a803bcca46
commit 11525673ba

View File

@@ -1,9 +1,9 @@
namespace Content.Shared.Destructible;
namespace Content.Shared.Destructible;
public abstract class SharedDestructibleSystem : EntitySystem
{
/// <summary>
/// Force entity to be destroyed and deleted.
/// Force entity to be destroyed and deleted.
/// </summary>
public bool DestroyEntity(EntityUid owner)
{
@@ -15,12 +15,12 @@ public abstract class SharedDestructibleSystem : EntitySystem
var eventArgs = new DestructionEventArgs();
RaiseLocalEvent(owner, eventArgs);
QueueDel(owner);
PredictedQueueDel(owner);
return true;
}
/// <summary>
/// Force entity to break.
/// Force entity to break.
/// </summary>
public void BreakEntity(EntityUid owner)
{
@@ -30,7 +30,7 @@ public abstract class SharedDestructibleSystem : EntitySystem
}
/// <summary>
/// Raised before an entity is about to be destroyed and deleted
/// Raised before an entity is about to be destroyed and deleted
/// </summary>
public sealed class DestructionAttemptEvent : CancellableEntityEventArgs
{
@@ -38,7 +38,7 @@ public sealed class DestructionAttemptEvent : CancellableEntityEventArgs
}
/// <summary>
/// Raised when entity is destroyed and about to be deleted.
/// Raised when entity is destroyed and about to be deleted.
/// </summary>
public sealed class DestructionEventArgs : EntityEventArgs
{
@@ -46,7 +46,7 @@ public sealed class DestructionEventArgs : EntityEventArgs
}
/// <summary>
/// Raised when entity was heavy damage and about to break.
/// Raised when entity was heavy damage and about to break.
/// </summary>
public sealed class BreakageEventArgs : EntityEventArgs
{