# HG changeset patch # User belugas # Date 2009-01-29 03:07:34 # Node ID 857844cabc20293f790eb4bc00048798df17e855 # Parent 740721e333a9c5c84e9e0f329b1ff0a19967ef4d (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. diff --git a/src/unmovable_map.h b/src/unmovable_map.h --- a/src/unmovable_map.h +++ b/src/unmovable_map.h @@ -166,8 +166,7 @@ static inline void SetCompanyHQSection(T static inline void EnlargeCompanyHQ(TileIndex t, byte size) { assert(GetCompanyHQSection(t) == 0); - - size++; + assert(size <= 4); if (size <= GetCompanyHQSize(t)) return; SetCompanyHQSize(t , size);