Re-link monster drop data with item data
* Fixes script commands addmonsterdrop and delmonsterdrop to update the monster drop data that is stored within the item data struct. * This refreshes atcommand whodrops and other functions that use this data. Thanks to @technoken!
This commit is contained in:
@@ -16702,6 +16702,7 @@ BUILDIN_FUNC(addmonsterdrop)
|
||||
if(c) { //Fill in the slot with the item and rate
|
||||
mob->dropitem[c].nameid = item_id;
|
||||
mob->dropitem[c].p = (rate > 10000)?10000:rate;
|
||||
itemdb_reload_itemmob_data(); // Reload the mob search data stored in the item_data
|
||||
script_pushint(st,1);
|
||||
} else //No place to put the new drop
|
||||
script_pushint(st,0);
|
||||
@@ -16747,6 +16748,7 @@ BUILDIN_FUNC(delmonsterdrop)
|
||||
if(mob->dropitem[i].nameid == item_id) {
|
||||
mob->dropitem[i].nameid = 0;
|
||||
mob->dropitem[i].p = 0;
|
||||
itemdb_reload_itemmob_data(); // Reload the mob search data stored in the item_data
|
||||
script_pushint(st,1);
|
||||
return SCRIPT_CMD_SUCCESS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user