(svn r4196) -Codechange: Add and make use of an accessor that modifies the size of the Company HQ

This commit is contained in:
celestar
2006-03-31 09:09:26 +00:00
parent 1c19e7be00
commit 20c29f10df
2 changed files with 17 additions and 13 deletions

View File

@@ -39,6 +39,17 @@ static inline bool IsOwnedLandTile(TileIndex t)
}
static inline void EnlargeCompanyHQ(TileIndex t, byte size)
{
if (size <= _m[t].m5 - UNMOVABLE_HQ_NORTH) return;
_m[t + TileDiffXY(0, 0)].m5 = UNMOVABLE_HQ_NORTH + size * 4;
_m[t + TileDiffXY(0, 1)].m5 = UNMOVABLE_HQ_WEST + size * 4;
_m[t + TileDiffXY(1, 0)].m5 = UNMOVABLE_HQ_EAST + size * 4;
_m[t + TileDiffXY(1, 1)].m5 = UNMOVABLE_HQ_SOUTH + size * 4;
}
static inline void MakeUnmovable(TileIndex t, UnmovableType u, Owner o)
{
SetTileType(t, MP_UNMOVABLE);