Fixed serious infinite loop issues coming from cubics.
Contributed by Sahar.
This commit is contained in:
@@ -74,7 +74,6 @@ public class CubicInstance
|
|||||||
protected int _matk;
|
protected int _matk;
|
||||||
protected int _activationtime;
|
protected int _activationtime;
|
||||||
protected int _activationchance;
|
protected int _activationchance;
|
||||||
protected boolean _active;
|
|
||||||
private final boolean _givenByOther;
|
private final boolean _givenByOther;
|
||||||
protected List<Skill> _skills = new ArrayList<>();
|
protected List<Skill> _skills = new ArrayList<>();
|
||||||
private Future<?> _disappearTask;
|
private Future<?> _disappearTask;
|
||||||
@@ -98,7 +97,6 @@ public class CubicInstance
|
|||||||
_matk = mAtk;
|
_matk = mAtk;
|
||||||
_activationtime = activationtime * 1000;
|
_activationtime = activationtime * 1000;
|
||||||
_activationchance = activationchance;
|
_activationchance = activationchance;
|
||||||
_active = false;
|
|
||||||
_givenByOther = givenByOther;
|
_givenByOther = givenByOther;
|
||||||
|
|
||||||
switch (_id)
|
switch (_id)
|
||||||
@@ -241,17 +239,14 @@ public class CubicInstance
|
|||||||
_disappearTask = ThreadPool.schedule(new Disappear(), totallifetime); // disappear
|
_disappearTask = ThreadPool.schedule(new Disappear(), totallifetime); // disappear
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public void doAction()
|
||||||
* Do action.
|
|
||||||
*/
|
|
||||||
public synchronized void doAction()
|
|
||||||
{
|
{
|
||||||
if (_active)
|
if (_actionTask == null)
|
||||||
|
{
|
||||||
|
synchronized (this)
|
||||||
|
{
|
||||||
|
if (_actionTask == null)
|
||||||
{
|
{
|
||||||
return;
|
|
||||||
}
|
|
||||||
_active = true;
|
|
||||||
|
|
||||||
switch (_id)
|
switch (_id)
|
||||||
{
|
{
|
||||||
case AQUA_CUBIC:
|
case AQUA_CUBIC:
|
||||||
@@ -278,6 +273,9 @@ public class CubicInstance
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the id.
|
* Gets the id.
|
||||||
@@ -332,7 +330,6 @@ public class CubicInstance
|
|||||||
}
|
}
|
||||||
_actionTask = null;
|
_actionTask = null;
|
||||||
}
|
}
|
||||||
_active = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -81,7 +81,6 @@ public class CubicInstance implements IIdentifiable
|
|||||||
private final int _cubicDelay;
|
private final int _cubicDelay;
|
||||||
private final int _cubicSkillChance;
|
private final int _cubicSkillChance;
|
||||||
private final int _cubicMaxCount;
|
private final int _cubicMaxCount;
|
||||||
private boolean _active;
|
|
||||||
private final boolean _givenByOther;
|
private final boolean _givenByOther;
|
||||||
|
|
||||||
private final List<Skill> _skills = new ArrayList<>();
|
private final List<Skill> _skills = new ArrayList<>();
|
||||||
@@ -97,7 +96,6 @@ public class CubicInstance implements IIdentifiable
|
|||||||
_cubicDelay = cubicDelay * 1000;
|
_cubicDelay = cubicDelay * 1000;
|
||||||
_cubicSkillChance = cubicSkillChance;
|
_cubicSkillChance = cubicSkillChance;
|
||||||
_cubicMaxCount = cubicMaxCount;
|
_cubicMaxCount = cubicMaxCount;
|
||||||
_active = false;
|
|
||||||
_givenByOther = givenByOther;
|
_givenByOther = givenByOther;
|
||||||
|
|
||||||
switch (_cubicId)
|
switch (_cubicId)
|
||||||
@@ -185,14 +183,14 @@ public class CubicInstance implements IIdentifiable
|
|||||||
_disappearTask = ThreadPool.schedule(new CubicDisappear(this), cubicDuration * 1000); // disappear
|
_disappearTask = ThreadPool.schedule(new CubicDisappear(this), cubicDuration * 1000); // disappear
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void doAction()
|
public void doAction()
|
||||||
{
|
{
|
||||||
if (_active)
|
if (_actionTask == null)
|
||||||
|
{
|
||||||
|
synchronized (this)
|
||||||
|
{
|
||||||
|
if (_actionTask == null)
|
||||||
{
|
{
|
||||||
return;
|
|
||||||
}
|
|
||||||
_active = true;
|
|
||||||
|
|
||||||
switch (_cubicId)
|
switch (_cubicId)
|
||||||
{
|
{
|
||||||
case AQUA_CUBIC:
|
case AQUA_CUBIC:
|
||||||
@@ -219,6 +217,9 @@ public class CubicInstance implements IIdentifiable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getId()
|
public int getId()
|
||||||
@@ -264,7 +265,6 @@ public class CubicInstance implements IIdentifiable
|
|||||||
_actionTask.cancel(true);
|
_actionTask.cancel(true);
|
||||||
_actionTask = null;
|
_actionTask = null;
|
||||||
}
|
}
|
||||||
_active = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void cancelDisappear()
|
public void cancelDisappear()
|
||||||
|
@@ -81,7 +81,6 @@ public class CubicInstance implements IIdentifiable
|
|||||||
private final int _cubicDelay;
|
private final int _cubicDelay;
|
||||||
private final int _cubicSkillChance;
|
private final int _cubicSkillChance;
|
||||||
private final int _cubicMaxCount;
|
private final int _cubicMaxCount;
|
||||||
private boolean _active;
|
|
||||||
private final boolean _givenByOther;
|
private final boolean _givenByOther;
|
||||||
|
|
||||||
private final List<Skill> _skills = new ArrayList<>();
|
private final List<Skill> _skills = new ArrayList<>();
|
||||||
@@ -97,7 +96,6 @@ public class CubicInstance implements IIdentifiable
|
|||||||
_cubicDelay = cubicDelay * 1000;
|
_cubicDelay = cubicDelay * 1000;
|
||||||
_cubicSkillChance = cubicSkillChance;
|
_cubicSkillChance = cubicSkillChance;
|
||||||
_cubicMaxCount = cubicMaxCount;
|
_cubicMaxCount = cubicMaxCount;
|
||||||
_active = false;
|
|
||||||
_givenByOther = givenByOther;
|
_givenByOther = givenByOther;
|
||||||
|
|
||||||
switch (_cubicId)
|
switch (_cubicId)
|
||||||
@@ -185,14 +183,14 @@ public class CubicInstance implements IIdentifiable
|
|||||||
_disappearTask = ThreadPool.schedule(new CubicDisappear(this), cubicDuration * 1000); // disappear
|
_disappearTask = ThreadPool.schedule(new CubicDisappear(this), cubicDuration * 1000); // disappear
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void doAction()
|
public void doAction()
|
||||||
{
|
{
|
||||||
if (_active)
|
if (_actionTask == null)
|
||||||
|
{
|
||||||
|
synchronized (this)
|
||||||
|
{
|
||||||
|
if (_actionTask == null)
|
||||||
{
|
{
|
||||||
return;
|
|
||||||
}
|
|
||||||
_active = true;
|
|
||||||
|
|
||||||
switch (_cubicId)
|
switch (_cubicId)
|
||||||
{
|
{
|
||||||
case AQUA_CUBIC:
|
case AQUA_CUBIC:
|
||||||
@@ -219,6 +217,9 @@ public class CubicInstance implements IIdentifiable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getId()
|
public int getId()
|
||||||
@@ -264,7 +265,6 @@ public class CubicInstance implements IIdentifiable
|
|||||||
_actionTask.cancel(true);
|
_actionTask.cancel(true);
|
||||||
_actionTask = null;
|
_actionTask = null;
|
||||||
}
|
}
|
||||||
_active = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void cancelDisappear()
|
public void cancelDisappear()
|
||||||
|
Reference in New Issue
Block a user