From c8ff130b782f6a6d452a1eb5fa45c48a4ae82bcb Mon Sep 17 00:00:00 2001 From: Gent S Date: Sun, 13 Dec 2020 19:54:09 -0500 Subject: [PATCH] Update buddy warp to new DB --- src/BuddyManager.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/BuddyManager.cpp b/src/BuddyManager.cpp index 14c124e..c1dbdc9 100644 --- a/src/BuddyManager.cpp +++ b/src/BuddyManager.cpp @@ -729,11 +729,12 @@ void BuddyManager::emailSend(CNSocket* sock, CNPacketData* data) { if (pkt->iCash || pkt->aItem[0].ItemInven.iID) { // if there are item or taro attachments - Database::DbPlayer otherPlayerData = Database::getDbPlayerById(pkt->iTo_PCUID); - if (otherPlayerData.PlayerID != -1 && plr->PCStyle2.iPayzoneFlag != otherPlayerData.PayZoneFlag) { + Player otherPlr = {}; + Database::getPlayer(&otherPlr, pkt->iTo_PCUID); + if (otherPlr.iID != 0 && plr->PCStyle2.iPayzoneFlag != otherPlr.PCStyle2.iPayzoneFlag) { // if the players are not in the same time period INITSTRUCT(sP_FE2CL_REP_PC_SEND_EMAIL_FAIL, resp); - resp.iErrorCode = 9; //error code 9 tells the player they can't send attachments across time + resp.iErrorCode = 9; // error code 9 tells the player they can't send attachments across time resp.iTo_PCUID = pkt->iTo_PCUID; sock->sendPacket((void*)&resp, P_FE2CL_REP_PC_SEND_EMAIL_FAIL, sizeof(sP_FE2CL_REP_PC_SEND_EMAIL_FAIL)); return;