diff options
author | shennetsind <ind@henn.et> | 2013-10-24 07:56:49 -0200 |
---|---|---|
committer | shennetsind <ind@henn.et> | 2013-10-24 07:56:49 -0200 |
commit | 2c1fa0ca982ab82ae1f60f44b13cda0f6de8f4ff (patch) | |
tree | 6fb1cf25170cf60734cb5564004353b277c9e397 /src | |
parent | 03d7f7a15a5f7886385fece3164eb7dfedcee303 (diff) | |
download | hercules-2c1fa0ca982ab82ae1f60f44b13cda0f6de8f4ff.tar.gz hercules-2c1fa0ca982ab82ae1f60f44b13cda0f6de8f4ff.tar.bz2 hercules-2c1fa0ca982ab82ae1f60f44b13cda0f6de8f4ff.tar.xz hercules-2c1fa0ca982ab82ae1f60f44b13cda0f6de8f4ff.zip |
Fixed @cash/@points display
message would be displayed twice, when cashshop_show_points was enabled, with positive values
Merge from e71a6cc7eca7d0c003c9cc6bf1965a0e07fdf505
Closes #157
Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src')
-rw-r--r-- | src/map/atcommand.c | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 27fbb7218..7d4008faf 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -7606,36 +7606,39 @@ ACMD(cash) return false; } - if( !strcmpi(command+1,"cash") ) - { + if( !strcmpi(command+1,"cash") ) { if( value > 0 ) { if( (ret=pc->getcash(sd, value, 0)) >= 0){ - sprintf(output, msg_txt(505), ret, sd->cashPoints); - clif->disp_onlyself(sd, output, strlen(output)); - } - else clif->message(fd, msg_txt(149)); // Unable to decrease the number/value. + // If this option is set, the message is already sent by pc function + if( !battle_config.cashshop_show_points ){ + sprintf(output, msg_txt(505), ret, sd->cashPoints); + clif->disp_onlyself(sd, output, strlen(output)); + } + } else + clif->message(fd, msg_txt(149)); // Unable to decrease the number/value. } else { if( (ret=pc->paycash(sd, -value, 0)) >= 0){ sprintf(output, msg_txt(410), ret, sd->cashPoints); clif->disp_onlyself(sd, output, strlen(output)); - } - else clif->message(fd, msg_txt(41)); // Unable to decrease the number/value. + } else + clif->message(fd, msg_txt(41)); // Unable to decrease the number/value. } - } - else - { // @points + } else { // @points if( value > 0 ) { - if( (ret=pc->getcash(sd, 0, value)) >= 0){ - sprintf(output, msg_txt(506), ret, sd->kafraPoints); - clif->disp_onlyself(sd, output, strlen(output)); - } - else clif->message(fd, msg_txt(149)); // Unable to decrease the number/value. + if( (ret=pc->getcash(sd, 0, value)) >= 0) { + // If this option is set, the message is already sent by pc function + if( !battle_config.cashshop_show_points ){ + sprintf(output, msg_txt(506), ret, sd->kafraPoints); + clif->disp_onlyself(sd, output, strlen(output)); + } + } else + clif->message(fd, msg_txt(149)); // Unable to decrease the number/value. } else { if( (ret=pc->paycash(sd, -value, -value)) >= 0){ sprintf(output, msg_txt(411), ret, sd->kafraPoints); clif->disp_onlyself(sd, output, strlen(output)); - } - else clif->message(fd, msg_txt(41)); // Unable to decrease the number/value. + } else + clif->message(fd, msg_txt(41)); // Unable to decrease the number/value. } } |