aboutsummaryrefslogtreecommitdiff
path: root/src/game/Object.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-05-05 16:56:15 -0500
committermegamage <none@none>2009-05-05 16:56:15 -0500
commite69d2cbed95b6cddd009f68dd80fd4614342d1fc (patch)
tree8dd0777d15adf284f2b0146e791ac4cd868b36e3 /src/game/Object.cpp
parentdcb2b5aa019c409b1b9b1061aa4dd24c8ecacb5d (diff)
[7776] Completed implementation of CMSG_SPELLCLICK Author: arrai
For vehicles, you have to add the correct SPELL_AURA_CONTROL_VEHICLE spells to npc_spellclick_spells, otherwise you won't be able to use them --HG-- branch : trunk
Diffstat (limited to 'src/game/Object.cpp')
-rw-r--r--src/game/Object.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/game/Object.cpp b/src/game/Object.cpp
index 56d52f5e49f..7adc7d306bb 100644
--- a/src/game/Object.cpp
+++ b/src/game/Object.cpp
@@ -526,9 +526,16 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask
{
if( updateMask->GetBit( index ) )
{
- // remove custom flag before send
if( index == UNIT_NPC_FLAGS )
- *data << uint32(m_uint32Values[ index ] & ~(UNIT_NPC_FLAG_GUARD + UNIT_NPC_FLAG_OUTDOORPVP));
+ {
+ // remove custom flag before sending
+ uint32 appendValue = m_uint32Values[ index ] & ~(UNIT_NPC_FLAG_GUARD + UNIT_NPC_FLAG_OUTDOORPVP);
+
+ if (GetTypeId() == TYPEID_UNIT && !target->canSeeSpellClickOn((Creature*)this))
+ appendValue &= ~UNIT_NPC_FLAG_SPELLCLICK;
+
+ *data << uint32(appendValue);
+ }
// FIXME: Some values at server stored in float format but must be sent to client in uint32 format
else if(index >= UNIT_FIELD_BASEATTACKTIME && index <= UNIT_FIELD_RANGEDATTACKTIME)
{