From 46b4b51302e483a13b811c3cd9e9e53d013970a1 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 29 Aug 2022 13:14:06 -0400 Subject: [PATCH] Handle negative coordinates in Map::setBlock --- src/core/map.cpp | 1 + 1 file changed, 1 insertion(+) 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);