Fixed VIP system drop calculation NPE.

This commit is contained in:
MobiusDevelopment 2021-12-08 04:03:06 +00:00
parent 540269eeb9
commit 6ea7138826
6 changed files with 84 additions and 6 deletions

View File

@ -774,9 +774,22 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
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);
// returning empty list may cause problems
if (calculatedDrops.isEmpty())
{
calculatedDrops = null;
}
}
return calculatedDrops;

View File

@ -774,9 +774,22 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
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);
// returning empty list may cause problems
if (calculatedDrops.isEmpty())
{
calculatedDrops = null;
}
}
return calculatedDrops;

View File

@ -774,9 +774,22 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
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);
// returning empty list may cause problems
if (calculatedDrops.isEmpty())
{
calculatedDrops = null;
}
}
return calculatedDrops;

View File

@ -789,9 +789,22 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
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);
// returning empty list may cause problems
if (calculatedDrops.isEmpty())
{
calculatedDrops = null;
}
}
return calculatedDrops;

View File

@ -789,9 +789,22 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
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);
// returning empty list may cause problems
if (calculatedDrops.isEmpty())
{
calculatedDrops = null;
}
}
return calculatedDrops;

View File

@ -789,9 +789,22 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
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);
// returning empty list may cause problems
if (calculatedDrops.isEmpty())
{
calculatedDrops = null;
}
}
return calculatedDrops;