Buddy code cleanup

- Get rid of buddyCnt, self-nullptr checks, and redundant playermap loops in chat handlers
- Add helper function to find available buddy slot
- Reorganize a bit
This commit is contained in:
Gent
2020-11-07 23:11:56 -05:00
parent 262dca7dd6
commit 803f1a246a
5 changed files with 108 additions and 130 deletions

View File

@@ -293,9 +293,6 @@ void PlayerManager::enterPlayer(CNSocket* sock, CNPacketData* data) {
// TODO: check if serialkey exists, if it doesn't send sP_FE2CL_REP_PC_ENTER_FAIL
Player plr = CNSharedData::getPlayer(enter->iEnterSerialKey);
plr.buddyCnt = 0;
std::cout << "Buddy Count: " << plr.buddyCnt << std::endl;
plr.groupCnt = 1;
plr.iIDGroup = plr.groupIDs[0] = plr.iID;