diff options
author | gumi <git@gumi.ca> | 2018-09-28 17:18:26 -0400 |
---|---|---|
committer | gumi <git@gumi.ca> | 2018-09-28 17:18:26 -0400 |
commit | 63d2515d143f12e7835ec79fbe7a68307db6a3ef (patch) | |
tree | a44869b67ada455356f8252cec1a5c8fac460b7b /src | |
parent | 852c13305f67948531bd0277eb1922dbd02b1f26 (diff) | |
download | hercules-63d2515d143f12e7835ec79fbe7a68307db6a3ef.tar.gz hercules-63d2515d143f12e7835ec79fbe7a68307db6a3ef.tar.bz2 hercules-63d2515d143f12e7835ec79fbe7a68307db6a3ef.tar.xz hercules-63d2515d143f12e7835ec79fbe7a68307db6a3ef.zip |
only update zeny achievements and logs for non-zero transactions
Diffstat (limited to 'src')
-rw-r--r-- | src/map/pc.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/src/map/pc.c b/src/map/pc.c index 961dda9f5..349d2cd7f 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; |