HOTFIX Fix pickup effects occurring with verb creation (#38705)
* fix: don't run pickup effects on verb creation * review * redundant --------- Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
This commit is contained in:
@@ -167,15 +167,21 @@ namespace Content.Shared.ActionBlocker
|
||||
return !ev.Cancelled;
|
||||
}
|
||||
|
||||
public bool CanPickup(EntityUid user, EntityUid item)
|
||||
/// <summary>
|
||||
/// Whether a user can pickup the given item.
|
||||
/// </summary>
|
||||
/// <param name="user">The mob trying to pick up the item.</param>
|
||||
/// <param name="item">The item being picked up.</param>
|
||||
/// <param name="showPopup">Whether or not to show a popup to the player telling them why the attempt failed.</param>
|
||||
public bool CanPickup(EntityUid user, EntityUid item, bool showPopup = false)
|
||||
{
|
||||
var userEv = new PickupAttemptEvent(user, item);
|
||||
var userEv = new PickupAttemptEvent(user, item, showPopup);
|
||||
RaiseLocalEvent(user, userEv);
|
||||
|
||||
if (userEv.Cancelled)
|
||||
return false;
|
||||
|
||||
var itemEv = new GettingPickedUpAttemptEvent(user, item);
|
||||
var itemEv = new GettingPickedUpAttemptEvent(user, item, showPopup);
|
||||
RaiseLocalEvent(item, itemEv);
|
||||
|
||||
return !itemEv.Cancelled;
|
||||
|
||||
Reference in New Issue
Block a user