diff options
author | Kitzunu <24550914+Kitzunu@users.noreply.github.com> | 2022-01-20 10:50:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-20 06:50:18 -0300 |
commit | dd15fa706d6aa2f841b0a521fd9ebd03fdb0f97f (patch) | |
tree | ea21e7d5e3d4b051c0cf00a03472ff5399fa0d48 /src | |
parent | 144c797dba7dc4af9399151466d99aa711b67dc2 (diff) |
feat(Core/DB/Creature): Throw error if npcflag and gossip_menu_id is not c… (#9665)
* feat(DB/Creature): Throw error if npcflag and gossip_menu_id is not combined
*cherry-pick commit (https://github.com/TrinityCore/TrinityCore/commit/a513922fc1572137c4e8b7b75d7ba931b15cf26a)
* test
* Update ObjectMgr.cpp
* codestyle
* Update src/server/game/Globals/ObjectMgr.cpp
Co-authored-by: Francesco Borzì <borzifrancesco@gmail.com>
* Update src/server/game/Globals/ObjectMgr.cpp
Co-authored-by: Francesco Borzì <borzifrancesco@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Globals/ObjectMgr.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 2bb7f8569a..bf47cd174a 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -1160,6 +1160,21 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo) } const_cast<CreatureTemplate*>(cInfo)->DamageModifier *= Creature::_GetDamageMod(cInfo->rank); + + // Hack for modules + switch (cInfo->Entry) + { + case 190010: // Transmog Module + return; + } + if (cInfo->GossipMenuId && !(cInfo->npcflag & UNIT_NPC_FLAG_GOSSIP)) + { + LOG_ERROR("sql.sql", "Creature (Entry: %u) has assigned gossip menu %u, but npcflag does not include UNIT_NPC_FLAG_GOSSIP (1).", cInfo->Entry, cInfo->GossipMenuId); + } + else if (!cInfo->GossipMenuId && (cInfo->npcflag & UNIT_NPC_FLAG_GOSSIP)) + { + LOG_ERROR("sql.sql", "Creature (Entry: %u) has npcflag UNIT_NPC_FLAG_GOSSIP (1), but gossip menu is unassigned.", cInfo->Entry); + } } void ObjectMgr::CheckCreatureMovement(char const* table, uint64 id, CreatureMovementData& creatureMovement) |