Skip to content

Commit

Permalink
Merge pull request #16433 from Tonghost/3.3.5
Browse files Browse the repository at this point in the history
 [3.3.5][6.x] Core/Creature: Do not load equipment with id = 1 when creature.equipmen…
  • Loading branch information
Treeston committed Feb 6, 2016
2 parents 6d8e39f + cc3ae64 commit e3d5299
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/server/game/Entities/Creature/Creature.cpp
Expand Up @@ -369,13 +369,13 @@ bool Creature::InitEntry(uint32 entry, CreatureData const* data /*= nullptr*/)
SetByteValue(UNIT_FIELD_BYTES_0, 2, minfo->gender);

// Load creature equipment
if (!data || data->equipmentId == 0)
LoadEquipment(); // use default equipment (if available)
else if (data && data->equipmentId != 0) // override, 0 means no equipment
if (data && data->equipmentId != 0)
{
m_originalEquipmentId = data->equipmentId;
LoadEquipment(data->equipmentId);
}
else
LoadEquipment(0, true);

SetName(normalInfo->Name); // at normal entry always

Expand Down Expand Up @@ -1409,6 +1409,7 @@ void Creature::LoadEquipment(int8 id, bool force /*= true*/)
SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + i, 0);
m_equipmentId = 0;
}

return;
}

Expand All @@ -1417,7 +1418,7 @@ void Creature::LoadEquipment(int8 id, bool force /*= true*/)
return;

m_equipmentId = id;
for (uint8 i = 0; i < 3; ++i)
for (uint8 i = 0; i < MAX_EQUIPMENT_ITEMS; ++i)
SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + i, einfo->ItemEntry[i]);
}

Expand Down
2 changes: 1 addition & 1 deletion src/server/game/Globals/ObjectMgr.cpp
Expand Up @@ -1756,7 +1756,7 @@ void ObjectMgr::LoadCreatures()
if (!ok)
continue;

// -1 random, 0 no equipment,
// -1 random, 0 no equipment
if (data.equipmentId != 0)
{
if (!GetEquipmentInfo(data.id, data.equipmentId))
Expand Down

0 comments on commit e3d5299

Please sign in to comment.