(svn r20336) -Codechange: rework the HQ updating

This commit is contained in:
rubidium
2010-08-03 08:32:58 +00:00
parent eb0fa68722
commit 3a971a7f03
4 changed files with 28 additions and 30 deletions

View File

@@ -153,25 +153,6 @@ static inline void SetUnmovableOffset(TileIndex t, uint8 offset)
_m[t].m3 = offset;
}
/**
* Enlarge the given HQ to the given size. If the new size
* is larger than the current size, nothing happens.
* @param t the tile of the HQ.
* @param size the new size of the HQ.
* @pre t is the northern tile of the HQ
*/
static inline void EnlargeCompanyHQ(TileIndex t, byte size)
{
assert(GetUnmovableOffset(t) == 0);
assert(size <= 4);
if (size <= GetUnmovableAnimationStage(t)) return;
SetUnmovableAnimationStage(t, size);
SetUnmovableAnimationStage(t + TileDiffXY(0, 1), size);
SetUnmovableAnimationStage(t + TileDiffXY(1, 0), size);
SetUnmovableAnimationStage(t + TileDiffXY(1, 1), size);
}
/**
* Make an Unmovable tile.