1
0
forked from 0ad/0ad

Don't crash when units are hanging over the edge of the map

This was SVN commit r3119.
This commit is contained in:
Ykkrosh 2005-11-08 22:52:55 +00:00
parent e6a4dd7f3f
commit d51f4900d8

View File

@ -171,6 +171,11 @@ ELOSStatus CLOSManager::GetStatus(int tx, int tz, CPlayer* player)
{
//TIMER_ACCRUE(tc_getstatus);
// Ensure that units off the map don't cause the visibility arrays to be
// accessed out of bounds
if ((unsigned)tx >= m_TilesPerSide || (unsigned)tz >= m_TilesPerSide)
return LOS_UNEXPLORED;
// TODO: Make the mask depend on the player's diplomacy (just OR all his allies' masks)
#ifdef _2_los