mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 10:37:03 +00:00
[11843] More improvements to LoadCreatureAddon, Thanks to Shauren and Vladimir for pointing
This commit is contained in:
parent
62c4f5e6bf
commit
2166621df0
4 changed files with 9 additions and 9 deletions
|
|
@ -784,7 +784,7 @@ bool Creature::Create(uint32 guidlow, CreatureCreatePos& cPos, CreatureInfo cons
|
|||
cPos.GetMap()->GetCreatureLinkingHolder()->AddMasterToHolder(this);
|
||||
}
|
||||
|
||||
LoadCreatureAddon(false, cPos.GetMap());
|
||||
LoadCreatureAddon(false);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -1911,7 +1911,7 @@ CreatureDataAddon const* Creature::GetCreatureAddon() const
|
|||
}
|
||||
|
||||
//creature_addon table
|
||||
bool Creature::LoadCreatureAddon(bool reload /*= false*/, Map* map /*= NULL*/)
|
||||
bool Creature::LoadCreatureAddon(bool reload)
|
||||
{
|
||||
CreatureDataAddon const *cainfo = GetCreatureAddon();
|
||||
if(!cainfo)
|
||||
|
|
@ -1957,7 +1957,7 @@ bool Creature::LoadCreatureAddon(bool reload /*= false*/, Map* map /*= NULL*/)
|
|||
{
|
||||
for (uint32 const* cAura = cainfo->auras; *cAura; ++cAura)
|
||||
{
|
||||
if (HasAura(*cAura))
|
||||
if (HasAuraOfDifficulty(*cAura))
|
||||
{
|
||||
if (!reload)
|
||||
sLog.outErrorDb("Creature (GUIDLow: %u Entry: %u) has spell %u in `auras` field, but aura is already applied.", GetGUIDLow(), GetEntry(), *cAura);
|
||||
|
|
@ -1967,9 +1967,9 @@ bool Creature::LoadCreatureAddon(bool reload /*= false*/, Map* map /*= NULL*/)
|
|||
|
||||
SpellEntry const* spellInfo = sSpellStore.LookupEntry(*cAura); // Already checked on load
|
||||
|
||||
// Get Difficulty mode for initial case (npc not yet added to map)
|
||||
if (spellInfo->SpellDifficultyId && !reload && map && map->IsDungeon())
|
||||
if (SpellEntry const* spellEntry = GetSpellEntryByDifficulty(spellInfo->SpellDifficultyId, map->GetDifficulty(), map->IsRaid()))
|
||||
// Get Difficulty mode for initial case (npc not yet added to world)
|
||||
if (spellInfo->SpellDifficultyId && !reload && GetMap()->IsDungeon())
|
||||
if (SpellEntry const* spellEntry = GetSpellEntryByDifficulty(spellInfo->SpellDifficultyId, GetMap()->GetDifficulty(), GetMap()->IsRaid()))
|
||||
spellInfo = spellEntry;
|
||||
|
||||
CastSpell(this, spellInfo, true);
|
||||
|
|
|
|||
|
|
@ -462,7 +462,7 @@ class MANGOS_DLL_SPEC Creature : public Unit
|
|||
void RemoveFromWorld();
|
||||
|
||||
bool Create(uint32 guidlow, CreatureCreatePos& cPos, CreatureInfo const* cinfo, Team team = TEAM_NONE, const CreatureData *data = NULL, GameEventCreatureData const* eventData = NULL);
|
||||
bool LoadCreatureAddon(bool reload = false, Map* map = NULL);
|
||||
bool LoadCreatureAddon(bool reload);
|
||||
void SelectLevel(const CreatureInfo *cinfo, float percentHealth = 100.0f, float percentMana = 100.0f);
|
||||
void LoadEquipment(uint32 equip_entry, bool force=false);
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ bool Totem::Create(uint32 guidlow, CreatureCreatePos& cPos, CreatureInfo const*
|
|||
if (InstanceData* iData = GetMap()->GetInstanceData())
|
||||
iData->OnCreatureCreate(this);
|
||||
|
||||
LoadCreatureAddon(false, cPos.GetMap());
|
||||
LoadCreatureAddon(false);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "11842"
|
||||
#define REVISION_NR "11843"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue