fix: Fixes travel issues (#1285)
This commit is contained in:
parent
6d34cf8824
commit
0facd73842
3 changed files with 19 additions and 15 deletions
|
|
@ -758,33 +758,33 @@ public class Region : IComparable<Region>
|
||||||
Parent?.OnSpeech(args);
|
Parent?.OnSpeech(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual bool OnSkillUse(Mobile m, int skill) => Parent?.OnSkillUse(m, skill) != false;
|
public virtual bool OnSkillUse(Mobile m, int skill) => Parent?.OnSkillUse(m, skill) ?? true;
|
||||||
|
|
||||||
public virtual bool OnBeginSpellCast(Mobile m, ISpell s) => Parent?.OnBeginSpellCast(m, s) != false;
|
public virtual bool OnBeginSpellCast(Mobile m, ISpell s) => Parent?.OnBeginSpellCast(m, s) ?? true;
|
||||||
|
|
||||||
public virtual void OnSpellCast(Mobile m, ISpell s)
|
public virtual void OnSpellCast(Mobile m, ISpell s)
|
||||||
{
|
{
|
||||||
Parent?.OnSpellCast(m, s);
|
Parent?.OnSpellCast(m, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual bool OnResurrect(Mobile m) => Parent?.OnResurrect(m) != false;
|
public virtual bool OnResurrect(Mobile m) => Parent?.OnResurrect(m) ?? true;
|
||||||
|
|
||||||
public virtual bool OnBeforeDeath(Mobile m) => Parent?.OnBeforeDeath(m) != false;
|
public virtual bool OnBeforeDeath(Mobile m) => Parent?.OnBeforeDeath(m) ?? true;
|
||||||
|
|
||||||
public virtual void OnDeath(Mobile m)
|
public virtual void OnDeath(Mobile m)
|
||||||
{
|
{
|
||||||
Parent?.OnDeath(m);
|
Parent?.OnDeath(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual bool OnDamage(Mobile m, ref int damage) => Parent?.OnDamage(m, ref damage) != false;
|
public virtual bool OnDamage(Mobile m, ref int damage) => Parent?.OnDamage(m, ref damage) ?? true;
|
||||||
|
|
||||||
public virtual bool OnHeal(Mobile m, ref int heal) => Parent?.OnHeal(m, ref heal) != false;
|
public virtual bool OnHeal(Mobile m, ref int heal) => Parent?.OnHeal(m, ref heal) ?? true;
|
||||||
|
|
||||||
public virtual bool OnDoubleClick(Mobile m, object o) => Parent?.OnDoubleClick(m, o) != false;
|
public virtual bool OnDoubleClick(Mobile m, object o) => Parent?.OnDoubleClick(m, o) ?? true;
|
||||||
|
|
||||||
public virtual bool OnSingleClick(Mobile m, object o) => Parent?.OnSingleClick(m, o) != false;
|
public virtual bool OnSingleClick(Mobile m, object o) => Parent?.OnSingleClick(m, o) ?? true;
|
||||||
|
|
||||||
public virtual bool AllowSpawn() => Parent?.AllowSpawn() != false;
|
public virtual bool AllowSpawn() => Parent?.AllowSpawn() ?? true;
|
||||||
|
|
||||||
public virtual void AlterLightLevel(Mobile m, ref int global, ref int personal)
|
public virtual void AlterLightLevel(Mobile m, ref int global, ref int personal)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -660,7 +660,6 @@ namespace Server.Spells
|
||||||
m_TravelType = type;
|
m_TravelType = type;
|
||||||
|
|
||||||
var v = (int)type;
|
var v = (int)type;
|
||||||
var isValid = true;
|
|
||||||
|
|
||||||
if (caster != null)
|
if (caster != null)
|
||||||
{
|
{
|
||||||
|
|
@ -669,16 +668,21 @@ namespace Server.Spells
|
||||||
|
|
||||||
if (destination?.CheckTravel(caster, loc, type, out message) == false || current?.CheckTravel(caster, loc, type, out message) == false)
|
if (destination?.CheckTravel(caster, loc, type, out message) == false || current?.CheckTravel(caster, loc, type, out message) == false)
|
||||||
{
|
{
|
||||||
isValid = false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var i = 0; isValid && i < m_Validators.Length; ++i)
|
for (var i = 0; i < m_Validators.Length; ++i)
|
||||||
{
|
{
|
||||||
isValid = m_Rules[v, i] || !m_Validators[i](map, loc);
|
var isValid = m_Rules[v, i] || !m_Validators[i](map, loc);
|
||||||
|
if (!isValid)
|
||||||
|
{
|
||||||
|
message = InvalidTravelMessage(type);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return !isValid;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool IsWindLoc(Point3D loc)
|
public static bool IsWindLoc(Point3D loc)
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,7 @@ namespace Server.Spells.Ninjitsu
|
||||||
|
|
||||||
m.PlaySound(0x512);
|
m.PlaySound(0x512);
|
||||||
|
|
||||||
Stealth.OnUse(m); // stealth check after the a jump
|
Stealth.OnUse(m); // stealth check after the shadow jump
|
||||||
}
|
}
|
||||||
|
|
||||||
FinishSequence();
|
FinishSequence();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue