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;