From 7b153e6356954b1ebcde3c17e0f31474d2973fc6 Mon Sep 17 00:00:00 2001 From: truelight Date: Thu, 8 Mar 2007 14:34:32 +0000 Subject: (svn r9066) -Fix [FS#638]: store the owner of a statue, so when it gets removed, the town is notified of it --- src/unmovable_map.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src/unmovable_map.h') 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) -- cgit v1.2.3-70-g09d2