Prevent pacified players from throwing dangerous stuff (#22268)

This commit is contained in:
KP
2023-12-11 15:40:22 -08:00
committed by GitHub
parent 5143030baf
commit d0085f9428
9 changed files with 136 additions and 20 deletions

View File

@@ -1,20 +1,22 @@
using System.Numerics;
namespace Content.Shared.Throwing
{
public sealed class BeforeThrowEvent : HandledEntityEventArgs
{
public BeforeThrowEvent(EntityUid itemUid, Vector2 direction, float throwStrength, EntityUid playerUid)
{
ItemUid = itemUid;
Direction = direction;
ThrowStrength = throwStrength;
PlayerUid = playerUid;
}
namespace Content.Shared.Throwing;
public EntityUid ItemUid { get; set; }
public Vector2 Direction { get; }
public float ThrowStrength { get; set;}
public EntityUid PlayerUid { get; }
[ByRefEvent]
public struct BeforeThrowEvent
{
public BeforeThrowEvent(EntityUid itemUid, Vector2 direction, float throwStrength, EntityUid playerUid)
{
ItemUid = itemUid;
Direction = direction;
ThrowStrength = throwStrength;
PlayerUid = playerUid;
}
public EntityUid ItemUid { get; set; }
public Vector2 Direction { get; }
public float ThrowStrength { get; set;}
public EntityUid PlayerUid { get; }
public bool Cancelled = false;
}