From cd19c5482472fb8c5c730aa8173c0a241ddf6c95 Mon Sep 17 00:00:00 2001 From: CPunch Date: Fri, 21 Aug 2020 14:28:14 -0500 Subject: [PATCH] itemManager now uses a reference to the PlayerView --- src/ItemManager.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/ItemManager.cpp b/src/ItemManager.cpp index b635a7e..0bf3295 100644 --- a/src/ItemManager.cpp +++ b/src/ItemManager.cpp @@ -16,7 +16,7 @@ void ItemManager::itemMoveHandler(CNSocket* sock, CNPacketData* data) { sP_CL2FE_REQ_ITEM_MOVE* itemmove = (sP_CL2FE_REQ_ITEM_MOVE*)data->buf; sP_FE2CL_PC_ITEM_MOVE_SUCC* resp = (sP_FE2CL_PC_ITEM_MOVE_SUCC*)xmalloc(sizeof(sP_FE2CL_PC_ITEM_MOVE_SUCC)); - PlayerView plr = PlayerManager::players[sock]; + PlayerView& plr = PlayerManager::players[sock]; sItemBase fromItem; sItemBase toItem; @@ -62,8 +62,6 @@ void ItemManager::itemMoveHandler(CNSocket* sock, CNPacketData* data) { otherSock->sendPacket(new CNPacketData((void*)resp2, P_FE2CL_PC_EQUIP_CHANGE, sizeof(sP_FE2CL_PC_EQUIP_CHANGE), otherSock->getFEKey())); } } - - PlayerManager::players[sock] = plr; resp->eTo = itemmove->eFrom; resp->iToSlotNum = itemmove->iFromSlotNum;