Skip to content

Commit

Permalink
Fix furniture being placeable on flowers
Browse files Browse the repository at this point in the history
  • Loading branch information
heimskr committed May 9, 2023
1 parent 5e187c0 commit 25e1a47
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/item/Furniture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ namespace Game3 {
auto &realm = *place.realm;
Game &game = realm.getGame();
const auto &position = place.position;

const auto &details = GhostDetails::get(game, stack);

if ((details.layer == 3 || place.isPathable()) && !realm.hasTileEntityAt(position) && nullptr != realm.add(TileEntity::create<Ghost>(game, place, stack.withCount(1)))) {
if (auto id = place.get(details.layer); !id || *id != realm.getTileset().getEmptyID())
return false;

if (!realm.hasTileEntityAt(position) && nullptr != realm.add(TileEntity::create<Ghost>(game, place, stack.withCount(1)))) {
if (--stack.count == 0)
place.player->inventory->erase(slot);
place.player->inventory->notifyOwner();
Expand Down

0 comments on commit 25e1a47

Please sign in to comment.