itemManager now uses a reference to the PlayerView

This commit is contained in:
CPunch 2020-08-21 14:28:14 -05:00
parent 88d08ffca7
commit cd19c54824

View File

@ -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_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)); 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 fromItem;
sItemBase toItem; sItemBase toItem;
@ -63,8 +63,6 @@ void ItemManager::itemMoveHandler(CNSocket* sock, CNPacketData* data) {
} }
} }
PlayerManager::players[sock] = plr;
resp->eTo = itemmove->eFrom; resp->eTo = itemmove->eFrom;
resp->iToSlotNum = itemmove->iFromSlotNum; resp->iToSlotNum = itemmove->iFromSlotNum;
resp->ToSlotItem = toItem; resp->ToSlotItem = toItem;