Преглед на файлове

Fixed random options with MAX_ITEM_RDM_OPT < 5 (#1580)

* Fixed random options with MAX_ITEM_RDM_OPT < 5

Fixed a possible issue on 2015 clients with random options, if you define an amount less than 5, because the client expects that much.

* Fixed a copy-paste mistake

Follow up to 6a01375
Thanks to @secretdataz
Lemongrass3110 преди 8 години
родител
ревизия
3b09de10e9
променени са 1 файла, в които са добавени 8 реда и са изтрити 0 реда
  1. 8 0
      src/map/clif.c

+ 8 - 0
src/map/clif.c

@@ -2445,6 +2445,14 @@ void clif_add_random_options(unsigned char* buf, struct item *it) {
 		WBUFW(buf, i*5 + 2) = it->option[i].value;	// Value
 		WBUFB(buf, i*5 + 4) = it->option[i].param;	// Param1
 	}
+	
+#if MAX_ITEM_RDM_OPT < 5
+	for ( ; i < 5; i++) {
+		WBUFW(buf, i*5 + 0) = 0;		// OptIndex
+		WBUFW(buf, i*5 + 2) = 0;	// Value
+		WBUFB(buf, i*5 + 4) = 0;	// Param1
+	}
+#endif
 #endif
 }