(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.
This commit is contained in:
belugas 2009-01-29 03:07:34 +00:00
parent 0e42a7bac7
commit 31adec86a0
1 changed files with 1 additions and 2 deletions

View File

@ -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);