Buddy rework, adjustments, and fixes

I cleaned up the code a bit (I'll clean it up more as I make more progress) and fixed a bug with buddy slots. Now buddies aren't overwritten!
A few reworks and adjustments

I reworked the buddyIDs array to store only player UIDs instead of IDs. I also reworked buddy deleting so that it deletes buddies from the array.
Code cleanup

Cleaned up some of the code. I mainly just removed useless helper methods.
This commit is contained in:
SengokuNadeko
2020-10-27 11:28:37 -04:00
committed by Gent
parent 26460c0167
commit 262dca7dd6
5 changed files with 129 additions and 179 deletions

View File

@@ -293,6 +293,9 @@ 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;