*When alliance and horde are in same group, also display pets as friendly.
--HG-- branch : trunk
This commit is contained in:
+32
-21
@@ -551,19 +551,24 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask
|
|||||||
*data << uint32(m_floatValues[ index ]);
|
*data << uint32(m_floatValues[ index ]);
|
||||||
}
|
}
|
||||||
// Gamemasters should be always able to select units - remove not selectable flag
|
// Gamemasters should be always able to select units - remove not selectable flag
|
||||||
else if(index == UNIT_FIELD_FLAGS && target->isGameMaster())
|
else if(index == UNIT_FIELD_FLAGS)
|
||||||
{
|
{
|
||||||
|
if(target->isGameMaster())
|
||||||
*data << (m_uint32Values[ index ] & ~UNIT_FLAG_NOT_SELECTABLE);
|
*data << (m_uint32Values[ index ] & ~UNIT_FLAG_NOT_SELECTABLE);
|
||||||
|
else
|
||||||
|
*data << m_uint32Values[ index ];
|
||||||
}
|
}
|
||||||
// use modelid_a if not gm, _h if gm for CREATURE_FLAG_EXTRA_TRIGGER creatures
|
// use modelid_a if not gm, _h if gm for CREATURE_FLAG_EXTRA_TRIGGER creatures
|
||||||
else if(index == UNIT_FIELD_DISPLAYID && GetTypeId() == TYPEID_UNIT)
|
else if(index == UNIT_FIELD_DISPLAYID)
|
||||||
|
{
|
||||||
|
if(GetTypeId() == TYPEID_UNIT)
|
||||||
{
|
{
|
||||||
const CreatureInfo* cinfo = ((Creature*)this)->GetCreatureInfo();
|
const CreatureInfo* cinfo = ((Creature*)this)->GetCreatureInfo();
|
||||||
if(cinfo->flags_extra & CREATURE_FLAG_EXTRA_TRIGGER)
|
if(cinfo->flags_extra & CREATURE_FLAG_EXTRA_TRIGGER)
|
||||||
{
|
{
|
||||||
if(target->isGameMaster())
|
if(target->isGameMaster())
|
||||||
{
|
{
|
||||||
if(cinfo->Modelid_A2)
|
if(cinfo->Modelid_A1)
|
||||||
*data << cinfo->Modelid_A1;
|
*data << cinfo->Modelid_A1;
|
||||||
else
|
else
|
||||||
*data << 17519; // world invisible trigger's model
|
*data << 17519; // world invisible trigger's model
|
||||||
@@ -579,44 +584,50 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask
|
|||||||
else
|
else
|
||||||
*data << m_uint32Values[ index ];
|
*data << m_uint32Values[ index ];
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
*data << m_uint32Values[ index ];
|
||||||
|
}
|
||||||
// hide lootable animation for unallowed players
|
// hide lootable animation for unallowed players
|
||||||
else if(index == UNIT_DYNAMIC_FLAGS && GetTypeId() == TYPEID_UNIT)
|
else if(index == UNIT_DYNAMIC_FLAGS)
|
||||||
|
{
|
||||||
|
if(GetTypeId() == TYPEID_UNIT)
|
||||||
{
|
{
|
||||||
if(!target->isAllowedToLoot((Creature*)this))
|
if(!target->isAllowedToLoot((Creature*)this))
|
||||||
*data << (m_uint32Values[ index ] & ~UNIT_DYNFLAG_LOOTABLE);
|
*data << (m_uint32Values[ index ] & ~UNIT_DYNFLAG_LOOTABLE);
|
||||||
else
|
else
|
||||||
*data << (m_uint32Values[ index ] & ~UNIT_DYNFLAG_OTHER_TAGGER);
|
*data << (m_uint32Values[ index ] & ~UNIT_DYNFLAG_OTHER_TAGGER);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
*data << m_uint32Values[ index ];
|
||||||
|
}
|
||||||
// FG: pretend that OTHER players in own group are friendly ("blue")
|
// FG: pretend that OTHER players in own group are friendly ("blue")
|
||||||
else if(index == UNIT_FIELD_BYTES_2 || index == UNIT_FIELD_FACTIONTEMPLATE)
|
else if(index == UNIT_FIELD_BYTES_2 || index == UNIT_FIELD_FACTIONTEMPLATE)
|
||||||
{
|
{
|
||||||
bool ch = false;
|
if(((Unit*)this)->IsControlledByPlayer() && target != this && sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP) && ((Unit*)this)->IsInRaidWith(target))
|
||||||
if(GetTypeId() == TYPEID_PLAYER && target != this
|
|
||||||
&& ((Player*)this)->IsInSameRaidWith(target))
|
|
||||||
{
|
|
||||||
// Allow targetting opposite faction in party when enabled in config
|
|
||||||
if(sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP) && index == UNIT_FIELD_BYTES_2)
|
|
||||||
{
|
|
||||||
DEBUG_LOG("-- VALUES_UPDATE: Sending '%s' the blue-group-fix from '%s' (flag)", target->GetName(), ((Player*)this)->GetName());
|
|
||||||
*data << ( m_uint32Values[ index ] & ((UNIT_BYTE2_FLAG_SANCTUARY /*| UNIT_BYTE2_FLAG_AURAS | UNIT_BYTE2_FLAG_UNK5*/) << 8) ); // this flag is at uint8 offset 1 !!
|
|
||||||
|
|
||||||
ch = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
FactionTemplateEntry const *ft1, *ft2;
|
FactionTemplateEntry const *ft1, *ft2;
|
||||||
ft1 = ((Player*)this)->getFactionTemplateEntry();
|
ft1 = ((Unit*)this)->getFactionTemplateEntry();
|
||||||
ft2 = target->getFactionTemplateEntry();
|
ft2 = target->getFactionTemplateEntry();
|
||||||
if(ft1 && ft2 && !ft1->IsFriendlyTo(*ft2))
|
if(ft1 && ft2 && !ft1->IsFriendlyTo(*ft2))
|
||||||
{
|
{
|
||||||
uint32 faction = target->getFaction(); // pretend that all other HOSTILE players have own faction, to allow follow, heal, rezz (trade wont work)
|
if(index == UNIT_FIELD_BYTES_2)
|
||||||
|
{
|
||||||
|
// Allow targetting opposite faction in party when enabled in config
|
||||||
|
DEBUG_LOG("-- VALUES_UPDATE: Sending '%s' the blue-group-fix from '%s' (flag)", target->GetName(), ((Player*)this)->GetName());
|
||||||
|
*data << ( m_uint32Values[ index ] & ((UNIT_BYTE2_FLAG_SANCTUARY /*| UNIT_BYTE2_FLAG_AURAS | UNIT_BYTE2_FLAG_UNK5*/) << 8) ); // this flag is at uint8 offset 1 !!
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// pretend that all other HOSTILE players have own faction, to allow follow, heal, rezz (trade wont work)
|
||||||
|
uint32 faction = target->getFaction();
|
||||||
DEBUG_LOG("-- VALUES_UPDATE: Sending '%s' the blue-group-fix from '%s' (faction %u)", target->GetName(), ((Player*)this)->GetName(), faction);
|
DEBUG_LOG("-- VALUES_UPDATE: Sending '%s' the blue-group-fix from '%s' (faction %u)", target->GetName(), ((Player*)this)->GetName(), faction);
|
||||||
*data << uint32(faction);
|
*data << uint32(faction);
|
||||||
ch = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
*data << m_uint32Values[ index ];
|
||||||
}
|
}
|
||||||
if(!ch)
|
else
|
||||||
*data << m_uint32Values[ index ];
|
*data << m_uint32Values[ index ];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user