diff options
author | belugas <belugas@openttd.org> | 2009-01-29 03:07:34 +0000 |
---|---|---|
committer | belugas <belugas@openttd.org> | 2009-01-29 03:07:34 +0000 |
commit | 7d4952ae307913126f584bd43069f23ae6272fa3 (patch) | |
tree | 0ad658a910ea1438adc2b6179d7cb216b07c9366 | |
parent | e8f190849ec43775bff136361b9ffc364d5fe95f (diff) | |
download | openttd-7d4952ae307913126f584bd43069f23ae6272fa3.tar.xz |
(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.
-rw-r--r-- | src/unmovable_map.h | 3 |
1 files changed, 1 insertions, 2 deletions
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); |