aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Entities
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Entities')
-rw-r--r--src/server/game/Entities/Player/Player.cpp2
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp22
2 files changed, 12 insertions, 12 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index dec48712e03..14dc5b5c0d6 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -23592,7 +23592,7 @@ bool Player::isHonorOrXPTarget(Unit* victim) const
if (victim->GetTypeId() == TYPEID_UNIT)
{
- if (victim->ToCreature()->IsTotem() ||
+ if (victim->IsTotem() ||
victim->IsPet() ||
victim->ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_XP_AT_KILL)
return false;
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index bec32e4c421..c29b14d9c13 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -2705,7 +2705,7 @@ float Unit::GetUnitDodgeChance() const
return GetFloatValue(PLAYER_DODGE_PERCENTAGE);
else
{
- if (ToCreature()->IsTotem())
+ if (IsTotem())
return 0.0f;
else
{
@@ -2780,7 +2780,7 @@ float Unit::GetUnitBlockChance() const
}
else
{
- if (ToCreature()->IsTotem())
+ if (IsTotem())
return 0.0f;
else
{
@@ -3485,7 +3485,7 @@ void Unit::_UnapplyAura(AuraApplicationMap::iterator &i, AuraRemoveMode removeMo
ASSERT(!aurApp->GetEffectMask());
// Remove totem at next update if totem loses its aura
- if (aurApp->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE && GetTypeId() == TYPEID_UNIT && ToCreature()->IsTotem())
+ if (aurApp->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE && GetTypeId() == TYPEID_UNIT && IsTotem())
{
if (ToTotem()->GetSpell() == aura->GetId() && ToTotem()->GetTotemType() == TOTEM_PASSIVE)
ToTotem()->setDeathState(JUST_DIED);
@@ -9473,7 +9473,7 @@ void Unit::GetAllMinionsByEntry(std::list<Creature*>& Minions, uint32 entry)
Unit* unit = *itr;
++itr;
if (unit->GetEntry() == entry && unit->GetTypeId() == TYPEID_UNIT
- && unit->ToCreature()->IsSummon()) // minion, actually
+ && unit->IsSummon()) // minion, actually
Minions.push_back(unit->ToCreature());
}
}
@@ -9485,7 +9485,7 @@ void Unit::RemoveAllMinionsByEntry(uint32 entry)
Unit* unit = *itr;
++itr;
if (unit->GetEntry() == entry && unit->GetTypeId() == TYPEID_UNIT
- && unit->ToCreature()->IsSummon()) // minion, actually
+ && unit->IsSummon()) // minion, actually
unit->ToTempSummon()->UnSummon();
// i think this is safe because i have never heard that a despawned minion will trigger a same minion
}
@@ -9585,7 +9585,7 @@ int32 Unit::DealHeal(Unit* victim, uint32 addhealth)
Unit* unit = this;
- if (GetTypeId() == TYPEID_UNIT && ToCreature()->IsTotem())
+ if (GetTypeId() == TYPEID_UNIT && IsTotem())
unit = GetOwner();
if (Player* player = unit->ToPlayer())
@@ -9876,7 +9876,7 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin
return pdamage;
// For totems get damage bonus from owner
- if (GetTypeId() == TYPEID_UNIT && ToCreature()->IsTotem())
+ if (GetTypeId() == TYPEID_UNIT && IsTotem())
if (Unit* owner = GetOwner())
return owner->SpellDamageBonusDone(victim, spellProto, pdamage, damagetype);
@@ -10007,7 +10007,7 @@ float Unit::SpellDamagePctDone(Unit* victim, SpellInfo const* spellProto, Damage
return 1.0f;
// For totems pct done mods are calculated when its calculation is run on the player in SpellDamageBonusDone.
- if (GetTypeId() == TYPEID_UNIT && ToCreature()->IsTotem())
+ if (GetTypeId() == TYPEID_UNIT && IsTotem())
return 1.0f;
// Done total percent damage auras
@@ -12570,7 +12570,7 @@ bool Unit::CanHaveThreatList(bool skipAliveCheck) const
return false;
// totems can not have threat list
- if (ToCreature()->IsTotem())
+ if (IsTotem())
return false;
// vehicles can not have threat list
@@ -14518,7 +14518,7 @@ Player* Unit::GetSpellModOwner() const
if (Player* player = const_cast<Unit*>(this)->ToPlayer())
return player;
- if (IsPet() || ToCreature()->IsTotem())
+ if (IsPet() || IsTotem())
{
if (Unit* owner = GetOwner())
if (Player* player = owner->ToPlayer())
@@ -16057,7 +16057,7 @@ void Unit::RemoveCharmedBy(Unit* charmer)
// a guardian should always have charminfo
if (playerCharmer && this != charmer->GetFirstControlled())
playerCharmer->SendRemoveControlBar();
- else if (GetTypeId() == TYPEID_PLAYER || (GetTypeId() == TYPEID_UNIT && !ToCreature()->IsGuardian()))
+ else if (GetTypeId() == TYPEID_PLAYER || (GetTypeId() == TYPEID_UNIT && !IsGuardian()))
DeleteCharmInfo();
}