[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;
// 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