Prevent setting region to null from within L2Object.

This commit is contained in:
MobiusDev 2018-09-07 16:46:53 +00:00
parent dac759a2d4
commit 25c1d5e28c
16 changed files with 40 additions and 48 deletions

View File

@ -151,7 +151,6 @@ public abstract class L2Object extends ListenersContainer implements IIdentifiab
_isSpawned = false; _isSpawned = false;
L2World.getInstance().removeVisibleObject(this, _worldRegion); L2World.getInstance().removeVisibleObject(this, _worldRegion);
L2World.getInstance().removeObject(this); L2World.getInstance().removeObject(this);
setWorldRegion(null);
return true; return true;
} }
@ -229,16 +228,12 @@ public abstract class L2Object extends ListenersContainer implements IIdentifiab
public final boolean isSpawned() public final boolean isSpawned()
{ {
return _worldRegion != null; return _isSpawned;
} }
public final void setSpawned(boolean value) public final void setSpawned(boolean value)
{ {
_isSpawned = value; _isSpawned = value;
if (!_isSpawned)
{
setWorldRegion(null);
}
} }
@Override @Override

View File

@ -1665,6 +1665,10 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
// Cancel all timers related to this Creature // Cancel all timers related to this Creature
TimersManager.getInstance().cancelTimers(getObjectId()); TimersManager.getInstance().cancelTimers(getObjectId());
// Set world region to null.
setWorldRegion(null);
return true; return true;
} }

View File

@ -151,7 +151,6 @@ public abstract class L2Object extends ListenersContainer implements IIdentifiab
_isSpawned = false; _isSpawned = false;
L2World.getInstance().removeVisibleObject(this, _worldRegion); L2World.getInstance().removeVisibleObject(this, _worldRegion);
L2World.getInstance().removeObject(this); L2World.getInstance().removeObject(this);
setWorldRegion(null);
return true; return true;
} }
@ -229,16 +228,12 @@ public abstract class L2Object extends ListenersContainer implements IIdentifiab
public final boolean isSpawned() public final boolean isSpawned()
{ {
return _worldRegion != null; return _isSpawned;
} }
public final void setSpawned(boolean value) public final void setSpawned(boolean value)
{ {
_isSpawned = value; _isSpawned = value;
if (!_isSpawned)
{
setWorldRegion(null);
}
} }
@Override @Override

View File

@ -1665,6 +1665,10 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
// Cancel all timers related to this Creature // Cancel all timers related to this Creature
TimersManager.getInstance().cancelTimers(getObjectId()); TimersManager.getInstance().cancelTimers(getObjectId());
// Set world region to null.
setWorldRegion(null);
return true; return true;
} }

View File

@ -151,7 +151,6 @@ public abstract class L2Object extends ListenersContainer implements IIdentifiab
_isSpawned = false; _isSpawned = false;
L2World.getInstance().removeVisibleObject(this, _worldRegion); L2World.getInstance().removeVisibleObject(this, _worldRegion);
L2World.getInstance().removeObject(this); L2World.getInstance().removeObject(this);
setWorldRegion(null);
return true; return true;
} }
@ -229,16 +228,12 @@ public abstract class L2Object extends ListenersContainer implements IIdentifiab
public final boolean isSpawned() public final boolean isSpawned()
{ {
return _worldRegion != null; return _isSpawned;
} }
public final void setSpawned(boolean value) public final void setSpawned(boolean value)
{ {
_isSpawned = value; _isSpawned = value;
if (!_isSpawned)
{
setWorldRegion(null);
}
} }
@Override @Override

View File

@ -1665,6 +1665,10 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
// Cancel all timers related to this Creature // Cancel all timers related to this Creature
TimersManager.getInstance().cancelTimers(getObjectId()); TimersManager.getInstance().cancelTimers(getObjectId());
// Set world region to null.
setWorldRegion(null);
return true; return true;
} }

View File

@ -151,7 +151,6 @@ public abstract class L2Object extends ListenersContainer implements IIdentifiab
_isSpawned = false; _isSpawned = false;
L2World.getInstance().removeVisibleObject(this, _worldRegion); L2World.getInstance().removeVisibleObject(this, _worldRegion);
L2World.getInstance().removeObject(this); L2World.getInstance().removeObject(this);
setWorldRegion(null);
return true; return true;
} }
@ -229,16 +228,12 @@ public abstract class L2Object extends ListenersContainer implements IIdentifiab
public final boolean isSpawned() public final boolean isSpawned()
{ {
return _worldRegion != null; return _isSpawned;
} }
public final void setSpawned(boolean value) public final void setSpawned(boolean value)
{ {
_isSpawned = value; _isSpawned = value;
if (!_isSpawned)
{
setWorldRegion(null);
}
} }
@Override @Override

View File

