summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgumi <git@gumi.ca>2018-09-28 17:18:26 -0400
committergumi <git@gumi.ca>2018-09-28 17:18:26 -0400
commit63d2515d143f12e7835ec79fbe7a68307db6a3ef (patch)
treea44869b67ada455356f8252cec1a5c8fac460b7b
parent852c13305f67948531bd0277eb1922dbd02b1f26 (diff)
downloadhercules-63d2515d143f12e7835ec79fbe7a68307db6a3ef.tar.gz
hercules-63d2515d143f12e7835ec79fbe7a68307db6a3ef.tar.bz2
hercules-63d2515d143f12e7835ec79fbe7a68307db6a3ef.tar.xz
hercules-63d2515d143f12e7835ec79fbe7a68307db6a3ef.zip
only update zeny achievements and logs for non-zero transactions
-rw-r--r--src/map/pc.c30
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;