better removal of players
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user