Core/Player: Clean up duel related code. Fix a check for abusive client behavior, code style.

Port From (https://github.com/TrinityCore/TrinityCore/commit/7c062db94b1c2d28329c5f0ddc2fee74a6c07c35)
This commit is contained in:
hondacrx
2021-11-15 19:56:36 -05:00
parent 30af4577f8
commit c48696da32
11 changed files with 103 additions and 101 deletions
+4 -1
View File
@@ -4047,10 +4047,13 @@ namespace Game.Entities
if (base.IsAlwaysDetectableFor(seer))
return true;
if (duel != null && duel.State != DuelState.Challenged && duel.Opponent == seer)
return false;
Player seerPlayer = seer.ToPlayer();
if (seerPlayer != null)
if (IsGroupVisibleFor(seerPlayer))
return !(seerPlayer.duel != null && seerPlayer.duel.startTime != 0 && seerPlayer.duel.opponent == this);
return true;
return false;
}