summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/map/atcommand.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 204656285..7ff900eaf 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -3875,10 +3875,12 @@ ACMD_FUNC(lostskill)
*------------------------------------------*/
ACMD_FUNC(spiritball)
{
- int max_spiritballs = min(ARRAYLENGTH(sd->spirit_timer), 0x7FFF);
+ int max_spiritballs;
int number;
nullpo_retr(-1, sd);
-
+
+ max_spiritballs = min(ARRAYLENGTH(sd->spirit_timer), 0x7FFF);
+
if( !message || !*message || (number = atoi(message)) < 0 || number > max_spiritballs )
{
char msg[CHAT_SIZE_MAX];