fixed: Box destroition

This commit is contained in:
anime committed 2026-03-04 16:37:00 +06:00
1 parent 78046e5e2d
commit 05a13a40e7
3 files changed
+20 -7

No files matched your search

+8 -4
View File
@@ -350,6 +350,10 @@ namespace ZL
}
boxAlive.resize(boxCoordsArr.size(), true);
#ifdef NETWORK
std::fill(boxAlive.begin(), boxAlive.end(), false);
serverBoxesApplied = false;
#endif
ZL::CheckGlError();
boxLabels.clear();
boxLabels.reserve(boxCoordsArr.size());
@@ -662,10 +666,10 @@ namespace ZL
boxRenderArr[i].RefreshVBO();
}
boxAlive.assign(boxCoordsArr.size(), true);
if (destroyedFlags.size() == boxAlive.size()) {
for (size_t i = 0; i < boxAlive.size(); ++i) {
if (destroyedFlags[i]) boxAlive[i] = false;
}
size_t n = (std::min)(destroyedFlags.size(), boxAlive.size());
for (size_t i = 0; i < n; ++i) {
if (destroyedFlags[i]) boxAlive[i] = false; // destroyed => не рисуем
}
serverBoxesApplied = true;
}