Fixed potential Attackable NPE.
This commit is contained in:
@@ -134,16 +134,16 @@ public class Attackable extends Npc
|
|||||||
}
|
}
|
||||||
else if (isDead())
|
else if (isDead())
|
||||||
{
|
{
|
||||||
final Attackable attackable = this;
|
synchronized (this)
|
||||||
synchronized (attackable)
|
|
||||||
{
|
{
|
||||||
if (!_killedAlready)
|
if (!_killedAlready)
|
||||||
{
|
{
|
||||||
_killedAlready = true;
|
_killedAlready = true;
|
||||||
stopRandomWalking();
|
stopRandomWalking();
|
||||||
stopTargetScan();
|
stopTargetScan();
|
||||||
calculateRewards(attacker);
|
calculateRewards();
|
||||||
|
if (attacker != null)
|
||||||
|
{
|
||||||
final Player killer = attacker.getActingPlayer();
|
final Player killer = attacker.getActingPlayer();
|
||||||
if ((killer != null) && (killer.getKarma() > 0))
|
if ((killer != null) && (killer.getKarma() > 0))
|
||||||
{
|
{
|
||||||
@@ -153,8 +153,9 @@ public class Attackable extends Npc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void calculateRewards(Creature lastAttacker)
|
private void calculateRewards()
|
||||||
{
|
{
|
||||||
// TODO: Figure iterator logic and replace with for, if possible.
|
// TODO: Figure iterator logic and replace with for, if possible.
|
||||||
Iterator<WorldObject> it = _aggroList.keySet().iterator();
|
Iterator<WorldObject> it = _aggroList.keySet().iterator();
|
||||||
|
Reference in New Issue
Block a user