diff options
author | truelight <truelight@openttd.org> | 2007-03-08 14:34:32 +0000 |
---|---|---|
committer | truelight <truelight@openttd.org> | 2007-03-08 14:34:32 +0000 |
commit | 7b153e6356954b1ebcde3c17e0f31474d2973fc6 (patch) | |
tree | 74204bca3b25f96b90b1b1a8de5dfed13c92a61b /src/unmovable_map.h | |
parent | c517f8fd6e9b028c1266ba107b3ab1caadf7c34b (diff) | |
download | openttd-7b153e6356954b1ebcde3c17e0f31474d2973fc6.tar.xz |
(svn r9066) -Fix [FS#638]: store the owner of a statue, so when it gets removed, the town is notified of it
Diffstat (limited to 'src/unmovable_map.h')
-rw-r--r-- | src/unmovable_map.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/unmovable_map.h b/src/unmovable_map.h index b31c932e9..28c364ff1 100644 --- a/src/unmovable_map.h +++ b/src/unmovable_map.h @@ -54,6 +54,23 @@ static inline bool IsCompanyHQ(TileIndex t) return IS_INT_INSIDE(GetUnmovableType(t), UNMOVABLE_HQ_NORTH, UNMOVABLE_HQ_END); } +static inline bool IsStatue(TileIndex t) +{ + assert(IsTileType(t, MP_UNMOVABLE)); + return GetUnmovableType(t) == UNMOVABLE_STATUE; +} + +static inline bool IsStatueTile(TileIndex t) +{ + return IsTileType(t, MP_UNMOVABLE) && IsStatue(t); +} + +static inline TownID GetStatueTownID(TileIndex t) +{ + assert(IsStatue(t)); + return _m[t].m2; +} + static inline byte GetCompanyHQSize(TileIndex t) { assert(IsTileType(t, MP_UNMOVABLE) && IsCompanyHQ(t)); @@ -100,9 +117,10 @@ static inline void MakeLighthouse(TileIndex t) MakeUnmovable(t, UNMOVABLE_LIGHTHOUSE, OWNER_NONE); } -static inline void MakeStatue(TileIndex t, Owner o) +static inline void MakeStatue(TileIndex t, Owner o, TownID town_id) { MakeUnmovable(t, UNMOVABLE_STATUE, o); + _m[t].m2 = town_id; } static inline void MakeOwnedLand(TileIndex t, Owner o) |