From eef87a9cc06bea80b9867491e126c6500dc608a9 Mon Sep 17 00:00:00 2001 From: funjoker Date: Sun, 16 Jun 2019 21:32:01 +0200 Subject: [PATCH] Core/Creatures: Modify creature_template_model structure to accept unmodified sniffed data (#23427) --- sql/updates/world/master/2019_06_16_01_world.sql | 2 ++ src/server/game/Globals/ObjectMgr.cpp | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 sql/updates/world/master/2019_06_16_01_world.sql diff --git a/sql/updates/world/master/2019_06_16_01_world.sql b/sql/updates/world/master/2019_06_16_01_world.sql new file mode 100644 index 00000000000..74a9fcdbdad --- /dev/null +++ b/sql/updates/world/master/2019_06_16_01_world.sql @@ -0,0 +1,2 @@ +ALTER TABLE `creature_template_model` DROP PRIMARY KEY; +ALTER TABLE `creature_template_model` ADD PRIMARY KEY (`CreatureID`, `Idx`); diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index b8da6bd12dc..a3112f45956 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -947,8 +947,6 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo) if (!cInfo->Models.size()) TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) does not have any existing display id in creature_template_model.", cInfo->Entry); - else if (std::accumulate(cInfo->Models.begin(), cInfo->Models.end(), 0.0f, [](float sum, CreatureModel const& model) { return sum + model.Probability; }) <= 0.0f) - TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) has zero total chance for all models in creature_template_model.", cInfo->Entry); if (!cInfo->unit_class || ((1 << (cInfo->unit_class-1)) & CLASSMASK_ALL_CREATURES) == 0) {