瀏覽代碼

* 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://svn.code.sf.net/p/rathena/svn/trunk@14656 54d463be-8e91-2dee-dedb-b68131a5f0ec

ai4rei 14 年之前
父節點
當前提交
f543097124
共有 2 個文件被更改,包括 7 次插入6 次删除
  1. 3 1
      Changelog-Trunk.txt
  2. 4 5
      src/map/atcommand.c

+ 3 - 1
Changelog-Trunk.txt

@@ -1,8 +1,10 @@
 Date	Added
 
+2011/01/08
+	* Fixed @homlevel usage message stating, that deleveling is possible, although it is not (bugreport:1485, since r10272). [Ai4rei]
+	- The command now fails, if it is given a zero or negative value.
 2011/01/07
 	* Fixed @alootid using 'autolootitem' (internal name) in it's usage message (bugreport:1445, since r12203). [Ai4rei]
-	- Reworded the turn off message of @alootid.
 2011/01/06
 	* Fixed script command 'deletearray' deleting incorrect amount of array elements from arrays with empty elements (bugreport:4628). [Ai4rei]
 2011/01/05

+ 4 - 5
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);