[7716] Fixed some typos and possible crashes.

This commit is contained in:
AlexDereka 2009-04-26 18:49:00 +04:00
parent c2e6dd20dd
commit c9d51a6dc7
25 changed files with 281 additions and 263 deletions

View file

@ -683,17 +683,17 @@ void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate)
}
else // If not spawned
{
CreatureData const* data = objmgr.GetCreatureData(itr->first);
if (data && activate)
CreatureData const* data2 = objmgr.GetCreatureData(itr->first);
if (data2 && activate)
{
CreatureInfo const *cinfo = objmgr.GetCreatureTemplate(data->id);
uint32 display_id = objmgr.ChooseDisplayId(0,cinfo,data);
CreatureInfo const *cinfo = objmgr.GetCreatureTemplate(data2->id);
uint32 display_id = objmgr.ChooseDisplayId(0,cinfo,data2);
CreatureModelInfo const *minfo = objmgr.GetCreatureModelRandomGender(display_id);
if (minfo)
display_id = minfo->modelid;
if (data->equipmentId == 0)
if (data2->equipmentId == 0)
itr->second.equipement_id_prev = cinfo->equipmentId;
else if (data->equipmentId != -1)
else if (data2->equipmentId != -1)
itr->second.equipement_id_prev = data->equipmentId;
itr->second.modelid_prev = display_id;
}