mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-18 11:25:42 +00:00
refactor(Core): Make more use of helpers. (#19835)
* Init. * Reword. * Update codestyle script. Co-Authored-By: Kitzunu <24550914+Kitzunu@users.noreply.github.com> * Add gameobject type ID check, reorder checks. * Add helper/codestyle check for unit type. * `IsUnit()` -> `IsCreature()` * Add `IsUnit()` method. * Use type mask. https: //github.com/TrinityCore/TrinityCore/commit/cc71da35b5dc74abf71f8691161525a23d870bb5 Co-Authored-By: Giacomo Pozzoni <giacomopoz@gmail.com> Co-Authored-By: Ovahlord <18347559+Ovahlord@users.noreply.github.com> * Replace instances of `isType` with `IsUnit`. --------- Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com> Co-authored-by: Giacomo Pozzoni <giacomopoz@gmail.com> Co-authored-by: Ovahlord <18347559+Ovahlord@users.noreply.github.com>
This commit is contained in:
@@ -939,7 +939,7 @@ void Player::UpdateWeaponSkill(Unit* victim, WeaponAttackType attType, Item* ite
|
||||
if (GetShapeshiftForm() == FORM_TREE)
|
||||
return; // use weapon but not skill up
|
||||
|
||||
if (victim->GetTypeId() == TYPEID_UNIT &&
|
||||
if (victim->IsCreature() &&
|
||||
(victim->ToCreature()->GetCreatureTemplate()->flags_extra &
|
||||
CREATURE_FLAG_EXTRA_NO_SKILL_GAINS))
|
||||
return;
|
||||
@@ -1670,7 +1670,7 @@ void Player::UpdateVisibilityOf(WorldObject* target)
|
||||
{
|
||||
if (!CanSeeOrDetect(target, false, true))
|
||||
{
|
||||
if (target->GetTypeId() == TYPEID_UNIT)
|
||||
if (target->IsCreature())
|
||||
BeforeVisibilityDestroy<Creature>(target->ToCreature(), this);
|
||||
|
||||
target->DestroyForPlayer(this);
|
||||
@@ -1687,7 +1687,7 @@ void Player::UpdateVisibilityOf(WorldObject* target)
|
||||
// target aura duration for caster show only if target exist at
|
||||
// caster client send data at target visibility change (adding to
|
||||
// client)
|
||||
if (target->isType(TYPEMASK_UNIT))
|
||||
if (target->IsUnit())
|
||||
GetInitialVisiblePackets((Unit*) target);
|
||||
}
|
||||
}
|
||||
@@ -1913,7 +1913,7 @@ void Player::UpdateCharmedAI()
|
||||
|
||||
// Xinef: we should be killed if caster enters evade mode and charm is
|
||||
// infinite
|
||||
if (charmer->GetTypeId() == TYPEID_UNIT &&
|
||||
if (charmer->IsCreature() &&
|
||||
charmer->ToCreature()->IsInEvadeMode())
|
||||
{
|
||||
AuraEffectList const& auras =
|
||||
|
||||
Reference in New Issue
Block a user