Handle negative coordinates in Map::setBlock
This commit is contained in:
parent
778257ccd9
commit
46b4b51302
1 changed files with 1 additions and 0 deletions
|
@ -344,6 +344,7 @@ bool Map::getBlock(int x, int y, Block *out) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Map::setBlock(int x, int y, Block block, bool enableScriptCallback) {
|
void Map::setBlock(int x, int y, Block block, bool enableScriptCallback) {
|
||||||
|
if (!isWithinBounds(x, y)) return;
|
||||||
int i = y * getWidth() + x;
|
int i = y * getWidth() + x;
|
||||||
if (i < layout->blockdata.size()) {
|
if (i < layout->blockdata.size()) {
|
||||||
Block prevBlock = layout->blockdata.at(i);
|
Block prevBlock = layout->blockdata.at(i);
|
||||||
|
|
Loading…
Reference in a new issue