aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/world/cata_classic/2024_06_20_01_world_2024_06_08_00_world.sql2
-rw-r--r--src/server/game/Entities/Creature/Creature.cpp2
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp9
3 files changed, 12 insertions, 1 deletions
diff --git a/sql/updates/world/cata_classic/2024_06_20_01_world_2024_06_08_00_world.sql b/sql/updates/world/cata_classic/2024_06_20_01_world_2024_06_08_00_world.sql
new file mode 100644
index 00000000000..5c5d6cc5168
--- /dev/null
+++ b/sql/updates/world/cata_classic/2024_06_20_01_world_2024_06_08_00_world.sql
@@ -0,0 +1,2 @@
+-- Invalid DisplayIds
+UPDATE `creature` SET `modelid`=0 WHERE `modelid` IN (1,239,251,252,370,533,959,1041,1405,2709,12346,14952,15939,16051,16622,18736,19338,21360,22106,22748,23033,23148,23504,23646,24446,24472,24922,24923,25030,25452,25572,25579,26101,26198,26223,26273,26363,26590,26762,27029,27074,27861,28283,35014);
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp
index 8c20cc793fd..280cc268017 100644
--- a/src/server/game/Entities/Creature/Creature.cpp
+++ b/src/server/game/Entities/Creature/Creature.cpp
@@ -523,7 +523,7 @@ bool Creature::InitEntry(uint32 entry, CreatureData const* data /*= nullptr*/)
CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelRandomGender(&model, creatureInfo);
if (!minfo) // Cancel load if no model defined
{
- TC_LOG_ERROR("sql.sql", "Creature (Entry: {}) has invalid model {} defined in table `creature_template`, can't load.", entry, model.CreatureDisplayID);
+ TC_LOG_ERROR("sql.sql", "Creature (Entry: {}) has invalid model {} defined in table `creature_template_model`, can't load.", entry, model.CreatureDisplayID);
return false;
}
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index 0a71eb8d80a..5385f24cbb8 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -2249,6 +2249,15 @@ void ObjectMgr::LoadCreatures()
continue;
}
+ if (data.display.has_value())
+ {
+ if (!GetCreatureModelInfo(data.display->CreatureDisplayID))
+ {
+ TC_LOG_ERROR("sql.sql", "Table `creature` has creature (GUID: {} Entry: {}) with invalid `modelid` {}, ignoring.", guid, data.id, data.display->CreatureDisplayID);
+ data.display.reset();
+ }
+ }
+
// -1 random, 0 no equipment
if (data.equipmentId != 0)
{