forked from mirrors/0ad
Supersede the "Reveal all" flag when displaying mirages, to avoid seeing other players' mirages. This is especially problematic when switching perspective to an AI player.
Fixes #2712, thanks mimo for the report and for having looked into the related code. This was SVN commit r15705.
This commit is contained in:
@@ -1391,6 +1391,11 @@ public:
|
||||
int i = (pos.X / (int)TERRAIN_TILE_SIZE).ToInt_RoundToNearest();
|
||||
int j = (pos.Y / (int)TERRAIN_TILE_SIZE).ToInt_RoundToNearest();
|
||||
|
||||
// Mirage entities, whatever the situation, are visible for one specific player
|
||||
CmpPtr<ICmpMirage> cmpMirage(ent);
|
||||
if (cmpMirage && cmpMirage->GetPlayer() != player)
|
||||
return VIS_HIDDEN;
|
||||
|
||||
// Reveal flag makes all positioned entities visible
|
||||
if (GetLosRevealAll(player))
|
||||
{
|
||||
@@ -1400,11 +1405,6 @@ public:
|
||||
return VIS_VISIBLE;
|
||||
}
|
||||
|
||||
// Mirage entities, whatever their position, are visible for one specific player
|
||||
CmpPtr<ICmpMirage> cmpMirage(ent);
|
||||
if (cmpMirage && cmpMirage->GetPlayer() != player)
|
||||
return VIS_HIDDEN;
|
||||
|
||||
// Visible if within a visible region
|
||||
CLosQuerier los(GetSharedLosMask(player), m_LosState, m_TerrainVerticesPerSide);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user