mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-29 16:43:47 +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:
@@ -533,7 +533,7 @@ class DoorsGuidCheck
|
||||
public:
|
||||
bool operator()(WorldObject* object) const
|
||||
{
|
||||
if (object->GetTypeId() != TYPEID_UNIT)
|
||||
if (!object->IsCreature())
|
||||
return true;
|
||||
|
||||
Creature* cr = object->ToCreature();
|
||||
|
||||
@@ -1088,7 +1088,7 @@ class spell_kiljaeden_sinister_reflection_clone : public SpellScript
|
||||
WorldObject* target = targets.front();
|
||||
|
||||
targets.clear();
|
||||
if (target && target->GetTypeId() == TYPEID_UNIT)
|
||||
if (target && target->IsCreature())
|
||||
{
|
||||
target->ToCreature()->AI()->SetData(1, GetCaster()->getClass());
|
||||
targets.push_back(target);
|
||||
@@ -1133,7 +1133,7 @@ class spell_kiljaeden_darkness_aura : public AuraScript
|
||||
|
||||
void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (GetUnitOwner()->GetTypeId() == TYPEID_UNIT)
|
||||
if (GetUnitOwner()->IsCreature())
|
||||
GetUnitOwner()->ToCreature()->AI()->DoAction(ACTION_NO_KILL_TALK);
|
||||
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_DARKNESS_OF_A_THOUSAND_SOULS_DAMAGE, true);
|
||||
|
||||
@@ -393,7 +393,7 @@ class spell_entropius_negative_energy : public SpellScript
|
||||
|
||||
bool Load() override
|
||||
{
|
||||
return GetCaster()->GetTypeId() == TYPEID_UNIT;
|
||||
return GetCaster()->IsCreature();
|
||||
}
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
|
||||
Reference in New Issue
Block a user