fix AreaMap2D::remove

This commit is contained in:
MihailRis 2026-11-13 00:38:10 +03:00
parent 156ba02750
commit 2ec58d1a14

View file

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