From a0cf780e1e00af51177c4efd45dbbb7bbf046fae Mon Sep 17 00:00:00 2001 From: Itms Date: Thu, 16 Apr 2015 13:17:58 +0000 Subject: [PATCH] Amend 5c84c3e9e5 This was SVN commit r16547. --- source/simulation2/helpers/Spatial.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/simulation2/helpers/Spatial.h b/source/simulation2/helpers/Spatial.h index 2e674293fd..aa61d8a746 100644 --- a/source/simulation2/helpers/Spatial.h +++ b/source/simulation2/helpers/Spatial.h @@ -429,7 +429,9 @@ public: void Reset(fixed w, fixed h) { - Reset(std::max(Index(w), Index(h)) + 1); + ENSURE(w >= fixed::Zero() && h >= fixed::Zero()); + size_t arrayWidth = std::max((w / SUBDIVISION_SIZE).ToInt_RoundToZero(), (h / SUBDIVISION_SIZE).ToInt_RoundToZero()) + 1; + Reset(arrayWidth); } FastSpatialSubdivision& operator=(const FastSpatialSubdivision& other)