[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
This commit is contained in:
w12x
2008-10-27 15:28:04 -05:00
parent 1b820f93eb
commit dd97776501
6 changed files with 32 additions and 14 deletions
+16 -4
View File
@@ -59,13 +59,25 @@ void Totem::Summon(Unit* owner)
CreatureInfo const *cinfo = GetCreatureInfo();
if (owner->GetTypeId()==TYPEID_PLAYER && cinfo)
{
if (uint32 modelid = cinfo->GetRandomValidModelId())
SetDisplayId(modelid);
uint32 modelid = 0;
if(((Player*)owner)->GetTeam() == HORDE)
{
if(cinfo->Modelid3)
modelid = cinfo->Modelid3;
else if(cinfo->Modelid4)
modelid = cinfo->Modelid4;
}
else
{
sLog.outErrorDb("No displayid found for the totem with the entry %u! Can't summon it!", GetEntry());
return;
if(cinfo->Modelid1)
modelid = cinfo->Modelid1;
else if(cinfo->Modelid2)
modelid = cinfo->Modelid2;
}
if (modelid)
SetDisplayId(modelid);
else
sLog.outErrorDb("Totem::Summon: Missing modelid information for entry %u, team %u, totem will use default values.",GetEntry(),((Player*)owner)->GetTeam());
}
// Only add if a display exists.