@ -1665,6 +1665,10 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
// Cancel all timers related to this Creature // Cancel all timers related to this Creature
TimersManager.getInstance().cancelTimers(getObjectId()); TimersManager.getInstance().cancelTimers(getObjectId());
// Set world region to null.
setWorldRegion(null);
return true; return true;
} }

View File

@ -153,7 +153,6 @@ public abstract class L2Object extends ListenersContainer implements IIdentifiab
_isSpawned = false; _isSpawned = false;
L2World.getInstance().removeVisibleObject(this, _worldRegion); L2World.getInstance().removeVisibleObject(this, _worldRegion);
L2World.getInstance().removeObject(this); L2World.getInstance().removeObject(this);
setWorldRegion(null);
return true; return true;
} }
@ -231,16 +230,12 @@ public abstract class L2Object extends ListenersContainer implements IIdentifiab
public final boolean isSpawned() public final boolean isSpawned()
{ {
return _worldRegion != null; return _isSpawned;
} }
public final void setSpawned(boolean value) public final void setSpawned(boolean value)
{ {
_isSpawned = value; _isSpawned = value;
if (!_isSpawned)
{
setWorldRegion(null);
}
} }
@Override @Override

View File

@ -2419,6 +2419,10 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
{ {
getAI().stopAITask(); getAI().stopAITask();
} }
// Set world region to null.
setWorldRegion(null);
return true; return true;
} }

View File

@ -151,7 +151,6 @@ public abstract class L2Object extends ListenersContainer implements IIdentifiab
_isSpawned = false; _isSpawned = false;
L2World.getInstance().removeVisibleObject(this, _worldRegion); L2World.getInstance().removeVisibleObject(this, _worldRegion);
L2World.getInstance().removeObject(this); L2World.getInstance().removeObject(this);
setWorldRegion(null);
return true; return true;
} }
@ -229,16 +228,12 @@ public abstract class L2Object extends ListenersContainer implements IIdentifiab
public final boolean isSpawned() public final boolean isSpawned()
{ {
return _worldRegion != null; return _isSpawned;
} }
public final void setSpawned(boolean value) public final void setSpawned(boolean value)
{ {
_isSpawned = value; _isSpawned = value;
if (!_isSpawned)
{
setWorldRegion(null);
}
} }
@Override @Override

View File

@ -1665,6 +1665,10 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
// Cancel all timers related to this Creature // Cancel all timers related to this Creature
TimersManager.getInstance().cancelTimers(getObjectId()); TimersManager.getInstance().cancelTimers(getObjectId());
// Set world region to null.
setWorldRegion(null);
return true; return true;
} }

View File

@ -151,7 +151,6 @@ public abstract class L2Object extends ListenersContainer implements IIdentifiab
_isSpawned = false; _isSpawned = false;
L2World.getInstance().removeVisibleObject(this, _worldRegion); L2World.getInstance().removeVisibleObject(this, _worldRegion);
L2World.getInstance().removeObject(this); L2World.getInstance().removeObject(this);
setWorldRegion(null);
return true; return true;
} }
@ -229,16 +228,12 @@ public abstract class L2Object extends ListenersContainer implements IIdentifiab
public final boolean isSpawned() public final boolean isSpawned()
{ {
return _worldRegion != null; return _isSpawned;
} }
public final void setSpawned(boolean value) public final void setSpawned(boolean value)
{ {
_isSpawned = value; _isSpawned = value;
if (!_isSpawned)
{
setWorldRegion(null);
}
} }
@Override @Override

View File

@ -1665,6 +1665,10 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
// Cancel all timers related to this Creature // Cancel all timers related to this Creature
TimersManager.getInstance().cancelTimers(getObjectId()); TimersManager.getInstance().cancelTimers(getObjectId());
// Set world region to null.
setWorldRegion(null);
return true; return true;
} }

View File

@ -151,7 +151,6 @@ public abstract class L2Object extends ListenersContainer implements IIdentifiab
_isSpawned = false; _isSpawned = false;
L2World.getInstance().removeVisibleObject(this, _worldRegion); L2World.getInstance().removeVisibleObject(this, _worldRegion);
L2World.getInstance().removeObject(this); L2World.getInstance().removeObject(this);
setWorldRegion(null);
return true; return true;
} }
@ -229,16 +228,12 @@ public abstract class L2Object extends ListenersContainer implements IIdentifiab
public final boolean isSpawned() public final boolean isSpawned()
{ {
return _worldRegion != null; return _isSpawned;
} }
public final void setSpawned(boolean value) public final void setSpawned(boolean value)
{ {
_isSpawned = value; _isSpawned = value;
if (!_isSpawned)
{
setWorldRegion(null);
}
} }
@Override @Override

View File

@ -1665,6 +1665,10 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
// Cancel all timers related to this Creature // Cancel all timers related to this Creature
TimersManager.getInstance().cancelTimers(getObjectId()); TimersManager.getInstance().cancelTimers(getObjectId());
// Set world region to null.
setWorldRegion(null);
return true; return true;
} }