Skip to content

Commit

Permalink
Avoid grabbing an already grabbed portable (#3157)
Browse files Browse the repository at this point in the history
Avoid that another player can "grab" an already grabbed portable from
another player.
  • Loading branch information
Brockengespenst authored Feb 2, 2025
1 parent 6362496 commit dd58c5d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/object/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1816,7 +1816,7 @@ Player::try_grab()
for (auto& moving_object : Sector::get().get_objects_by_type<MovingObject>())
{
Portable* portable = dynamic_cast<Portable*>(&moving_object);
if (portable && portable->is_portable())
if (portable && portable->is_portable() && !portable->is_grabbed())
{
// make sure the Portable isn't currently non-solid
if (moving_object.get_group() == COLGROUP_DISABLED) continue;
Expand Down

0 comments on commit dd58c5d

Please sign in to comment.