AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
AbominationDespawner Class Reference

Public Member Functions

 AbominationDespawner (Unit *owner)
 
bool operator() (ObjectGuid guid)
 

Private Attributes

Unit_owner
 

Detailed Description

Constructor & Destructor Documentation

◆ AbominationDespawner()

AbominationDespawner::AbominationDespawner ( Unit owner)
inlineexplicit
155: _owner(owner) { }
Unit * _owner
Definition: boss_professor_putricide.cpp:179

Member Function Documentation

◆ operator()()

bool AbominationDespawner::operator() ( ObjectGuid  guid)
inline
158 {
159 if (Unit* summon = ObjectAccessor::GetUnit(*_owner, guid))
160 {
161 if (summon->GetEntry() == NPC_MUTATED_ABOMINATION_10 || summon->GetEntry() == NPC_MUTATED_ABOMINATION_25)
162 {
163 if (Vehicle* veh = summon->GetVehicleKit())
164 veh->RemoveAllPassengers(); // also despawns the vehicle
165
166 // Found unit is Mutated Abomination, remove it
167 return true;
168 }
169
170 // Found unit is not Mutated Abomintaion, leave it
171 return false;
172 }
173
174 // No unit found, remove from SummonList
175 return true;
176 }
@ NPC_MUTATED_ABOMINATION_25
Definition: icecrown_citadel.h:271
@ NPC_MUTATED_ABOMINATION_10
Definition: icecrown_citadel.h:270
Unit * GetUnit(WorldObject const &, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:199
Definition: Unit.h:630
Definition: Vehicle.h:28

References _owner, ObjectAccessor::GetUnit(), NPC_MUTATED_ABOMINATION_10, and NPC_MUTATED_ABOMINATION_25.

Member Data Documentation

◆ _owner

Unit* AbominationDespawner::_owner
private

Referenced by operator()().