Skip to content

Commit

Permalink
Inventory: Fix assert failure
Browse files Browse the repository at this point in the history
The show flag sanity check in Inventory::remove() failed when trying to
give an item to the player which is in another entity's inventory
but the player's inventory is full.

Fixes: issue #1570
(cherry picked from commit 0b414fa)
  • Loading branch information
dscharrer committed Aug 12, 2021
1 parent f89d44b commit 034aa03
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/game/Inventory.cpp
Expand Up @@ -145,16 +145,16 @@ void PutInFrontOfPlayer(Entity * io) {
}
}

io->angle = Anglef();

if(g_draggedEntity == io) {
setDraggedEntity(NULL);
}

io->show = SHOW_FLAG_IN_SCENE;

removeFromInventories(io);

io->angle = Anglef();
io->show = SHOW_FLAG_IN_SCENE;

Sphere limit(player.pos + Vec3f(0.f, 20.f, 0.f), 80);
Vec3f dir = angleToVectorXZ(player.angle.getYaw());
EntityDragResult result = findSpotForDraggedEntity(limit.origin, dir, io, limit);
Expand Down

0 comments on commit 034aa03

Please sign in to comment.