summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2018-10-07 16:32:58 +0200
committerGitHub <noreply@github.com>2018-10-07 16:32:58 +0200
commit75cd42c30ad574634543c2b2f6567e7dc7107f79 (patch)
tree197813c0c0a3a3f494ef1b1fad54c5a74486711c /src
parent6260982b69be48e13ff1f3f1c57b87dfa2139634 (diff)
parent63d2515d143f12e7835ec79fbe7a68307db6a3ef (diff)
downloadhercules-75cd42c30ad574634543c2b2f6567e7dc7107f79.tar.gz
hercules-75cd42c30ad574634543c2b2f6567e7dc7107f79.tar.bz2
hercules-75cd42c30ad574634543c2b2f6567e7dc7107f79.tar.xz
hercules-75cd42c30ad574634543c2b2f6567e7dc7107f79.zip
Merge pull request #2227 from Helianthella/validatezeny
only update zeny achievements and logs for non-zero transactions
Diffstat (limited to 'src')
-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 c64c79db2..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;