From 421db4f7e06284e3563f1fe9e22a8f054ab83b52 Mon Sep 17 00:00:00 2001 From: ai4rei Date: Sat, 8 Jan 2011 12:05:13 +0000 Subject: * Fixed @homlevel usage message stating, that deleveling is possible, although it is not (bugreport:1485, since r10272). - The command now fails, if it is given a zero or negative value. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14656 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/atcommand.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 0979a14f8..66a8fedb4 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -7115,19 +7115,18 @@ ACMD_FUNC(homlevel) nullpo_retr(-1, sd); - if (!message || !*message) { - clif_displaymessage(fd, "Please, enter a level adjustment: (usage: @homlevel <+/- # of levels>."); + if ( !message || !*message || ( level = atoi(message) ) < 1 ) { + clif_displaymessage(fd, "Please, enter a level adjustment: (usage: @homlevel <# of levels to level up>."); return -1; } - + if ( !merc_is_hom_active(sd->hd) ) { clif_displaymessage(fd, "You do not have a homunculus."); return -1; } - level = atoi(message); hd = sd->hd; - + for (i = 1; i <= level && hd->exp_next; i++){ hd->homunculus.exp += hd->exp_next; merc_hom_levelup(hd); -- cgit v1.2.3-70-g09d2