Handle negative coordinates in Map::setBlock

This commit is contained in:
GriffinR 2022-08-29 13:14:06 -04:00
parent 778257ccd9
commit 46b4b51302

View file

@ -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);