From 31adec86a0340b13eb50f84d44bb3e71b2648cde Mon Sep 17 00:00:00 2001 From: belugas Date: Thu, 29 Jan 2009 03:07:34 +0000 Subject: (svn r15292) -Fix(r15290): Incrementing something that is already set to the correct value is a bit of a no-no Also, protect against such misuse with an assert. --- src/unmovable_map.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/unmovable_map.h') diff --git a/src/unmovable_map.h b/src/unmovable_map.h index 91782728b..0dd11e7dc 100644 --- a/src/unmovable_map.h +++ b/src/unmovable_map.h @@ -166,8 +166,7 @@ static inline void SetCompanyHQSection(TileIndex t, uint8 section) static inline void EnlargeCompanyHQ(TileIndex t, byte size) { assert(GetCompanyHQSection(t) == 0); - - size++; + assert(size <= 4); if (size <= GetCompanyHQSize(t)) return; SetCompanyHQSize(t , size); -- cgit v1.2.3-54-g00ecf