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
|
|
@ -39,11 +39,13 @@ namespace Server.Spells.Seventh
|
|||
{
|
||||
Caster.SendLocalizedMessage(1005570); // You can not gate to another facet.
|
||||
}
|
||||
else if (!SpellHelper.CheckTravel(Caster, TravelCheckType.GateFrom))
|
||||
else if (!SpellHelper.CheckTravel(Caster, TravelCheckType.GateFrom, out var failureMessage))
|
||||
{
|
||||
failureMessage.SendMessageTo(Caster);
|
||||
}
|
||||
else if (!SpellHelper.CheckTravel(Caster, map, loc, TravelCheckType.GateTo))
|
||||
else if (!SpellHelper.CheckTravel(Caster, map, loc, TravelCheckType.GateTo, out failureMessage))
|
||||
{
|
||||
failureMessage.SendMessageTo(Caster);
|
||||
}
|
||||
else if (map == Map.Felucca && Caster is PlayerMobile mobile && mobile.Young)
|
||||
{
|
||||
|
|
@ -124,7 +126,13 @@ namespace Server.Spells.Seventh
|
|||
return false;
|
||||
}
|
||||
|
||||
return SpellHelper.CheckTravel(Caster, TravelCheckType.GateFrom);
|
||||
if (!SpellHelper.CheckTravel(Caster, TravelCheckType.GateFrom, out var failureMessage))
|
||||
{
|
||||
failureMessage.SendMessageTo(Caster);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private static bool GateExistsAt(Map map, Point3D loc)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue