Prevent setting region to null from within L2Object.
This commit is contained in:
		| @@ -151,7 +151,6 @@ public abstract class L2Object extends ListenersContainer implements IIdentifiab | ||||
| 		_isSpawned = false; | ||||
| 		L2World.getInstance().removeVisibleObject(this, _worldRegion); | ||||
| 		L2World.getInstance().removeObject(this); | ||||
| 		setWorldRegion(null); | ||||
| 		return true; | ||||
| 	} | ||||
| 	 | ||||
| @@ -229,16 +228,12 @@ public abstract class L2Object extends ListenersContainer implements IIdentifiab | ||||
| 	 | ||||
| 	public final boolean isSpawned() | ||||
| 	{ | ||||
| 		return _worldRegion != null; | ||||
| 		return _isSpawned; | ||||
| 	} | ||||
| 	 | ||||
| 	public final void setSpawned(boolean value) | ||||
| 	{ | ||||
| 		_isSpawned = value; | ||||
| 		if (!_isSpawned) | ||||
| 		{ | ||||
| 			setWorldRegion(null); | ||||
| 		} | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
|   | ||||
| @@ -1665,6 +1665,10 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe | ||||
| 		 | ||||
| 		// Cancel all timers related to this Creature | ||||
| 		TimersManager.getInstance().cancelTimers(getObjectId()); | ||||
| 		 | ||||
| 		// Set world region to null. | ||||
| 		setWorldRegion(null); | ||||
| 		 | ||||
| 		return true; | ||||
| 	} | ||||
| 	 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 MobiusDev
					MobiusDev