mirror of
https://github.com/mangosfour/server.git
synced 2025-12-18 19:37:01 +00:00
[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:
parent
c6dee6c2d6
commit
5895cb38e3
2 changed files with 10 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue