fix: Fixes travel restriction messages (#1263)
- [X] `BaseRegion.CheckTravel` now properly cascades through parent regions - [X] `SpellHelper.CheckTravel` now returns a failure message instead of sending one internally. - [X] Consolidates travel restriction messages so they aren't duplicated.
This commit is contained in:
parent
2057fe74a2
commit
1d8e8ec0a8
13 changed files with 121 additions and 69 deletions
|
|
@ -166,5 +166,14 @@ public class BaseRegion : Region
|
|||
|
||||
public override string ToString() => Name ?? RuneName ?? GetType().Name;
|
||||
|
||||
public virtual bool CheckTravel(Mobile m, Point3D newLocation, TravelCheckType travelType) => true;
|
||||
public virtual bool CheckTravel(Mobile m, Point3D newLocation, TravelCheckType travelType, out TextDefinition message)
|
||||
{
|
||||
if (Parent is BaseRegion parent)
|
||||
{
|
||||
return parent.CheckTravel(m, newLocation, travelType, out message);
|
||||
}
|
||||
|
||||
message = null;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue