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 (a513922fc1)

* 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>
This commit is contained in:
Kitzunu
2022-01-20 10:50:18 +01:00
committed by GitHub
parent 144c797dba
commit dd15fa706d
2 changed files with 35 additions and 0 deletions

View File

@@ -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)