Fixed some errors related to disconnecting

This commit is contained in:
Yousef Khadadeh 2025-12-09 17:20:27 +03:00
parent 9649135f43
commit 65436429b8
7 changed files with 119 additions and 56 deletions

View file

@ -96,6 +96,10 @@ void MainProgram::update() {
setTabToClose.reset();
}
std::erase_if(worlds, [&](const std::shared_ptr<World>& w) {
return w->setToDestroy;
});
if(worldIndex >= worlds.size())
worldIndex = worlds.size() - 1;
if(worlds.size() == 0)