Core/GameObjects: Chests will now remain locked for players who left the group if loot from that boss is stored in it (note: this is just an implementation of locking the chest, they still need to be linked to a boss - not yet implemented)

This commit is contained in:
Shauren
2012-03-12 18:07:34 +01:00
parent a48216e122
commit 671fd4176a
3 changed files with 76 additions and 0 deletions
@@ -486,6 +486,10 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask*
}
updateMask->SetBit(GAMEOBJECT_DYNAMIC);
updateMask->SetBit(GAMEOBJECT_BYTES_1);
if (ToGameObject()->GetGoType() == GAMEOBJECT_TYPE_CHEST && ToGameObject()->GetGOInfo()->chest.groupLootRules &&
ToGameObject()->HasLootRecipient())
updateMask->SetBit(GAMEOBJECT_FLAGS);
}
else if (isType(TYPEMASK_UNIT))
{
@@ -709,6 +713,15 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask*
*data << uint16(-1);
}
}
else if (index == GAMEOBJECT_FLAGS)
{
uint32 flags = m_uint32Values[index];
if (ToGameObject()->GetGoType() == GAMEOBJECT_TYPE_CHEST)
if (ToGameObject()->GetGOInfo()->chest.groupLootRules && !ToGameObject()->IsLootAllowedFor(target))
flags |= GO_FLAG_LOCKED | GO_FLAG_NOT_SELECTABLE;
*data << flags;
}
else
*data << m_uint32Values[index]; // other cases
}