Improve buckling's interactions with standing state (#29741)

This commit is contained in:
Tayrtahn
2024-07-07 02:20:53 -04:00
committed by GitHub
parent d9be666e8a
commit 23887d5bd9
2 changed files with 14 additions and 11 deletions

View File

@@ -25,7 +25,10 @@ namespace Content.Shared.Standing
return !standingState.Standing;
}
public bool Down(EntityUid uid, bool playSound = true, bool dropHeldItems = true,
public bool Down(EntityUid uid,
bool playSound = true,
bool dropHeldItems = true,
bool force = false,
StandingStateComponent? standingState = null,
AppearanceComponent? appearance = null,
HandsComponent? hands = null)
@@ -49,11 +52,14 @@ namespace Content.Shared.Standing
RaiseLocalEvent(uid, new DropHandItemsEvent(), false);
}
var msg = new DownAttemptEvent();
RaiseLocalEvent(uid, msg, false);
if (!force)
{
var msg = new DownAttemptEvent();
RaiseLocalEvent(uid, msg, false);
if (msg.Cancelled)
return false;
if (msg.Cancelled)
return false;
}
standingState.Standing = false;
Dirty(uid, standingState);