diff --git a/GameServer/gameobjects/GameObject.cs b/GameServer/gameobjects/GameObject.cs index 2ebbc3eb4c..ae29101114 100644 --- a/GameServer/gameobjects/GameObject.cs +++ b/GameServer/gameobjects/GameObject.cs @@ -115,7 +115,7 @@ public virtual Region CurrentRegion set { if(value == null) Position = Position.With(regionID: 0); - Position = Position.With(regionID: value.ID); + else Position = Position.With(regionID: value.ID); } } diff --git a/GameServer/gameobjects/GamePlayer.cs b/GameServer/gameobjects/GamePlayer.cs index a07bf64cc5..c0e7a9074a 100644 --- a/GameServer/gameobjects/GamePlayer.cs +++ b/GameServer/gameobjects/GamePlayer.cs @@ -9927,7 +9927,11 @@ public override bool MoveTo(Position position) if (!RemoveFromWorld()) return false; //notify event - CurrentRegion.Notify(RegionEvent.PlayerLeave, CurrentRegion, new RegionPlayerEventArgs(this)); + + if(CurrentRegion != null) + { + CurrentRegion.Notify(RegionEvent.PlayerLeave, CurrentRegion, new RegionPlayerEventArgs(this)); + } CancelAllConcentrationEffects(true); if (ControlledBrain != null)