[11376] Allow fallback to creature_template_addon of base entry

Use creature_template_addon from base entry when addon for difficulty_entry_N does not exist.
It is easier to create data for the exceptions rather than the general.

Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
Schmoozerd 2011-04-17 13:29:28 +02:00 committed by NoFantasy
parent c6dee6c2d6
commit 5895cb38e3
2 changed files with 10 additions and 2 deletions

View file

@ -1914,7 +1914,15 @@ CreatureDataAddon const* Creature::GetCreatureAddon() const
return addon; return addon;
// dependent from difficulty mode entry // dependent from difficulty mode entry
return ObjectMgr::GetCreatureTemplateAddon(GetCreatureInfo()->Entry); if (GetEntry() != GetCreatureInfo()->Entry)
{
// If CreatureTemplateAddon for difficulty_entry_N exist, it's there for a reason
if (CreatureDataAddon const* addon = ObjectMgr::GetCreatureTemplateAddon(GetCreatureInfo()->Entry))
return addon;
}
// Return CreatureTemplateAddon when nothing else exist
return ObjectMgr::GetCreatureTemplateAddon(GetEntry());
} }
//creature_addon table //creature_addon table

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "11375" #define REVISION_NR "11376"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__