Преглед изворни кода

Follow up fa75733cc109f926b1df4156ccdf1292c78f8f79
* `getiteminfo` fix after `elvmax` added

Signed-off-by: Cydh Ramdh <house.bad@gmail.com>

Cydh Ramdh пре 10 година
родитељ
комит
7d42cf2ba4
4 измењених фајлова са 12 додато и 4 уклоњено
  1. 1 1
      doc/sample/getiteminfo.txt
  2. 2 1
      doc/script_commands.txt
  3. 1 1
      src/map/itemdb.h
  4. 8 1
      src/map/script.c

+ 1 - 1
doc/sample/getiteminfo.txt

@@ -17,7 +17,7 @@ prontera,156,179,6	script	test_getiteminfo	117,{
 	mes "Item ID: " + .@value + " ^nItemID^" + .@value;
 
 	mes "Current item info:";
-	for(.@id = 0; .@id < 14; .@id++)
+	for(.@id = 0; .@id <= 16; .@id++)
 		mes " getiteminfo(" + .@value + "," + .@id + ") = " + getiteminfo(.@value,.@id);
 	close;
 }

+ 2 - 1
doc/script_commands.txt

@@ -2829,7 +2829,8 @@ Valid types are:
 	12 - eLV
 	13 - wLV
 	14 - SpriteID from 'db/item_avail.txt'
-	15 - matk if RENEWAL is defined
+	15 - eLVMax
+	16 - matk if RENEWAL is defined
 
 See the sample in 'doc/sample/getiteminfo.txt'.
 

+ 1 - 1
src/map/itemdb.h

@@ -390,9 +390,9 @@ struct item_data
 	int slot;
 	int look;
 	int elv;
-	int elvmax; ///< Maximum level for this item
 	int wlv;
 	int view_id;
+	int elvmax; ///< Maximum level for this item
 #ifdef RENEWAL
 	int matk;
 #endif

+ 8 - 1
src/map/script.c

@@ -12590,6 +12590,8 @@ BUILDIN_FUNC(getitemslots)
 		12 elv;
 		13 wlv;
 		14 view id
+		15 eLvmax
+		16 matk (renewal)
  *------------------------------------------*/
 BUILDIN_FUNC(getiteminfo)
 {
@@ -12600,8 +12602,13 @@ BUILDIN_FUNC(getiteminfo)
 	n	= script_getnum(st,3);
 	i_data = itemdb_exists(item_id);
 
-	if (i_data && n <= 14) {
+	if (i_data && n <= 16) {
 		int *item_arr = (int*)&i_data->value_buy;
+#ifndef RENEWAL
+		if (n == 16)
+			script_pushint(st,0);
+		else
+#endif
 		script_pushint(st,item_arr[n]);
 	} else
 		script_pushint(st,-1);