summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/Items/ItemLilypad.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/Items/ItemLilypad.h b/src/Items/ItemLilypad.h
index 5760ff830..b448b33c8 100644
--- a/src/Items/ItemLilypad.h
+++ b/src/Items/ItemLilypad.h
@@ -63,9 +63,15 @@ public:
return false;
}
- // Lilypad should be placed only if there is a water block below
+ const auto Below = PlacePos.addedY(-1);
+ if (Below.y < 0)
+ {
+ return false;
+ }
+
+ // Lilypad should be placed only if there is a water block below:
if (
- const auto BlockBelow = a_World->GetBlock(PlacePos.addedY(-1));
+ const auto BlockBelow = a_World->GetBlock(Below);
(BlockBelow != E_BLOCK_WATER) &&
(BlockBelow != E_BLOCK_STATIONARY_WATER)
)
@@ -78,6 +84,7 @@ public:
{
a_Player->GetInventory().RemoveOneEquippedItem();
}
+
return true;
}