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