(svn r20401) -Codechange: let HouseSpec use GRFFileProps

This commit is contained in:
rubidium
2010-08-07 21:03:38 +00:00
parent b6a0806948
commit 6d6939f844
7 changed files with 47 additions and 52 deletions

View File

@@ -17,6 +17,7 @@
#include "economy_type.h"
#include "date_type.h"
#include "house_type.h"
#include "newgrf_commons.h"
/**
* Simple value that indicates the house has reached the final stage of
@@ -108,9 +109,7 @@ struct HouseSpec {
bool enabled; ///< the house is available to build (true by default, but can be disabled by newgrf)
/* NewHouses properties */
HouseID substitute_id; ///< which original house this one is based on
struct SpriteGroup *spritegroup; ///< pointer to the different sprites of the house
HouseID override; ///< which house this one replaces
GRFFileProps grf_prop; ///< Properties related the the grf file
uint16 callback_mask; ///< Bitmask of house callbacks that have to be called
byte random_colour[4]; ///< 4 "random" colours
byte probability; ///< Relative probability of appearing (16 is the standard value)
@@ -121,10 +120,6 @@ struct HouseSpec {
byte processing_time; ///< Periodic refresh multiplier
byte minimum_life; ///< The minimum number of years this house will survive before the town rebuilds it
/* grf file related properties*/
uint8 local_id; ///< id defined by the grf file for this house
const struct GRFFile *grffile; ///< grf file that introduced this house
/**
* Get the cost for removing this house
* @return the cost (inflation corrected etc)
@@ -147,7 +142,7 @@ struct HouseSpec {
static inline HouseID GetTranslatedHouseID(HouseID hid)
{
const HouseSpec *hs = HouseSpec::Get(hid);
return hs->override == INVALID_HOUSE_ID ? hid : hs->override;
return hs->grf_prop.override == INVALID_HOUSE_ID ? hid : hs->grf_prop.override;
}
#endif /* HOUSE_H */