Fixed NPEs from getAI method.
Contributed by Sahar.
This commit is contained in:
@ -1780,7 +1780,8 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
*/
|
||||
public CreatureAI getAI()
|
||||
{
|
||||
if (_ai == null)
|
||||
CreatureAI ai = _ai;
|
||||
if (ai == null)
|
||||
{
|
||||
synchronized (this)
|
||||
{
|
||||
@ -1790,7 +1791,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
}
|
||||
}
|
||||
}
|
||||
return _ai;
|
||||
return ai;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user