diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/map/pc.c | 11 | ||||
-rw-r--r-- | src/map/unit.c | 5 |
2 files changed, 9 insertions, 7 deletions
diff --git a/src/map/pc.c b/src/map/pc.c index b312c796f..674b63973 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -2516,16 +2516,17 @@ int pc_inventoryblank(struct map_session_data *sd) */ int pc_payzeny(struct map_session_data *sd,int zeny) { - double z; - nullpo_retr(0, sd); if(sd->state.finalsave) return 1; - z = (double)sd->status.zeny; - if(sd->status.zeny<zeny || z - (double)zeny > MAX_ZENY) - return 1; + if (zeny > 0 && sd->status.zeny < zeny) + return 1; //Not enough. + + if (zeny < 0 && sd->status.zeny > MAX_ZENY +zeny) + return 1; //Overflow + sd->status.zeny-=zeny; clif_updatestatus(sd,SP_ZENY); diff --git a/src/map/unit.c b/src/map/unit.c index e35a8005c..a230881fa 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -1724,9 +1724,10 @@ int unit_free(struct block_list *bl) { } } else if(bl->type == BL_MOB) { struct mob_data *md = (struct mob_data*)bl; - if(md->deletetimer!=-1) + if(md->deletetimer!=-1) { delete_timer(md->deletetimer,mob_timer_delete); - md->deletetimer=-1; + md->deletetimer=-1; + } if(md->lootitem) { aFree(md->lootitem); md->lootitem=NULL; |