Show
Ignore:
Timestamp:
11/19/08 13:38:32 (17 years ago)
Author:
yumileroy
Message:

[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.

Original author: w12x
Date: 2008-10-27 15:28:04-05:00

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/game/ObjectMgr.cpp

    r123 r126  
    712712 
    713713        // check model ids, supplying and sending non-existent ids to the client might crash them 
    714         if(!sCreatureModelStorage.LookupEntry<CreatureModelInfo>(cInfo->Modelid1)) 
     714        if(cInfo->Modelid1 && !sCreatureModelStorage.LookupEntry<CreatureModelInfo>(cInfo->Modelid1)) 
    715715        { 
    716716            sLog.outErrorDb("Creature (Entry: %u) has non-existing modelId_A (%u), setting it to 0", cInfo->Entry, cInfo->Modelid1); 
    717717            const_cast<CreatureInfo*>(cInfo)->Modelid1 = 0; 
    718718        } 
    719         if(!sCreatureModelStorage.LookupEntry<CreatureModelInfo>(cInfo->Modelid2)) 
     719        if(cInfo->Modelid2 && !sCreatureModelStorage.LookupEntry<CreatureModelInfo>(cInfo->Modelid2)) 
    720720        { 
    721721            sLog.outErrorDb("Creature (Entry: %u) has non-existing modelId_A2 (%u), setting it to 0", cInfo->Entry, cInfo->Modelid2); 
    722722            const_cast<CreatureInfo*>(cInfo)->Modelid2 = 0; 
    723723        } 
    724         if(!sCreatureModelStorage.LookupEntry<CreatureModelInfo>(cInfo->Modelid3)) 
     724        if(cInfo->Modelid3 && !sCreatureModelStorage.LookupEntry<CreatureModelInfo>(cInfo->Modelid3)) 
    725725        { 
    726726            sLog.outErrorDb("Creature (Entry: %u) has non-existing modelId_H (%u), setting it to 0", cInfo->Entry, cInfo->Modelid3); 
    727727            const_cast<CreatureInfo*>(cInfo)->Modelid3 = 0; 
    728728        } 
    729         if(!sCreatureModelStorage.LookupEntry<CreatureModelInfo>(cInfo->Modelid4)) 
     729        if(cInfo->Modelid4 && !sCreatureModelStorage.LookupEntry<CreatureModelInfo>(cInfo->Modelid4)) 
    730730        { 
    731731            sLog.outErrorDb("Creature (Entry: %u) has non-existing modelId_H2 (%u), setting it to 0", cInfo->Entry, cInfo->Modelid4);