Possible fix for duplicated drop lists issue.

This commit is contained in:
MobiusDev 2018-01-29 16:35:21 +00:00
parent b5e821c313
commit 4597d64b3d
6 changed files with 20 additions and 14 deletions

View File

@ -689,12 +689,13 @@ public final class L2NpcTemplate extends L2CharTemplate implements IIdentifiable
public Collection<ItemHolder> calculateDrops(DropType dropType, L2Character victim, L2Character killer) public Collection<ItemHolder> calculateDrops(DropType dropType, L2Character victim, L2Character killer)
{ {
final List<DropHolder> dropList = getDropList(dropType); if (getDropList(dropType) == null)
if (dropList == null)
{ {
return null; return null;
} }
final List<DropHolder> dropList = new ArrayList<>(getDropList(dropType));
// randomize drop order // randomize drop order
Collections.shuffle(dropList); Collections.shuffle(dropList);

View File

@ -689,12 +689,13 @@ public final class L2NpcTemplate extends L2CharTemplate implements IIdentifiable
public Collection<ItemHolder> calculateDrops(DropType dropType, L2Character victim, L2Character killer) public Collection<ItemHolder> calculateDrops(DropType dropType, L2Character victim, L2Character killer)
{ {
final List<DropHolder> dropList = getDropList(dropType); if (getDropList(dropType) == null)
if (dropList == null)
{ {
return null; return null;
} }
final List<DropHolder> dropList = new ArrayList<>(getDropList(dropType));
// randomize drop order // randomize drop order
Collections.shuffle(dropList); Collections.shuffle(dropList);

View File

@ -689,12 +689,13 @@ public final class L2NpcTemplate extends L2CharTemplate implements IIdentifiable
public Collection<ItemHolder> calculateDrops(DropType dropType, L2Character victim, L2Character killer) public Collection<ItemHolder> calculateDrops(DropType dropType, L2Character victim, L2Character killer)
{ {
final List<DropHolder> dropList = getDropList(dropType); if (getDropList(dropType) == null)
if (dropList == null)
{ {
return null; return null;
} }
final List<DropHolder> dropList = new ArrayList<>(getDropList(dropType));
// randomize drop order // randomize drop order
Collections.shuffle(dropList); Collections.shuffle(dropList);

View File

@ -689,12 +689,13 @@ public final class L2NpcTemplate extends L2CharTemplate implements IIdentifiable
public Collection<ItemHolder> calculateDrops(DropType dropType, L2Character victim, L2Character killer) public Collection<ItemHolder> calculateDrops(DropType dropType, L2Character victim, L2Character killer)
{ {
final List<DropHolder> dropList = getDropList(dropType); if (getDropList(dropType) == null)
if (dropList == null)
{ {
return null; return null;
} }
final List<DropHolder> dropList = new ArrayList<>(getDropList(dropType));
// randomize drop order // randomize drop order
Collections.shuffle(dropList); Collections.shuffle(dropList);

View File

@ -95,8 +95,8 @@ public final class L2NpcTemplate extends L2CharTemplate implements IIdentifiable
private Map<AISkillScope, List<Skill>> _aiSkillLists; private Map<AISkillScope, List<Skill>> _aiSkillLists;
private Set<Integer> _clans; private Set<Integer> _clans;
private Set<Integer> _ignoreClanNpcIds; private Set<Integer> _ignoreClanNpcIds;
private CopyOnWriteArrayList<DropHolder> _dropListDeath; private List<DropHolder> _dropListDeath;
private CopyOnWriteArrayList<DropHolder> _dropListSpoil; private List<DropHolder> _dropListSpoil;
private double _collisionRadiusGrown; private double _collisionRadiusGrown;
private double _collisionHeightGrown; private double _collisionHeightGrown;
@ -546,12 +546,13 @@ public final class L2NpcTemplate extends L2CharTemplate implements IIdentifiable
public Collection<ItemHolder> calculateDrops(DropType dropType, L2Character victim, L2Character killer) public Collection<ItemHolder> calculateDrops(DropType dropType, L2Character victim, L2Character killer)
{ {
final List<DropHolder> dropList = getDropList(dropType); if (getDropList(dropType) == null)
if (dropList == null)
{ {
return null; return null;
} }
final List<DropHolder> dropList = new ArrayList<>(getDropList(dropType));
// randomize drop order // randomize drop order
Collections.shuffle(dropList); Collections.shuffle(dropList);

View File

@ -689,12 +689,13 @@ public final class L2NpcTemplate extends L2CharTemplate implements IIdentifiable
public Collection<ItemHolder> calculateDrops(DropType dropType, L2Character victim, L2Character killer) public Collection<ItemHolder> calculateDrops(DropType dropType, L2Character victim, L2Character killer)
{ {
final List<DropHolder> dropList = getDropList(dropType); if (getDropList(dropType) == null)
if (dropList == null)
{ {
return null; return null;
} }
final List<DropHolder> dropList = new ArrayList<>(getDropList(dropType));
// randomize drop order // randomize drop order
Collections.shuffle(dropList); Collections.shuffle(dropList);