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
  • Loading branch information
dscharrer committed Aug 12, 2021
1 parent e5ba607 commit 0b414fa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/game/Inventory.cpp
Expand Up @@ -143,16 +143,16 @@ void PutInFrontOfPlayer(Entity * io) {
}
}

io->angle = Anglef();

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

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 0b414fa

Please sign in to comment.