fix: Fixes various issues (#748)
https://github.com/modernuo/ModernUO/pull/741/files
This commit is contained in:
parent
28faf4346f
commit
c789a7f78a
5 changed files with 19 additions and 17 deletions
|
|
@ -23,7 +23,7 @@ namespace Server.Items
|
|||
return false;
|
||||
}
|
||||
|
||||
if (from.Mounted && !(from.Weapon is Lance))
|
||||
if (from.Mounted && from.Weapon is not Lance)
|
||||
{
|
||||
from.SendLocalizedMessage(1061283); // You cannot perform that attack while mounted!
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ namespace Server.Items
|
|||
|
||||
public virtual bool CheckWeaponSkill(Mobile from)
|
||||
{
|
||||
if (!(from.Weapon is BaseWeapon weapon))
|
||||
if (from.Weapon is not BaseWeapon weapon)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
@ -319,7 +319,7 @@ namespace Server.Items
|
|||
return false;
|
||||
}
|
||||
|
||||
return CheckSkills(from) && CheckMana(from, false);
|
||||
return CheckSkills(from);
|
||||
}
|
||||
|
||||
public static bool IsWeaponAbility(Mobile m, WeaponAbility a) =>
|
||||
|
|
@ -342,7 +342,7 @@ namespace Server.Items
|
|||
return null;
|
||||
}
|
||||
|
||||
if (a?.ValidatesDuringHit == true && !a.Validate(m))
|
||||
if (a?.ValidatesDuringHit == true && (!a.Validate(m) || !a.CheckMana(m, false)))
|
||||
{
|
||||
ClearCurrentAbility(m);
|
||||
return null;
|
||||
|
|
@ -365,7 +365,7 @@ namespace Server.Items
|
|||
return false;
|
||||
}
|
||||
|
||||
if (a?.Validate(m) == false)
|
||||
if (a?.Validate(m) == false || a?.CheckMana(m, false) == false)
|
||||
{
|
||||
ClearCurrentAbility(m);
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue