aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Entities/Object
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2012-03-12 18:07:34 +0100
committerShauren <shauren.trinity@gmail.com>2012-03-12 18:07:34 +0100
commit671fd4176a2000b5dd8cdb5b009bc13046dc9bc1 (patch)
tree39b73166d049923f85000a54aced6fd3f4cd52f5 /src/server/game/Entities/Object
parenta48216e1226601817a76605b12ee7bafbaf66a78 (diff)
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)
Diffstat (limited to 'src/server/game/Entities/Object')
-rwxr-xr-xsrc/server/game/Entities/Object/Object.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp
index 56ddd14dc3a..d8ee305230e 100755
--- a/src/server/game/Entities/Object/Object.cpp
+++ b/src/server/game/Entities/Object/Object.cpp
@@ -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
}