Prevent getAI NPE.

Contributed by Sahar.
This commit is contained in:
MobiusDevelopment 2019-11-04 20:31:47 +00:00
parent eaa8f64803
commit a7d7160fce
18 changed files with 36 additions and 18 deletions

View File

@ -1749,7 +1749,8 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{ {
synchronized (this) synchronized (this)
{ {
if (_ai == null) ai = _ai;
if (ai == null)
{ {
_ai = ai = initAI(); _ai = ai = initAI();
} }

View File

@ -1749,7 +1749,8 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{ {
synchronized (this) synchronized (this)
{ {
if (_ai == null) ai = _ai;
if (ai == null)
{ {
_ai = ai = initAI(); _ai = ai = initAI();
} }

View File

@ -1749,7 +1749,8 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{ {
synchronized (this) synchronized (this)
{ {
if (_ai == null) ai = _ai;
if (ai == null)
{ {
_ai = ai = initAI(); _ai = ai = initAI();
} }

View File

@ -1749,7 +1749,8 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{ {
synchronized (this) synchronized (this)
{ {
if (_ai == null) ai = _ai;
if (ai == null)
{ {
_ai = ai = initAI(); _ai = ai = initAI();
} }

View File

@ -1749,7 +1749,8 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{ {
synchronized (this) synchronized (this)
{ {
if (_ai == null) ai = _ai;
if (ai == null)
{ {
_ai = ai = initAI(); _ai = ai = initAI();
} }

View File

@ -1749,7 +1749,8 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{ {
synchronized (this) synchronized (this)
{ {
if (_ai == null) ai = _ai;
if (ai == null)
{ {
_ai = ai = initAI(); _ai = ai = initAI();
} }

View File

@ -1749,7 +1749,8 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{ {
synchronized (this) synchronized (this)
{ {
if (_ai == null) ai = _ai;
if (ai == null)
{ {
_ai = ai = initAI(); _ai = ai = initAI();
} }

View File

@ -1749,7 +1749,8 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{ {
synchronized (this) synchronized (this)
{ {
if (_ai == null) ai = _ai;
if (ai == null)
{ {
_ai = ai = initAI(); _ai = ai = initAI();
} }

View File

@ -2250,7 +2250,8 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
{ {
synchronized (this) synchronized (this)
{ {
if (_ai == null) ai = _ai;
if (ai == null)
{ {
_ai = ai = new CreatureAI(new AIAccessor()); _ai = ai = new CreatureAI(new AIAccessor());
} }

View File

@ -2505,7 +2505,8 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{ {
synchronized (this) synchronized (this)
{ {
if (_ai == null) ai = _ai;
if (ai == null)
{ {
_ai = ai = initAI(); _ai = ai = initAI();
} }

View File

@ -2507,7 +2507,8 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{ {
synchronized (this) synchronized (this)
{ {
if (_ai == null) ai = _ai;
if (ai == null)
{ {
_ai = ai = initAI(); _ai = ai = initAI();
} }

View File

@ -1748,7 +1748,8 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{ {
synchronized (this) synchronized (this)
{ {
if (_ai == null) ai = _ai;
if (ai == null)
{ {
_ai = ai = initAI(); _ai = ai = initAI();
} }

View File

@ -1748,7 +1748,8 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{ {
synchronized (this) synchronized (this)
{ {
if (_ai == null) ai = _ai;
if (ai == null)
{ {
_ai = ai = initAI(); _ai = ai = initAI();
} }

View File

@ -1748,7 +1748,8 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{ {
synchronized (this) synchronized (this)
{ {
if (_ai == null) ai = _ai;
if (ai == null)
{ {
_ai = ai = initAI(); _ai = ai = initAI();
} }

View File

@ -1749,7 +1749,8 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{ {
synchronized (this) synchronized (this)
{ {
if (_ai == null) ai = _ai;
if (ai == null)
{ {
_ai = ai = initAI(); _ai = ai = initAI();
} }

View File

@ -1749,7 +1749,8 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{ {
synchronized (this) synchronized (this)
{ {
if (_ai == null) ai = _ai;
if (ai == null)
{ {
_ai = ai = initAI(); _ai = ai = initAI();
} }

View File

@ -1749,7 +1749,8 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{ {
synchronized (this) synchronized (this)
{ {
if (_ai == null) ai = _ai;
if (ai == null)
{ {
_ai = ai = initAI(); _ai = ai = initAI();
} }

View File

@ -1748,7 +1748,8 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{ {
synchronized (this) synchronized (this)
{ {
if (_ai == null) ai = _ai;
if (ai == null)
{ {
_ai = ai = initAI(); _ai = ai = initAI();
} }