diff --git a/Source/inv.cpp b/Source/inv.cpp index 6a9b5a6e8..6f13fb28b 100644 --- a/Source/inv.cpp +++ b/Source/inv.cpp @@ -1793,11 +1793,9 @@ static bool PutItem(PlayerStruct &player, Point &position) if (numitems >= MAXITEMS) return false; - auto relativePosition = position - player.position.tile; - Direction d = GetDirection(player.position.tile, position); - if (abs(relativePosition.x) > 1 || abs(relativePosition.y) > 1) { + if (position.WalkingDistance(player.position.tile) > 1) { position = player.position.tile + d; } if (CanPut(position))