From dd977765014498fd97dd89f68738e5fa2306e465 Mon Sep 17 00:00:00 2001 From: w12x Date: Mon, 27 Oct 2008 15:28:04 -0500 Subject: [svn] * Fixed startup error flood if creature model id is 0 * Fixed totems using proper model ids broken after recent change * Set pet grid activity state to that of caster upon summoning * Fix a possible crash in ObjectAccessor note to self: don't commit anything without 3 days testing. ever. after this one ofc. --HG-- branch : trunk --- src/game/ObjectMgr.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/game/ObjectMgr.cpp') diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 0d290c26876..38926c8cef0 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -711,22 +711,22 @@ void ObjectMgr::LoadCreatureTemplates() sLog.outErrorDb("Creature (Entry: %u) has non-existing faction_H template (%u)", cInfo->Entry, cInfo->faction_H); // check model ids, supplying and sending non-existent ids to the client might crash them - if(!sCreatureModelStorage.LookupEntry(cInfo->Modelid1)) + if(cInfo->Modelid1 && !sCreatureModelStorage.LookupEntry(cInfo->Modelid1)) { sLog.outErrorDb("Creature (Entry: %u) has non-existing modelId_A (%u), setting it to 0", cInfo->Entry, cInfo->Modelid1); const_cast(cInfo)->Modelid1 = 0; } - if(!sCreatureModelStorage.LookupEntry(cInfo->Modelid2)) + if(cInfo->Modelid2 && !sCreatureModelStorage.LookupEntry(cInfo->Modelid2)) { sLog.outErrorDb("Creature (Entry: %u) has non-existing modelId_A2 (%u), setting it to 0", cInfo->Entry, cInfo->Modelid2); const_cast(cInfo)->Modelid2 = 0; } - if(!sCreatureModelStorage.LookupEntry(cInfo->Modelid3)) + if(cInfo->Modelid3 && !sCreatureModelStorage.LookupEntry(cInfo->Modelid3)) { sLog.outErrorDb("Creature (Entry: %u) has non-existing modelId_H (%u), setting it to 0", cInfo->Entry, cInfo->Modelid3); const_cast(cInfo)->Modelid3 = 0; } - if(!sCreatureModelStorage.LookupEntry(cInfo->Modelid4)) + if(cInfo->Modelid4 && !sCreatureModelStorage.LookupEntry(cInfo->Modelid4)) { sLog.outErrorDb("Creature (Entry: %u) has non-existing modelId_H2 (%u), setting it to 0", cInfo->Entry, cInfo->Modelid4); const_cast(cInfo)->Modelid4 = 0; -- cgit v1.2.3