forked from mirrors/0ad
Fix a map exploration OOS on rejoin when starting with territory at the map boundaries.
6aeb5c64deforgot to add a LosIsOffWorld check in ExploreTerritories (aka UpdateTerritoriesLos) and thus marked tiles outside of the world as explored.f5e60157bftransformed the bug into a non-simulation desynchronization, causing rejoined players to see a different score, as they excluded off-world tiles when filling the cache in ResetDerivedData upon rejoin.4a0673e44etransformed the bug into an actual simulation OOS by serializing that map exploration percentage based on that cache. Also tiles at the map border in square maps are not rendered as expected, so this commit hides refs #4267. Differential Revision: https://code.wildfiregames.com/D630 Fixes #4598 Proofread by: Itms Tested By: Imarok This was SVN commit r19790.
This commit is contained in:
@@ -1917,13 +1917,16 @@ public:
|
||||
if (p > 0 && p <= MAX_LOS_PLAYER_ID)
|
||||
{
|
||||
u32& explored = m_ExploredVertices.at(p);
|
||||
for (int dj = 0; dj <= scale; ++dj)
|
||||
for (int di = 0; di <= scale; ++di)
|
||||
for (int tj = j * scale; tj <= (j+1) * scale; ++tj)
|
||||
for (int ti = i * scale; ti <= (i+1) * scale; ++ti)
|
||||
{
|
||||
u32& losState = m_LosState[(i*scale+di) + (j*scale+dj)*m_TerrainVerticesPerSide];
|
||||
if (LosIsOffWorld(ti, tj))
|
||||
continue;
|
||||
|
||||
u32& losState = m_LosState[ti + tj * m_TerrainVerticesPerSide];
|
||||
if (!(losState & (LOS_EXPLORED << (2*(p-1)))))
|
||||
{
|
||||
explored++;
|
||||
++explored;
|
||||
losState |= (LOS_EXPLORED << (2*(p-1)));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user