summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
authorFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-02-19 16:57:01 +0000
committerFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-02-19 16:57:01 +0000
commit2d6cf0c06e355b0e697b5372a03e189d75893502 (patch)
tree62517b0b543d4ee194ec1dd3ded572f34b21d468 /src/map/atcommand.c
parentb1a7decb5f4f88f49ab42f87cd4e770542affd69 (diff)
downloadhercules-2d6cf0c06e355b0e697b5372a03e189d75893502.tar.gz
hercules-2d6cf0c06e355b0e697b5372a03e189d75893502.tar.bz2
hercules-2d6cf0c06e355b0e697b5372a03e189d75893502.tar.xz
hercules-2d6cf0c06e355b0e697b5372a03e189d75893502.zip
* Fixed impropper filling of w4 in npc_parsesrcfile when there are less than 4 fields. (bugreport:1063)
* Simplified atcommand_spiritball. (deprecated msg_txt 204 and 205) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13538 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c27
1 files changed, 8 insertions, 19 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index e5cd1c9e5..7139c6935 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -3717,30 +3717,19 @@ int atcommand_spiritball(const int fd, struct map_session_data* sd, const char*
int number;
nullpo_retr(-1, sd);
- if (!message || !*message || (number = atoi(message)) < 0 || number >= max_spiritballs) {
+ if( !message || !*message || (number = atoi(message)) < 0 || number > max_spiritballs )
+ {
char msg[256];
- safesnprintf(msg, sizeof(msg), "Please, enter a spirit ball number (usage: @spiritball <number: 0-%d>).", max_spiritballs);
+ safesnprintf(msg, sizeof(msg), "Usage: @spiritball <number: 0-%d>", max_spiritballs);
clif_displaymessage(fd, msg);
return -1;
}
- if (number >= 0 && number <= max_spiritballs) {
- if (sd->spiritball != number) {
- if (sd->spiritball > 0)
- pc_delspiritball(sd, sd->spiritball, 1);
- sd->spiritball = number;
- clif_spiritball(sd);
- // no message, player can look the difference
- if (number > 1000)
- clif_displaymessage(fd, msg_txt(204)); // WARNING: more than 1000 spiritballs can CRASH your server and/or client!
- } else {
- clif_displaymessage(fd, msg_txt(205)); // You already have this number of spiritballs.
- return -1;
- }
- } else {
- clif_displaymessage(fd, msg_txt(37)); // An invalid number was specified.
- return -1;
- }
+ if( sd->spiritball > 0 )
+ pc_delspiritball(sd, sd->spiritball, 1);
+ sd->spiritball = number;
+ clif_spiritball(sd);
+ // no message, player can look the difference
return 0;
}