Changed synchronization method for getAi.
This commit is contained in:
@@ -1742,12 +1742,18 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
* Gets this creature's AI.
|
* Gets this creature's AI.
|
||||||
* @return the AI
|
* @return the AI
|
||||||
*/
|
*/
|
||||||
public synchronized CreatureAI getAI()
|
public CreatureAI getAI()
|
||||||
{
|
{
|
||||||
CreatureAI ai = _ai;
|
CreatureAI ai = _ai;
|
||||||
if (ai == null)
|
if (ai == null)
|
||||||
{
|
{
|
||||||
_ai = ai = initAI();
|
synchronized (this)
|
||||||
|
{
|
||||||
|
if (_ai == null)
|
||||||
|
{
|
||||||
|
_ai = ai = initAI();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return ai;
|
return ai;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1742,12 +1742,18 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
* Gets this creature's AI.
|
* Gets this creature's AI.
|
||||||
* @return the AI
|
* @return the AI
|
||||||
*/
|
*/
|
||||||
public synchronized CreatureAI getAI()
|
public CreatureAI getAI()
|
||||||
{
|
{
|
||||||
CreatureAI ai = _ai;
|
CreatureAI ai = _ai;
|
||||||
if (ai == null)
|
if (ai == null)
|
||||||
{
|
{
|
||||||
_ai = ai = initAI();
|
synchronized (this)
|
||||||
|
{
|
||||||
|
if (_ai == null)
|
||||||
|
{
|
||||||
|
_ai = ai = initAI();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return ai;
|
return ai;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1742,12 +1742,18 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
* Gets this creature's AI.
|
* Gets this creature's AI.
|
||||||
* @return the AI
|
* @return the AI
|
||||||
*/
|
*/
|
||||||
public synchronized CreatureAI getAI()
|
public CreatureAI getAI()
|
||||||
{
|
{
|
||||||
CreatureAI ai = _ai;
|
CreatureAI ai = _ai;
|
||||||
if (ai == null)
|
if (ai == null)
|
||||||
{
|
{
|
||||||
_ai = ai = initAI();
|
synchronized (this)
|
||||||
|
{
|
||||||
|
if (_ai == null)
|
||||||
|
{
|
||||||
|
_ai = ai = initAI();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return ai;
|
return ai;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1742,12 +1742,18 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
* Gets this creature's AI.
|
* Gets this creature's AI.
|
||||||
* @return the AI
|
* @return the AI
|
||||||
*/
|
*/
|
||||||
public synchronized CreatureAI getAI()
|
public CreatureAI getAI()
|
||||||
{
|
{
|
||||||
CreatureAI ai = _ai;
|
CreatureAI ai = _ai;
|
||||||
if (ai == null)
|
if (ai == null)
|
||||||
{
|
{
|
||||||
_ai = ai = initAI();
|
synchronized (this)
|
||||||
|
{
|
||||||
|
if (_ai == null)
|
||||||
|
{
|
||||||
|
_ai = ai = initAI();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return ai;
|
return ai;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1742,12 +1742,18 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
* Gets this creature's AI.
|
* Gets this creature's AI.
|
||||||
* @return the AI
|
* @return the AI
|
||||||
*/
|
*/
|
||||||
public synchronized CreatureAI getAI()
|
public CreatureAI getAI()
|
||||||
{
|
{
|
||||||
CreatureAI ai = _ai;
|
CreatureAI ai = _ai;
|
||||||
if (ai == null)
|
if (ai == null)
|
||||||
{
|
{
|
||||||
_ai = ai = initAI();
|
synchronized (this)
|
||||||
|
{
|
||||||
|
if (_ai == null)
|
||||||
|
{
|
||||||
|
_ai = ai = initAI();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return ai;
|
return ai;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1742,12 +1742,18 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
* Gets this creature's AI.
|
* Gets this creature's AI.
|
||||||
* @return the AI
|
* @return the AI
|
||||||
*/
|
*/
|
||||||
public synchronized CreatureAI getAI()
|
public CreatureAI getAI()
|
||||||
{
|
{
|
||||||
CreatureAI ai = _ai;
|
CreatureAI ai = _ai;
|
||||||
if (ai == null)
|
if (ai == null)
|
||||||
{
|
{
|
||||||
_ai = ai = initAI();
|
synchronized (this)
|
||||||
|
{
|
||||||
|
if (_ai == null)
|
||||||
|
{
|
||||||
|
_ai = ai = initAI();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return ai;
|
return ai;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1742,12 +1742,18 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
* Gets this creature's AI.
|
* Gets this creature's AI.
|
||||||
* @return the AI
|
* @return the AI
|
||||||
*/
|
*/
|
||||||
public synchronized CreatureAI getAI()
|
public CreatureAI getAI()
|
||||||
{
|
{
|
||||||
CreatureAI ai = _ai;
|
CreatureAI ai = _ai;
|
||||||
if (ai == null)
|
if (ai == null)
|
||||||
{
|
{
|
||||||
_ai = ai = initAI();
|
synchronized (this)
|
||||||
|
{
|
||||||
|
if (_ai == null)
|
||||||
|
{
|
||||||
|
_ai = ai = initAI();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return ai;
|
return ai;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1742,12 +1742,18 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
* Gets this creature's AI.
|
* Gets this creature's AI.
|
||||||
* @return the AI
|
* @return the AI
|
||||||
*/
|
*/
|
||||||
public synchronized CreatureAI getAI()
|
public CreatureAI getAI()
|
||||||
{
|
{
|
||||||
CreatureAI ai = _ai;
|
CreatureAI ai = _ai;
|
||||||
if (ai == null)
|
if (ai == null)
|
||||||
{
|
{
|
||||||
_ai = ai = initAI();
|
synchronized (this)
|
||||||
|
{
|
||||||
|
if (_ai == null)
|
||||||
|
{
|
||||||
|
_ai = ai = initAI();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return ai;
|
return ai;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2243,12 +2243,18 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
|
|||||||
* Gets this creature's AI.
|
* Gets this creature's AI.
|
||||||
* @return the AI
|
* @return the AI
|
||||||
*/
|
*/
|
||||||
public synchronized CreatureAI getAI()
|
public CreatureAI getAI()
|
||||||
{
|
{
|
||||||
CreatureAI ai = _ai;
|
CreatureAI ai = _ai;
|
||||||
if (ai == null)
|
if (ai == null)
|
||||||
{
|
{
|
||||||
_ai = ai = new CreatureAI(new AIAccessor());
|
synchronized (this)
|
||||||
|
{
|
||||||
|
if (_ai == null)
|
||||||
|
{
|
||||||
|
_ai = ai = new CreatureAI(new AIAccessor());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return ai;
|
return ai;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2498,12 +2498,18 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
* Gets this creature's AI.
|
* Gets this creature's AI.
|
||||||
* @return the AI
|
* @return the AI
|
||||||
*/
|
*/
|
||||||
public synchronized CreatureAI getAI()
|
public CreatureAI getAI()
|
||||||
{
|
{
|
||||||
CreatureAI ai = _ai;
|
CreatureAI ai = _ai;
|
||||||
if (ai == null)
|
if (ai == null)
|
||||||
{
|
{
|
||||||
_ai = ai = initAI();
|
synchronized (this)
|
||||||
|
{
|
||||||
|
if (_ai == null)
|
||||||
|
{
|
||||||
|
_ai = ai = initAI();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return ai;
|
return ai;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2500,12 +2500,18 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
* Gets this creature's AI.
|
* Gets this creature's AI.
|
||||||
* @return the AI
|
* @return the AI
|
||||||
*/
|
*/
|
||||||
public synchronized CreatureAI getAI()
|
public CreatureAI getAI()
|
||||||
{
|
{
|
||||||
CreatureAI ai = _ai;
|
CreatureAI ai = _ai;
|
||||||
if (ai == null)
|
if (ai == null)
|
||||||
{
|
{
|
||||||
_ai = ai = initAI();
|
synchronized (this)
|
||||||
|
{
|
||||||
|
if (_ai == null)
|
||||||
|
{
|
||||||
|
_ai = ai = initAI();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return ai;
|
return ai;
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-2
@@ -1741,12 +1741,18 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
* Gets this creature's AI.
|
* Gets this creature's AI.
|
||||||
* @return the AI
|
* @return the AI
|
||||||
*/
|
*/
|
||||||
public synchronized CreatureAI getAI()
|
public CreatureAI getAI()
|
||||||
{
|
{
|
||||||
CreatureAI ai = _ai;
|
CreatureAI ai = _ai;
|
||||||
if (ai == null)
|
if (ai == null)
|
||||||
{
|
{
|
||||||
_ai = ai = initAI();
|
synchronized (this)
|
||||||
|
{
|
||||||
|
if (_ai == null)
|
||||||
|
{
|
||||||
|
_ai = ai = initAI();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return ai;
|
return ai;
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-2
@@ -1741,12 +1741,18 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
* Gets this creature's AI.
|
* Gets this creature's AI.
|
||||||
* @return the AI
|
* @return the AI
|
||||||
*/
|
*/
|
||||||
public synchronized CreatureAI getAI()
|
public CreatureAI getAI()
|
||||||
{
|
{
|
||||||
CreatureAI ai = _ai;
|
CreatureAI ai = _ai;
|
||||||
if (ai == null)
|
if (ai == null)
|
||||||
{
|
{
|
||||||
_ai = ai = initAI();
|
synchronized (this)
|
||||||
|
{
|
||||||
|
if (_ai == null)
|
||||||
|
{
|
||||||
|
_ai = ai = initAI();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return ai;
|
return ai;
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-2
@@ -1741,12 +1741,18 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
* Gets this creature's AI.
|
* Gets this creature's AI.
|
||||||
* @return the AI
|
* @return the AI
|
||||||
*/
|
*/
|
||||||
public synchronized CreatureAI getAI()
|
public CreatureAI getAI()
|
||||||
{
|
{
|
||||||
CreatureAI ai = _ai;
|
CreatureAI ai = _ai;
|
||||||
if (ai == null)
|
if (ai == null)
|
||||||
{
|
{
|
||||||
_ai = ai = initAI();
|
synchronized (this)
|
||||||
|
{
|
||||||
|
if (_ai == null)
|
||||||
|
{
|
||||||
|
_ai = ai = initAI();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return ai;
|
return ai;
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-2
@@ -1742,12 +1742,18 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
* Gets this creature's AI.
|
* Gets this creature's AI.
|
||||||
* @return the AI
|
* @return the AI
|
||||||
*/
|
*/
|
||||||
public synchronized CreatureAI getAI()
|
public CreatureAI getAI()
|
||||||
{
|
{
|
||||||
CreatureAI ai = _ai;
|
CreatureAI ai = _ai;
|
||||||
if (ai == null)
|
if (ai == null)
|
||||||
{
|
{
|
||||||
_ai = ai = initAI();
|
synchronized (this)
|
||||||
|
{
|
||||||
|
if (_ai == null)
|
||||||
|
{
|
||||||
|
_ai = ai = initAI();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return ai;
|
return ai;
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-2
@@ -1742,12 +1742,18 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
* Gets this creature's AI.
|
* Gets this creature's AI.
|
||||||
* @return the AI
|
* @return the AI
|
||||||
*/
|
*/
|
||||||
public synchronized CreatureAI getAI()
|
public CreatureAI getAI()
|
||||||
{
|
{
|
||||||
CreatureAI ai = _ai;
|
CreatureAI ai = _ai;
|
||||||
if (ai == null)
|
if (ai == null)
|
||||||
{
|
{
|
||||||
_ai = ai = initAI();
|
synchronized (this)
|
||||||
|
{
|
||||||
|
if (_ai == null)
|
||||||
|
{
|
||||||
|
_ai = ai = initAI();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return ai;
|
return ai;
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-2
@@ -1742,12 +1742,18 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
* Gets this creature's AI.
|
* Gets this creature's AI.
|
||||||
* @return the AI
|
* @return the AI
|
||||||
*/
|
*/
|
||||||
public synchronized CreatureAI getAI()
|
public CreatureAI getAI()
|
||||||
{
|
{
|
||||||
CreatureAI ai = _ai;
|
CreatureAI ai = _ai;
|
||||||
if (ai == null)
|
if (ai == null)
|
||||||
{
|
{
|
||||||
_ai = ai = initAI();
|
synchronized (this)
|
||||||
|
{
|
||||||
|
if (_ai == null)
|
||||||
|
{
|
||||||
|
_ai = ai = initAI();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return ai;
|
return ai;
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-2
@@ -1741,12 +1741,18 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
* Gets this creature's AI.
|
* Gets this creature's AI.
|
||||||
* @return the AI
|
* @return the AI
|
||||||
*/
|
*/
|
||||||
public synchronized CreatureAI getAI()
|
public CreatureAI getAI()
|
||||||
{
|
{
|
||||||
CreatureAI ai = _ai;
|
CreatureAI ai = _ai;
|
||||||
if (ai == null)
|
if (ai == null)
|
||||||
{
|
{
|
||||||
_ai = ai = initAI();
|
synchronized (this)
|
||||||
|
{
|
||||||
|
if (_ai == null)
|
||||||
|
{
|
||||||
|
_ai = ai = initAI();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return ai;
|
return ai;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user