Merge branch 'master' into Playerbot

# Conflicts:
#	src/server/game/Server/WorldSession.cpp
#	src/server/game/Server/WorldSession.h
This commit is contained in:
郑佩茹
2022-12-07 14:46:21 -07:00
196 changed files with 9181 additions and 1080 deletions

View File

@@ -1031,7 +1031,7 @@ uint32 Unit::DealDamage(Unit* attacker, Unit* victim, uint32 damage, CleanDamage
if (!attacker || attacker->IsControlledByPlayer() || attacker->IsCreatedByPlayer())
{
uint32 unDamage = health < damage ? health : damage;
bool damagedByPlayer = unDamage && attacker && attacker->m_movedByPlayer != nullptr;
bool damagedByPlayer = unDamage && attacker && (attacker->IsPlayer() || attacker->m_movedByPlayer != nullptr);
victim->ToCreature()->LowerPlayerDamageReq(unDamage, damagedByPlayer);
}
}
@@ -18215,6 +18215,11 @@ void Unit::SetControlled(bool apply, UnitState state)
void Unit::SetStunned(bool apply)
{
if (HasUnitState(UNIT_STATE_IN_FLIGHT))
{
return;
}
if (apply)
{
SetTarget();