Core/Misc: more fixups

This commit is contained in:
Ovahlord committed 2020-07-22 18:10:50 +02:00
1 parent e54f8ca4f7
commit 47ef91c23d
2 files changed
+4 -8

No files matched your search

@@ -798,11 +798,7 @@ void Creature::RegenerateHealth()
if (!isRegeneratingHealth())
return;
bool isInCombat = IsInCombat() && (!GetVictim() || // if IsInCombat() is true and this has no victim
!EnsureVictim()->GetCharmerOrOwnerPlayerOrPlayerItself() || // or the victim/owner/charmer is not a player
!EnsureVictim()->GetCharmerOrOwnerPlayerOrPlayerItself()->IsGameMaster()); // or the victim/owner/charmer is not a GameMaster
if (IsInEvadeMode() || (isInCombat && !IsPolymorphed() && !CanNotReachTarget())) // regenerate health if not in combat or if polymorphed
if (IsInEvadeMode() || (IsEngaged() && !IsPolymorphed() && !CanNotReachTarget())) // regenerate health if not in combat or if polymorphed
return;
uint32 curValue = GetHealth();
@@ -3213,7 +3209,7 @@ void Creature::AtEngage(Unit* target)
Dismount();
MovementGeneratorType const movetype = GetMotionMaster()->GetCurrentMovementGeneratorType();
if (movetype == WAYPOINT_MOTION_TYPE || movetype == POINT_MOTION_TYPE || (IsAIEnabled() && AI()->IsEscorted()))
if (movetype == WAYPOINT_MOTION_TYPE || movetype == POINT_MOTION_TYPE || (IsAIEnabled && AI()->IsEscorted()))
SetHomePosition(GetPosition());
if (CreatureAI* ai = AI())
+2 -2
View File
@@ -2178,7 +2178,7 @@ void Unit::FakeAttackerStateUpdate(Unit* victim, WeaponAttackType attType /*= BA
if ((attType == BASE_ATTACK || attType == OFF_ATTACK) && !IsWithinLOSInMap(victim))
return;
AttackedTarget(victim, true);
AtTargetAttacked(victim, true);
RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_MELEE_ATTACK);
if (attType != BASE_ATTACK && attType != OFF_ATTACK)
@@ -9261,7 +9261,7 @@ void Unit::AtTargetAttacked(Unit* target, bool canInitialAggro)
Player* myPlayerOwner = GetCharmerOrOwnerPlayerOrPlayerItself();
Player* targetPlayerOwner = target->GetCharmerOrOwnerPlayerOrPlayerItself();
if (myPlayerOwner && targetPlayerOwner && !(myPlayerOwner->duel && myPlayerOwner->duel->Opponent == targetPlayerOwner))
if (myPlayerOwner && targetPlayerOwner && !(myPlayerOwner->duel && myPlayerOwner->duel->opponent == targetPlayerOwner))
{
myPlayerOwner->UpdatePvP(true);
myPlayerOwner->SetContestedPvP(targetPlayerOwner);