Fixed free purchase from cashshop NPC exploit (#3605)

This commit is contained in:
Jittapan Pluemsumran 2018-10-23 01:13:41 +07:00 committed by GitHub
parent dcb6592f52
commit 180938d971
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -564,7 +564,7 @@ bool cashshop_buylist( struct map_session_data* sd, uint32 kafrapoints, int n, u
return false;
}
if(pc_paycash( sd, totalcash, kafrapoints, LOG_TYPE_CASH ) < 0){
if(pc_paycash( sd, totalcash, kafrapoints, LOG_TYPE_CASH ) <= 0){
clif_cashshop_result( sd, 0, CASHSHOP_RESULT_ERROR_SHORTTAGE_CASH );
return false;
}

View File

@ -1420,7 +1420,9 @@ static enum e_CASHSHOP_ACK npc_cashshop_process_payment(struct npc_data *nd, int
case NPCTYPE_CASHSHOP:
if (cost[1] < points || cost[0] < (price - points))
return ERROR_TYPE_MONEY;
pc_paycash(sd, price, points, LOG_TYPE_NPC);
if (pc_paycash(sd, price, points, LOG_TYPE_NPC) <= 0) {
return ERROR_TYPE_MONEY;
}
break;
case NPCTYPE_ITEMSHOP:
{