mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-11-22 10:29:47 +00:00
fix AreaMap2D::remove
This commit is contained in:
parent
156ba02750
commit
2ec58d1a14
1 changed files with 7 additions and 2 deletions
|
|
@ -120,9 +120,14 @@ namespace util {
|
||||||
if (lx < 0 || ly < 0 || lx >= sizeX || ly >= sizeY) {
|
if (lx < 0 || ly < 0 || lx >= sizeX || ly >= sizeY) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
auto& element = firstBuffer[ly * sizeX + lx];
|
||||||
|
if (element == T{}) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (outCallback)
|
if (outCallback)
|
||||||
outCallback(x, y, firstBuffer[ly * sizeX + lx]);
|
outCallback(x, y, element);
|
||||||
firstBuffer[ly * sizeX + lx] = T{};
|
element = T{};
|
||||||
|
valuesCount--;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setOutCallback(const OutCallback& callback) {
|
void setOutCallback(const OutCallback& callback) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue