Skip to content

Commit

Permalink
Fix Instance Dungeons
Browse files Browse the repository at this point in the history
Previously /leave would leave the player stuck
which would make admin intervention necessary
  • Loading branch information
NetDwarf committed Aug 18, 2024
1 parent 5df6c2f commit beb1d26
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion GameServer/gameobjects/GameObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
6 changes: 5 additions & 1 deletion GameServer/gameobjects/GamePlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit beb1d26

Please sign in to comment.