aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfunjoker <torti-esser@web.de>2019-06-16 21:32:01 +0200
committerShauren <shauren.trinity@gmail.com>2019-06-16 21:32:01 +0200
commiteef87a9cc06bea80b9867491e126c6500dc608a9 (patch)
treea854deec95660883807b63253c50472496acbe6d
parent04a247f40eef4d6947ae39038017fdedb9cb7083 (diff)
Core/Creatures: Modify creature_template_model structure to accept unmodified sniffed data (#23427)
-rw-r--r--sql/updates/world/master/2019_06_16_01_world.sql2
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp2
2 files changed, 2 insertions, 2 deletions
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)
{