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

[svn] * Changed modelid_a/h(2) values to modelid1..4, display ids are no longer incorrectly chosen based on player faction. Patch provided by WarHead?.

Original author: w12x
Date: 2008-10-27 11:48:45-05:00

Files:
1 modified

Legend:

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

    r111 r123  
    5757void Totem::Summon(Unit* owner) 
    5858{ 
     59    CreatureInfo const *cinfo = GetCreatureInfo(); 
     60    if (owner->GetTypeId()==TYPEID_PLAYER && cinfo) 
     61    { 
     62        if (uint32 modelid = cinfo->GetRandomValidModelId())  
     63            SetDisplayId(modelid); 
     64        else 
     65        { 
     66            sLog.outErrorDb("No displayid found for the totem with the entry %u! Can't summon it!", GetEntry()); 
     67            return; 
     68        } 
     69    } 
     70 
     71    // Only add if a display exists. 
    5972    sLog.outDebug("AddObject at Totem.cpp line 49"); 
    60  
    6173    SetInstanceId(owner->GetInstanceId()); 
    6274    owner->GetMap()->Add((Creature*)this); 
    63  
    64     // select totem model in dependent from owner team 
    65     CreatureInfo const *cinfo = GetCreatureInfo(); 
    66     if(owner->GetTypeId()==TYPEID_PLAYER && cinfo) 
    67     { 
    68         if(((Player*)owner)->GetTeam()==HORDE) 
    69             SetDisplayId(cinfo->DisplayID_H); 
    70         else 
    71             SetDisplayId(cinfo->DisplayID_A); 
    72     } 
    7375 
    7476    WorldPacket data(SMSG_GAMEOBJECT_SPAWN_ANIM_OBSOLETE, 8);