diff --git a/src/core/map.cpp b/src/core/map.cpp index baee10a3..d7936524 100644 --- a/src/core/map.cpp +++ b/src/core/map.cpp @@ -344,6 +344,7 @@ bool Map::getBlock(int x, int y, Block *out) { } void Map::setBlock(int x, int y, Block block, bool enableScriptCallback) { + if (!isWithinBounds(x, y)) return; int i = y * getWidth() + x; if (i < layout->blockdata.size()) { Block prevBlock = layout->blockdata.at(i);