Addition of NpcTemplate removeDrops method.

This commit is contained in:
MobiusDevelopment
2022-02-22 22:16:52 +00:00
parent dbc0d906d0
commit 86c4d5cd5c
46 changed files with 184 additions and 0 deletions

View File

@ -614,6 +614,8 @@ public class NpcData implements IXmlReader
if (dropLists != null)
{
template.removeDrops();
// Drops are sorted by chance (high to low).
Collections.sort(dropLists, (d1, d2) -> Double.valueOf(d2.getChance()).compareTo(Double.valueOf(d1.getChance())));
for (DropHolder dropHolder : dropLists)

View File

@ -649,6 +649,12 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
_ignoreClanNpcIds = ignoreClanNpcIds != null ? Collections.unmodifiableSet(ignoreClanNpcIds) : null;
}
public void removeDrops()
{
_dropListDeath = null;
_dropListSpoil = null;
}
public void addDrop(DropHolder dropHolder)
{
if (_dropListDeath == null)