fix: respect active region MountsAllowed for players (#2630)
A player can mount a horse or validate an ethereal mount inside a BaseRegion that overrides MountsAllowed to false because CheckMountAllowed never consults that property. This adds the missing check in the shared player permission path, using existing localized message 1042317.
This commit is contained in:
parent
c9831b9680
commit
51d2e998fc
2 changed files with 103 additions and 0 deletions
|
|
@ -3,6 +3,7 @@ using System;
|
|||
using Server.Items;
|
||||
using Server.Misc;
|
||||
using Server.Multis;
|
||||
using Server.Regions;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Mobiles;
|
||||
|
|
@ -286,6 +287,12 @@ public abstract partial class BaseMount : BaseCreature, IMount
|
|||
|
||||
if (mob is PlayerMobile mobile)
|
||||
{
|
||||
if (mobile.Region is BaseRegion { MountsAllowed: false })
|
||||
{
|
||||
mobile.SendLocalizedMessage(1042317); // You may not ride at this time
|
||||
result = false;
|
||||
}
|
||||
|
||||
if (mobile.MountBlockReason != BlockMountType.None)
|
||||
{
|
||||
mobile.SendLocalizedMessage((int)mobile.MountBlockReason);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue