Core/Units: Rename and change Get/SetVisibility to use a bool value instead of an unnecessary enum
Also replace some SetVisibility hacks to directly call UpdateObjectVisibility --HG-- branch : trunk
This commit is contained in:
1 parent
57c76407b0
commit
8fae0c176d
70 files changed
+181
-187
No files matched your search
@@ -12140,9 +12140,9 @@ bool Unit::isAlwaysDetectableFor(WorldObject const* seer) const
|
||||
return false;
|
||||
}
|
||||
|
||||
void Unit::SetVisibility(UnitVisibility x)
|
||||
void Unit::SetVisible(bool x)
|
||||
{
|
||||
if (x == VISIBILITY_OFF)
|
||||
if (!x)
|
||||
m_serverSideVisibility.SetValue(SERVERSIDE_VISIBILITY_GM, SEC_GAMEMASTER);
|
||||
else
|
||||
m_serverSideVisibility.SetValue(SERVERSIDE_VISIBILITY_GM, SEC_PLAYER);
|
||||
@@ -14700,13 +14700,13 @@ void Unit::SetContestedPvP(Player *attackedPlayer)
|
||||
player->addUnitState(UNIT_STAT_ATTACK_PLAYER);
|
||||
player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_CONTESTED_PVP);
|
||||
// call MoveInLineOfSight for nearby contested guards
|
||||
player->SetVisibility(player->GetVisibility());
|
||||
UpdateObjectVisibility();
|
||||
}
|
||||
if (!hasUnitState(UNIT_STAT_ATTACK_PLAYER))
|
||||
{
|
||||
addUnitState(UNIT_STAT_ATTACK_PLAYER);
|
||||
// call MoveInLineOfSight for nearby contested guards
|
||||
SetVisibility(GetVisibility());
|
||||
UpdateObjectVisibility();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user