mirror of
https://github.com/huderlem/porymap.git
synced 2026-10-01 20:36:42 -05:00
Handle negative coordinates in Map::setBlock
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user