Refactor player groups

Group structures are used now. Adds more checks in some places but simplifies things overall.
We can expand this system to entities as well now pretty trivially.
This commit is contained in:
gsemaj
2022-04-23 15:58:08 -04:00
parent 710300c04c
commit 22c93ac854
5 changed files with 14 additions and 15 deletions

View File

@@ -41,7 +41,8 @@ void PlayerManager::removePlayer(CNSocket* key) {
Player* plr = getPlayer(key);
uint64_t fromInstance = plr->instanceID;
Groups::groupKick(plr);
if(plr->group != nullptr)
Groups::groupKick(plr);
// remove player's bullets
Combat::Bullets.erase(plr->iID);