diff options
author | Normynator <Norman.Ziebal@web.de> | 2017-01-04 16:23:09 +0100 |
---|---|---|
committer | Norman Ziebal <s8nozieb@stud.uni-saarland.de> | 2018-02-19 22:57:29 +0100 |
commit | 2691fcbedb580f5a8994a345b4476e95af2fc442 (patch) | |
tree | 9d68f8290b89f37d5377198b02b44568f112aeeb /src/map/atcommand.c | |
parent | 38914c4b3362a055468e3d3d8c26204c4a2d50d2 (diff) | |
download | hercules-2691fcbedb580f5a8994a345b4476e95af2fc442.tar.gz hercules-2691fcbedb580f5a8994a345b4476e95af2fc442.tar.bz2 hercules-2691fcbedb580f5a8994a345b4476e95af2fc442.tar.xz hercules-2691fcbedb580f5a8994a345b4476e95af2fc442.zip |
Changed Kafrapoints calculation.
Kafrapoints should now be used correctly.
Issue #1540
Changed opening braces according to coding styl.
Changed some lines according to coding styl.
new-line-before-return ?
more styling code changes
changes in coding style
coding style changes
Fixed message output on acted cash.
Removed unsupported and not needed var ret.
Update pc.c
Update atcommand.c
Coding style
added function description
added return validation
used wrong method in validation
Fixed typo in clif.c
Moved temp var to block start
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r-- | src/map/atcommand.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 2bcb22738..e529f8839 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -7872,7 +7872,6 @@ ACMD(cash) { char output[128]; int value; - int ret=0; if (!*message || (value = atoi(message)) == 0) { clif->message(fd, msg_fd(fd,1322)); // Please enter an amount. @@ -7880,38 +7879,38 @@ ACMD(cash) } if (!strcmpi(info->command,"cash")) { - if( value > 0 ) { - if( (ret=pc->getcash(sd, value, 0)) >= 0){ + if (value > 0) { + if ((pc->getcash(sd, value, 0)) >= 0) { // If this option is set, the message is already sent by pc function - if( !battle_config.cashshop_show_points ){ - sprintf(output, msg_fd(fd,505), ret, sd->cashPoints); + if (!battle_config.cashshop_show_points) { + sprintf(output, msg_fd(fd,505), value, sd->cashPoints); clif_disp_onlyself(sd, output); clif->message(fd, output); } } else clif->message(fd, msg_fd(fd,149)); // Unable to decrease the number/value. } else { - if( (ret=pc->paycash(sd, -value, 0)) >= 0){ - sprintf(output, msg_fd(fd,410), ret, sd->cashPoints); + if ((pc->paycash(sd, -value, 0)) >= 0) { + sprintf(output, msg_fd(fd,410), -value, sd->cashPoints); clif_disp_onlyself(sd, output); clif->message(fd, output); } else clif->message(fd, msg_fd(fd,41)); // Unable to decrease the number/value. } } else { // @points - if( value > 0 ) { - if( (ret=pc->getcash(sd, 0, value)) >= 0) { + if (value > 0) { + if ((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_fd(fd,506), ret, sd->kafraPoints); + if (!battle_config.cashshop_show_points) { + sprintf(output, msg_fd(fd,506), value, sd->kafraPoints); clif_disp_onlyself(sd, output); clif->message(fd, output); } } else clif->message(fd, msg_fd(fd,149)); // Unable to decrease the number/value. } else { - if( (ret=pc->paycash(sd, -value, -value)) >= 0){ - sprintf(output, msg_fd(fd,411), ret, sd->kafraPoints); + if ((pc->paycash(sd, -value, -value)) >= 0) { + sprintf(output, msg_fd(fd,411), -value, sd->kafraPoints); clif_disp_onlyself(sd, output); clif->message(fd, output); } else |