Fixed VIP system drop calculation NPE.
This commit is contained in:
parent
540269eeb9
commit
6ea7138826
@ -774,9 +774,22 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
calculatedDrops.addAll(Config.CHAMPION_REWARD_ITEMS);
|
calculatedDrops.addAll(Config.CHAMPION_REWARD_ITEMS);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dropType == DropType.DROP)
|
if (Config.VIP_SYSTEM_ENABLED && (dropType == DropType.DROP))
|
||||||
{
|
{
|
||||||
|
// list may be null here
|
||||||
|
if (calculatedDrops == null)
|
||||||
|
{
|
||||||
|
calculatedDrops = new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
// calculate vip drops
|
||||||
processVipDrops(calculatedDrops, victim, killer);
|
processVipDrops(calculatedDrops, victim, killer);
|
||||||
|
|
||||||
|
// returning empty list may cause problems
|
||||||
|
if (calculatedDrops.isEmpty())
|
||||||
|
{
|
||||||
|
calculatedDrops = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return calculatedDrops;
|
return calculatedDrops;
|
||||||
|
@ -774,9 +774,22 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
calculatedDrops.addAll(Config.CHAMPION_REWARD_ITEMS);
|
calculatedDrops.addAll(Config.CHAMPION_REWARD_ITEMS);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dropType == DropType.DROP)
|
if (Config.VIP_SYSTEM_ENABLED && (dropType == DropType.DROP))
|
||||||
{
|
{
|
||||||
|
// list may be null here
|
||||||
|
if (calculatedDrops == null)
|
||||||
|
{
|
||||||
|
calculatedDrops = new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
// calculate vip drops
|
||||||
processVipDrops(calculatedDrops, victim, killer);
|
processVipDrops(calculatedDrops, victim, killer);
|
||||||
|
|
||||||
|
// returning empty list may cause problems
|
||||||
|
if (calculatedDrops.isEmpty())
|
||||||
|
{
|
||||||
|
calculatedDrops = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return calculatedDrops;
|
return calculatedDrops;
|
||||||
|
@ -774,9 +774,22 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
calculatedDrops.addAll(Config.CHAMPION_REWARD_ITEMS);
|
calculatedDrops.addAll(Config.CHAMPION_REWARD_ITEMS);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dropType == DropType.DROP)
|
if (Config.VIP_SYSTEM_ENABLED && (dropType == DropType.DROP))
|
||||||
{
|
{
|
||||||
|
// list may be null here
|
||||||
|
if (calculatedDrops == null)
|
||||||
|
{
|
||||||
|
calculatedDrops = new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
// calculate vip drops
|
||||||
processVipDrops(calculatedDrops, victim, killer);
|
processVipDrops(calculatedDrops, victim, killer);
|
||||||
|
|
||||||
|
// returning empty list may cause problems
|
||||||
|
if (calculatedDrops.isEmpty())
|
||||||
|
{
|
||||||
|
calculatedDrops = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return calculatedDrops;
|
return calculatedDrops;
|
||||||
|
@ -789,9 +789,22 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
calculatedDrops.addAll(Config.CHAMPION_REWARD_ITEMS);
|
calculatedDrops.addAll(Config.CHAMPION_REWARD_ITEMS);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dropType == DropType.DROP)
|
if (Config.VIP_SYSTEM_ENABLED && (dropType == DropType.DROP))
|
||||||
{
|
{
|
||||||
|
// list may be null here
|
||||||
|
if (calculatedDrops == null)
|
||||||
|
{
|
||||||
|
calculatedDrops = new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
// calculate vip drops
|
||||||
processVipDrops(calculatedDrops, victim, killer);
|
processVipDrops(calculatedDrops, victim, killer);
|
||||||
|
|
||||||
|
// returning empty list may cause problems
|
||||||
|
if (calculatedDrops.isEmpty())
|
||||||
|
{
|
||||||
|
calculatedDrops = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return calculatedDrops;
|
return calculatedDrops;
|
||||||
|
@ -789,9 +789,22 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
calculatedDrops.addAll(Config.CHAMPION_REWARD_ITEMS);
|
calculatedDrops.addAll(Config.CHAMPION_REWARD_ITEMS);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dropType == DropType.DROP)
|
if (Config.VIP_SYSTEM_ENABLED && (dropType == DropType.DROP))
|
||||||
{
|
{
|
||||||
|
// list may be null here
|
||||||
|
if (calculatedDrops == null)
|
||||||
|
{
|
||||||
|
calculatedDrops = new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
// calculate vip drops
|
||||||
processVipDrops(calculatedDrops, victim, killer);
|
processVipDrops(calculatedDrops, victim, killer);
|
||||||
|
|
||||||
|
// returning empty list may cause problems
|
||||||
|
if (calculatedDrops.isEmpty())
|
||||||
|
{
|
||||||
|
calculatedDrops = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return calculatedDrops;
|
return calculatedDrops;
|
||||||
|
@ -789,9 +789,22 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
calculatedDrops.addAll(Config.CHAMPION_REWARD_ITEMS);
|
calculatedDrops.addAll(Config.CHAMPION_REWARD_ITEMS);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dropType == DropType.DROP)
|
if (Config.VIP_SYSTEM_ENABLED && (dropType == DropType.DROP))
|
||||||
{
|
{
|
||||||
|
// list may be null here
|
||||||
|
if (calculatedDrops == null)
|
||||||
|
{
|
||||||
|
calculatedDrops = new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
// calculate vip drops
|
||||||
processVipDrops(calculatedDrops, victim, killer);
|
processVipDrops(calculatedDrops, victim, killer);
|
||||||
|
|
||||||
|
// returning empty list may cause problems
|
||||||
|
if (calculatedDrops.isEmpty())
|
||||||
|
{
|
||||||
|
calculatedDrops = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return calculatedDrops;
|
return calculatedDrops;
|
||||||
|
Loading…
Reference in New Issue
Block a user