*Better names for var Modelid.
--HG-- branch : trunk
This commit is contained in:
@@ -605,8 +605,8 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI
|
||||
if (CreatureInfo const* ci = GetCreatureTemplateStore(param1))
|
||||
{
|
||||
//use default display
|
||||
if (ci->Modelid1)
|
||||
m_creature->SetDisplayId(ci->Modelid1);
|
||||
if (ci->Modelid_A1)
|
||||
m_creature->SetDisplayId(ci->Modelid_A1);
|
||||
}
|
||||
}
|
||||
//if no param1, then use value from param2 (modelId)
|
||||
|
||||
+10
-10
@@ -100,20 +100,20 @@ uint32 CreatureInfo::GetRandomValidModelId() const
|
||||
uint32 c = 0;
|
||||
uint32 modelIDs[4];
|
||||
|
||||
if (Modelid1) modelIDs[c++] = Modelid1;
|
||||
if (Modelid2) modelIDs[c++] = Modelid2;
|
||||
if (Modelid3) modelIDs[c++] = Modelid3;
|
||||
if (Modelid4) modelIDs[c++] = Modelid4;
|
||||
if (Modelid_A1) modelIDs[c++] = Modelid_A1;
|
||||
if (Modelid_A2) modelIDs[c++] = Modelid_A2;
|
||||
if (Modelid_H1) modelIDs[c++] = Modelid_H1;
|
||||
if (Modelid_H2) modelIDs[c++] = Modelid_H2;
|
||||
|
||||
return ((c>0) ? modelIDs[urand(0,c-1)] : 0);
|
||||
}
|
||||
|
||||
uint32 CreatureInfo::GetFirstValidModelId() const
|
||||
{
|
||||
if(Modelid1) return Modelid1;
|
||||
if(Modelid2) return Modelid2;
|
||||
if(Modelid3) return Modelid3;
|
||||
if(Modelid4) return Modelid4;
|
||||
if(Modelid_A1) return Modelid_A1;
|
||||
if(Modelid_A2) return Modelid_A2;
|
||||
if(Modelid_H1) return Modelid_H1;
|
||||
if(Modelid_H2) return Modelid_H2;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1189,8 +1189,8 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask)
|
||||
CreatureInfo const *cinfo = GetCreatureInfo();
|
||||
if(cinfo)
|
||||
{
|
||||
if(displayId == cinfo->Modelid1 || displayId == cinfo->Modelid2 ||
|
||||
displayId == cinfo->Modelid3 || displayId == cinfo->Modelid4) displayId = 0;
|
||||
if(displayId == cinfo->Modelid_A1 || displayId == cinfo->Modelid_A2 ||
|
||||
displayId == cinfo->Modelid_H1 || displayId == cinfo->Modelid_H2) displayId = 0;
|
||||
}
|
||||
|
||||
// data->guid = guid don't must be update at save
|
||||
|
||||
+4
-4
@@ -150,10 +150,10 @@ struct CreatureInfo
|
||||
{
|
||||
uint32 Entry;
|
||||
uint32 HeroicEntry;
|
||||
uint32 Modelid1;
|
||||
uint32 Modelid2;
|
||||
uint32 Modelid3;
|
||||
uint32 Modelid4;
|
||||
uint32 Modelid_A1;
|
||||
uint32 Modelid_A2;
|
||||
uint32 Modelid_H1;
|
||||
uint32 Modelid_H2;
|
||||
char* Name;
|
||||
char* SubName;
|
||||
char* IconName;
|
||||
|
||||
+4
-4
@@ -598,15 +598,15 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask
|
||||
{
|
||||
if(target->isGameMaster())
|
||||
{
|
||||
if(cinfo->Modelid2)
|
||||
*data << cinfo->Modelid1;
|
||||
if(cinfo->Modelid_A2)
|
||||
*data << cinfo->Modelid_A1;
|
||||
else
|
||||
*data << 17519; // world invisible trigger's model
|
||||
}
|
||||
else
|
||||
{
|
||||
if(cinfo->Modelid2)
|
||||
*data << cinfo->Modelid2;
|
||||
if(cinfo->Modelid_A2)
|
||||
*data << cinfo->Modelid_A2;
|
||||
else
|
||||
*data << 11686; // world invisible trigger's model
|
||||
}
|
||||
|
||||
+12
-12
@@ -566,25 +566,25 @@ 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(cInfo->Modelid1 && !sCreatureModelStorage.LookupEntry<CreatureModelInfo>(cInfo->Modelid1))
|
||||
if(cInfo->Modelid_A1 && !sCreatureModelStorage.LookupEntry<CreatureModelInfo>(cInfo->Modelid_A1))
|
||||
{
|
||||
sLog.outErrorDb("Creature (Entry: %u) has non-existing modelId_A (%u), setting it to 0", cInfo->Entry, cInfo->Modelid1);
|
||||
const_cast<CreatureInfo*>(cInfo)->Modelid1 = 0;
|
||||
sLog.outErrorDb("Creature (Entry: %u) has non-existing Modelid_A1 (%u), setting it to 0", cInfo->Entry, cInfo->Modelid_A1);
|
||||
const_cast<CreatureInfo*>(cInfo)->Modelid_A1 = 0;
|
||||
}
|
||||
if(cInfo->Modelid2 && !sCreatureModelStorage.LookupEntry<CreatureModelInfo>(cInfo->Modelid2))
|
||||
if(cInfo->Modelid_A2 && !sCreatureModelStorage.LookupEntry<CreatureModelInfo>(cInfo->Modelid_A2))
|
||||
{
|
||||
sLog.outErrorDb("Creature (Entry: %u) has non-existing modelId_A2 (%u), setting it to 0", cInfo->Entry, cInfo->Modelid2);
|
||||
const_cast<CreatureInfo*>(cInfo)->Modelid2 = 0;
|
||||
sLog.outErrorDb("Creature (Entry: %u) has non-existing Modelid_A2 (%u), setting it to 0", cInfo->Entry, cInfo->Modelid_A2);
|
||||
const_cast<CreatureInfo*>(cInfo)->Modelid_A2 = 0;
|
||||
}
|
||||
if(cInfo->Modelid3 && !sCreatureModelStorage.LookupEntry<CreatureModelInfo>(cInfo->Modelid3))
|
||||
if(cInfo->Modelid_H1 && !sCreatureModelStorage.LookupEntry<CreatureModelInfo>(cInfo->Modelid_H1))
|
||||
{
|
||||
sLog.outErrorDb("Creature (Entry: %u) has non-existing modelId_H (%u), setting it to 0", cInfo->Entry, cInfo->Modelid3);
|
||||
const_cast<CreatureInfo*>(cInfo)->Modelid3 = 0;
|
||||
sLog.outErrorDb("Creature (Entry: %u) has non-existing Modelid_H1 (%u), setting it to 0", cInfo->Entry, cInfo->Modelid_H1);
|
||||
const_cast<CreatureInfo*>(cInfo)->Modelid_H1 = 0;
|
||||
}
|
||||
if(cInfo->Modelid4 && !sCreatureModelStorage.LookupEntry<CreatureModelInfo>(cInfo->Modelid4))
|
||||
if(cInfo->Modelid_H2 && !sCreatureModelStorage.LookupEntry<CreatureModelInfo>(cInfo->Modelid_H2))
|
||||
{
|
||||
sLog.outErrorDb("Creature (Entry: %u) has non-existing modelId_H2 (%u), setting it to 0", cInfo->Entry, cInfo->Modelid4);
|
||||
const_cast<CreatureInfo*>(cInfo)->Modelid4 = 0;
|
||||
sLog.outErrorDb("Creature (Entry: %u) has non-existing Modelid_H2 (%u), setting it to 0", cInfo->Entry, cInfo->Modelid_H2);
|
||||
const_cast<CreatureInfo*>(cInfo)->Modelid_H2 = 0;
|
||||
}
|
||||
|
||||
if(cInfo->dmgschool >= MAX_SPELL_SCHOOL)
|
||||
|
||||
@@ -181,16 +181,16 @@ void WorldSession::HandleCreatureQueryOpcode( WorldPacket & recv_data )
|
||||
data << uint8(0) << uint8(0) << uint8(0); // name2, name3, name4, always empty
|
||||
data << SubName;
|
||||
data << ci->IconName; // "Directions" for guard, string for Icons 2.3.0
|
||||
data << (uint32)ci->type_flags; // flags wdbFeild7=wad flags1
|
||||
data << (uint32)ci->type_flags; // flags wdbFeild7=wad flags1
|
||||
data << (uint32)ci->type;
|
||||
data << (uint32)ci->family; // family wdbFeild9
|
||||
data << (uint32)ci->rank; // rank wdbFeild10
|
||||
data << (uint32)0; // unknown wdbFeild11
|
||||
data << (uint32)ci->PetSpellDataId; // Id from CreatureSpellData.dbc wdbField12
|
||||
data << (uint32)ci->Modelid1; // Modelid1
|
||||
data << (uint32)ci->Modelid2; // Modelid2
|
||||
data << (uint32)ci->Modelid3; // Modelid3
|
||||
data << (uint32)ci->Modelid4; // Modelid4
|
||||
data << (uint32)ci->Modelid_A1; // Modelid_A1
|
||||
data << (uint32)ci->Modelid_A2; // Modelid_A2
|
||||
data << (uint32)ci->Modelid_H1; // Modelid_H1
|
||||
data << (uint32)ci->Modelid_H2; // Modelid_H2
|
||||
data << (float)1.0f; // unk
|
||||
data << (float)1.0f; // unk
|
||||
data << (uint8)ci->RacialLeader;
|
||||
|
||||
+8
-8
@@ -62,17 +62,17 @@ void Totem::Summon(Unit* owner)
|
||||
uint32 modelid = 0;
|
||||
if(((Player*)owner)->GetTeam() == HORDE)
|
||||
{
|
||||
if(cinfo->Modelid3)
|
||||
modelid = cinfo->Modelid3;
|
||||
else if(cinfo->Modelid4)
|
||||
modelid = cinfo->Modelid4;
|
||||
if(cinfo->Modelid_H1)
|
||||
modelid = cinfo->Modelid_H1;
|
||||
else if(cinfo->Modelid_H2)
|
||||
modelid = cinfo->Modelid_H2;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(cinfo->Modelid1)
|
||||
modelid = cinfo->Modelid1;
|
||||
else if(cinfo->Modelid2)
|
||||
modelid = cinfo->Modelid2;
|
||||
if(cinfo->Modelid_A1)
|
||||
modelid = cinfo->Modelid_A1;
|
||||
else if(cinfo->Modelid_A2)
|
||||
modelid = cinfo->Modelid_A2;
|
||||
}
|
||||
if (modelid)
|
||||
SetDisplayId(modelid);
|
||||
|
||||
Reference in New Issue
Block a user