fix: Simplifies fastwalk detection (#907)
* Uses a circular buffer for steps. * Limits to 3 steps instead of 4. * Gives a 5% buffer on the first step.
This commit is contained in:
parent
5b7b99e0de
commit
e873d2ed7e
4 changed files with 186 additions and 78 deletions
|
|
@ -9029,7 +9029,10 @@ namespace Server
|
|||
public Direction GetDirectionTo(IPoint2D p, bool run = false) =>
|
||||
p == null ? Direction.North | (run ? Direction.Running : 0) : GetDirectionTo(p.X, p.Y, run);
|
||||
|
||||
public void PublicOverheadMessage(MessageType type, int hue, bool ascii, string text, bool noLineOfSight = true)
|
||||
public void PublicOverheadMessage(
|
||||
MessageType type, int hue, bool ascii, string text, bool noLineOfSight = true,
|
||||
AccessLevel accessLevel = AccessLevel.Player
|
||||
)
|
||||
{
|
||||
if (m_Map == null)
|
||||
{
|
||||
|
|
@ -9042,7 +9045,11 @@ namespace Server
|
|||
|
||||
foreach (var state in eable)
|
||||
{
|
||||
if (state.Mobile.CanSee(this) && (noLineOfSight || state.Mobile.InLOS(this)))
|
||||
if (
|
||||
state.Mobile.AccessLevel >= accessLevel &&
|
||||
state.Mobile.CanSee(this) &&
|
||||
(noLineOfSight || state.Mobile.InLOS(this))
|
||||
)
|
||||
{
|
||||
var length = OutgoingMessagePackets.CreateMessage(
|
||||
buffer, Serial, Body, type, hue, 3, ascii, Language, Name, text
|
||||
|
|
@ -9093,7 +9100,8 @@ namespace Server
|
|||
|
||||
public void PublicOverheadMessage(
|
||||
MessageType type, int hue, int number, AffixType affixType, string affix,
|
||||
string args = "", bool noLineOfSight = false
|
||||
string args = "", bool noLineOfSight = false,
|
||||
AccessLevel accessLevel = AccessLevel.Player
|
||||
)
|
||||
{
|
||||
if (m_Map == null)
|
||||
|
|
@ -9107,7 +9115,11 @@ namespace Server
|
|||
|
||||
foreach (var state in eable)
|
||||
{
|
||||
if (state.Mobile.CanSee(this) && (noLineOfSight || state.Mobile.InLOS(this)))
|
||||
if (
|
||||
state.Mobile.AccessLevel >= accessLevel &&
|
||||
state.Mobile.CanSee(this) &&
|
||||
(noLineOfSight || state.Mobile.InLOS(this))
|
||||
)
|
||||
{
|
||||
var length = OutgoingMessagePackets.CreateMessageLocalizedAffix(
|
||||
buffer, Serial, Body, type, hue, 3, number, Name, affixType, affix, args
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue