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.
This commit is contained in:
Lemongrass3110
2016-09-29 15:30:27 +02:00
parent 228f0c5e3b
commit 6a013756c3

View File

@@ -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 < MAX_ITEM_RDM_OPT; i++) {
WBUFW(buf, i*5 + 0) = 0; // OptIndex
WBUFW(buf, i*5 + 2) = 0; // Value
WBUFB(buf, i*5 + 4) = 0; // Param1
}
#endif
#endif
}