diff options
Diffstat (limited to 'src/map/pc.c')
-rw-r--r-- | src/map/pc.c | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/src/map/pc.c b/src/map/pc.c index 961dda9f5..56f42690d 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -4506,14 +4506,15 @@ static int pc_payzeny(struct map_session_data *sd, int zeny, enum e_log_pick_typ sd->status.zeny -= zeny; clif->updatestatus(sd,SP_ZENY); - achievement->validate_zeny(sd, -zeny); // Achievements [Smokexyz/Hercules] + if (zeny > 0) { + achievement->validate_zeny(sd, -zeny); // Achievements [Smokexyz/Hercules] + logs->zeny(sd, type, tsd ? tsd : sd, -zeny); - if(!tsd) tsd = sd; - logs->zeny(sd, type, tsd, -zeny); - if( zeny > 0 && sd->state.showzeny ) { - char output[255]; - sprintf(output, "Removed %dz.", zeny); - clif_disp_onlyself(sd, output); + if (sd->state.showzeny) { + char output[255]; + sprintf(output, "Removed %dz.", zeny); + clif_disp_onlyself(sd, output); + } } return 0; @@ -4644,14 +4645,15 @@ static int pc_getzeny(struct map_session_data *sd, int zeny, enum e_log_pick_typ sd->status.zeny += zeny; clif->updatestatus(sd,SP_ZENY); - achievement->validate_zeny(sd, zeny); // Achievements [Smokexyz/Hercules] + if (zeny > 0) { + achievement->validate_zeny(sd, zeny); // Achievements [Smokexyz/Hercules] + logs->zeny(sd, type, tsd ? tsd : sd, zeny); - if(!tsd) tsd = sd; - logs->zeny(sd, type, tsd, zeny); - if( zeny > 0 && sd->state.showzeny ) { - char output[255]; - sprintf(output, "Gained %dz.", zeny); - clif_disp_onlyself(sd, output); + if (sd->state.showzeny) { + char output[255]; + sprintf(output, "Gained %dz.", zeny); + clif_disp_onlyself(sd, output); + } } return 0; @@ -4689,7 +4691,7 @@ static int pc_search_inventory(struct map_session_data *sd, int item_id) * 6 = ? * 7 = stack limitation *------------------------------------------*/ -static int pc_additem(struct map_session_data *sd, struct item *item_data, int amount, e_log_pick_type log_type) +static int pc_additem(struct map_session_data *sd, const struct item *item_data, int amount, e_log_pick_type log_type) { struct item_data *data; int i; |