better removal of players

This commit is contained in:
2024-08-03 15:06:33 +02:00
parent 2065ea8334
commit 282ddac80c
7 changed files with 55 additions and 7 deletions

View File

@@ -2,6 +2,7 @@
#include <server/components/Disconnect.h>
#include <server/components/EnetConnection.h>
#include <blitz/components/PlayerRemove.h>
#include <server/Server.h>
@@ -38,7 +39,9 @@ void DisconectSystem::Update(Nz::Time elapsedTime) {
});
// remove the entities
registry.destroy(disconnects.begin(), disconnects.end());
for (auto entity : disconnects) {
registry.emplace<PlayerRemoveComponent>(entity);
}
}
} // namespace server