mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-11-20 09:29:44 +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) {
|
||||
return;
|
||||
}
|
||||
auto& element = firstBuffer[ly * sizeX + lx];
|
||||
if (element == T{}) {
|
||||
return;
|
||||
}
|
||||
if (outCallback)
|
||||
outCallback(x, y, firstBuffer[ly * sizeX + lx]);
|
||||
firstBuffer[ly * sizeX + lx] = T{};
|
||||
outCallback(x, y, element);
|
||||
element = T{};
|
||||
valuesCount--;
|
||||
}
|
||||
|
||||
void setOutCallback(const OutCallback& callback) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue