Skip to content

Commit ce265f6

Browse files
committed
Fix GMs / Admins being affected by stealth speed penalty in some cases
Follows f6c7b5f incomplete changes.
1 parent bfbccf0 commit ce265f6

File tree

2 files changed

+11
-16
lines changed

2 files changed

+11
-16
lines changed

GameServer/ECS-Effects/StealthECSEffect.cs

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,13 @@ public override void OnStartEffect()
4242

4343
OwnerPlayer.Sprint(false);
4444

45-
if (OwnerPlayer.Client.Account.PrivLevel == 1 || OwnerPlayer.Client.Account.PrivLevel == 0)
45+
foreach (GamePlayer player in OwnerPlayer.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
4646
{
47-
//GameEventMgr.AddHandler(this, GameLivingEvent.AttackedByEnemy, new DOLEventHandler(Unstealth));
48-
foreach (GamePlayer player in OwnerPlayer.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
49-
{
50-
if (player == null || player == OwnerPlayer) continue;
51-
if (!player.CanDetect(OwnerPlayer))
52-
player.Out.SendObjectDelete(OwnerPlayer);
53-
}
54-
OwnerPlayer.Out.SendUpdateMaxSpeed();
47+
if (player == OwnerPlayer)
48+
continue;
49+
50+
if (!player.CanDetect(OwnerPlayer))
51+
player.Out.SendObjectDelete(OwnerPlayer);
5552
}
5653

5754
StealthStateChanged();
@@ -106,10 +103,7 @@ public override void OnStopEffect()
106103
private void StealthStateChanged()
107104
{
108105
OwnerPlayer.Notify(GamePlayerEvent.StealthStateChanged, OwnerPlayer, null);
109-
if (OwnerPlayer.Client.Account.PrivLevel == 1 || OwnerPlayer.Client.Account.PrivLevel == 0)
110-
{
111-
OwnerPlayer.Out.SendUpdateMaxSpeed();
112-
}
106+
OwnerPlayer.OnMaxSpeedChange();
113107
}
114108
}
115-
}
109+
}

GameServer/propertycalc/MaxSpeedCalculator.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public override int CalcValue(GameLiving living, eProperty property)
5353
speed *= 1.25; // New run speed is 125% when no buff.
5454
}
5555

56-
if (player.IsOverencumbered && player.Client.Account.PrivLevel < 2 && ServerProperties.Properties.ENABLE_ENCUMBERANCE_SPEED_LOSS)
56+
if (player.IsOverencumbered && player.Client.Account.PrivLevel == 1 && ServerProperties.Properties.ENABLE_ENCUMBERANCE_SPEED_LOSS)
5757
{
5858
double Enc = player.Encumberance; // Calculating player.Encumberance is a bit slow with all those locks, don't call it much.
5959

@@ -67,7 +67,8 @@ public override int CalcValue(GameLiving living, eProperty property)
6767
else
6868
player.IsOverencumbered = false;
6969
}
70-
if (player.IsStealthed)
70+
71+
if (player.IsStealthed && player.Client.Account.PrivLevel == 1)
7172
{
7273
AtlasOF_MasteryOfStealth mos = player.GetAbility<AtlasOF_MasteryOfStealth>();
7374
//GameSpellEffect bloodrage = SpellHandler.FindEffectOnTarget(player, "BloodRage");

0 commit comments

Comments
 (0)