1
0
forked from 0ad/0ad

Some entities (like birds) can have negative positions without being marked as out-of-world.

Refs #2430

This was SVN commit r16544.
This commit is contained in:
Nicolas Auvray 2015-04-15 12:19:47 +00:00
parent 120ff2c60c
commit 5c84c3e9e5

View File

@ -374,7 +374,7 @@ private:
inline size_t Index(fixed position)
{
return (position / SUBDIVISION_SIZE).ToInt_RoundToZero();
return Clamp((position / SUBDIVISION_SIZE).ToInt_RoundToZero(), 0, (int)m_ArrayWidth-1);
}
inline size_t SubdivisionIdx(CFixedVector2D position)