TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
SpellClickInfo Struct Reference

#include <ObjectMgr.h>

Public Member Functions

bool IsFitToRequirements (Unit const *clicker, Unit const *clickee) const
 

Public Attributes

uint32 spellId
 
uint8 castFlags
 
SpellClickUserTypes userType
 

Member Function Documentation

bool SpellClickInfo::IsFitToRequirements ( Unit const clicker,
Unit const clickee 
) const
204 {
205  Player const* playerClicker = clicker->ToPlayer();
206  if (!playerClicker)
207  return true;
208 
209  Unit const* summoner = NULL;
210  // Check summoners for party
211  if (clickee->IsSummon())
212  summoner = clickee->ToTempSummon()->GetSummoner();
213  if (!summoner)
214  summoner = clickee;
215 
216  // This only applies to players
217  switch (userType)
218  {
220  if (!playerClicker->IsFriendlyTo(summoner))
221  return false;
222  break;
224  if (!playerClicker->IsInRaidWith(summoner))
225  return false;
226  break;
228  if (!playerClicker->IsInPartyWith(summoner))
229  return false;
230  break;
231  default:
232  break;
233  }
234 
235  return true;
236 }
SpellClickUserTypes userType
Definition: ObjectMgr.h:391
arena_t NULL
Definition: jemalloc_internal.h:624
Unit * GetSummoner() const
Definition: TemporarySummon.cpp:37
Definition: SharedDefines.h:864
TempSummon * ToTempSummon()
Definition: Unit.h:2206
Definition: SharedDefines.h:862
Definition: SharedDefines.h:863
Definition: Unit.h:1305

+ Here is the call graph for this function:

Member Data Documentation

uint8 SpellClickInfo::castFlags
uint32 SpellClickInfo::spellId
SpellClickUserTypes SpellClickInfo::userType

The documentation for this struct was generated from the following files: