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
+2 -2
View File
@@ -699,7 +699,7 @@ namespace Game.Entities
Player myPlayerOwner = GetCharmerOrOwnerPlayerOrPlayerItself();
Player targetPlayerOwner = target.GetCharmerOrOwnerPlayerOrPlayerItself();
if (myPlayerOwner && targetPlayerOwner && !(myPlayerOwner.duel != null && myPlayerOwner.duel.opponent == targetPlayerOwner))
if (myPlayerOwner && targetPlayerOwner && !(myPlayerOwner.duel != null && myPlayerOwner.duel.Opponent == targetPlayerOwner))
{
myPlayerOwner.UpdatePvP(true);
myPlayerOwner.SetContestedPvP(targetPlayerOwner);
@@ -879,7 +879,7 @@ namespace Game.Entities
// last damage from non duel opponent or opponent controlled creature
if (plrVictim.duel != null)
{
plrVictim.duel.opponent.CombatStopWithPets(true);
plrVictim.duel.Opponent.CombatStopWithPets(true);
plrVictim.CombatStopWithPets(true);
plrVictim.DuelComplete(DuelCompleteType.Interrupted);
}