(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.
pull/155/head
belugas 16 years ago
parent e8f190849e
commit 7d4952ae30

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

Loading…
Cancel
Save