Skip zone mobile equipment with no item template
CZONE lists 24670 and 6796 on three trainers, but no cache template has them; new Item() threw a NullPointerException during the trainer parity. The DB import dropped them too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
08b50eecf0
commit
360736132f
1 file changed
+7
@@ -16,6 +16,7 @@ import engine.loot.BootySetEntry;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.mbEnums;
|
||||
import engine.parsers.cache.CacheParserUtil;
|
||||
import engine.parsers.objects.CObjectTemplate;
|
||||
import engine.parsers.objects.CZoneDrop;
|
||||
import engine.parsers.objects.RuneTemplate;
|
||||
import engine.server.MBServerStatics;
|
||||
@@ -166,6 +167,12 @@ public class MobBase extends AbstractGameObject {
|
||||
|
||||
for (CZoneDrop equipmentEntry : equipmentList) {
|
||||
|
||||
// CZONE lists a few IDs no cache template has (24670, 6796); the DB import dropped them too
|
||||
if (CObjectTemplate.lookup(equipmentEntry.item_id) == null) {
|
||||
Logger.warn("Zone mobile equipment " + equipmentEntry.item_id + " has no item template; skipped");
|
||||
continue;
|
||||
}
|
||||
|
||||
Item item = new Item(equipmentEntry.item_id);
|
||||
|
||||
if (item.template.getItemEqSlotsOr().isEmpty())
|
||||
|
||||
Reference in new issue
Block a user