Merge commit '26c583c24ab7dbbf1fecf3dcd737c1ad543c8b33' into Playerbot_1017

This commit is contained in:
Yunfan Li
2023-10-17 22:18:39 +08:00
57 changed files with 1461 additions and 879 deletions

View File

@@ -11272,12 +11272,12 @@ void Unit::SendEnergizeSpellLog(Unit* victim, uint32 spellID, uint32 damage, Pow
void Unit::EnergizeBySpell(Unit* victim, uint32 spellID, uint32 damage, Powers powerType)
{
victim->ModifyPower(powerType, damage, false);
int32 gainedPower = victim->ModifyPower(powerType, damage, false);
if (powerType != POWER_HAPPINESS)
if (powerType != POWER_HAPPINESS && gainedPower)
{
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellID);
victim->getHostileRefMgr().threatAssist(this, float(damage) * 0.5f, spellInfo);
victim->getHostileRefMgr().threatAssist(this, float(gainedPower) * 0.5f, spellInfo);
}
SendEnergizeSpellLog(victim, spellID, damage, powerType);
@@ -20255,7 +20255,7 @@ bool Unit::CanSwim() const
// Mirror client behavior, if this method returns false then client will not use swimming animation and for players will apply gravity as if there was no water
if (HasUnitFlag(UNIT_FLAG_CANNOT_SWIM))
return false;
if (HasUnitFlag(UNIT_FLAG_POSSESSED)) // is player
if (HasUnitFlag(UNIT_FLAG_POSSESSED) || HasUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED)) // is player
return true;
if (HasUnitFlag2(UNIT_FLAG2_UNUSED_6))
return false;