(svn r18008) -Codechange: Rename NUM_PRICES to PR_END, and use the Price enum some more.

This commit is contained in:
frosch
2009-11-08 12:23:02 +00:00
parent e781929d7f
commit 3f5e42b04a
6 changed files with 23 additions and 20 deletions

View File

@@ -435,7 +435,7 @@ static void ConvertTTDBasePrice(uint32 base_pointer, const char *error_location,
static const uint32 start = 0x4B34; ///< Position of first base price
static const uint32 size = 6; ///< Size of each base price record
if (base_pointer < start || (base_pointer - start) % size != 0 || (base_pointer - start) / size >= NUM_PRICES) {
if (base_pointer < start || (base_pointer - start) % size != 0 || (base_pointer - start) / size >= PR_END) {
grfmsg(1, "%s: Unsupported running cost base 0x%04X, ignoring", error_location, base_pointer);
return;
}
@@ -1668,8 +1668,8 @@ static ChangeInfoResult GlobalVarChangeInfo(uint gvid, int numinfo, int prop, by
byte factor = grf_load_byte(&buf);
uint price = gvid + i;
if (price < NUM_PRICES) {
SetPriceBaseMultiplier(price, factor);
if (price < PR_END) {
SetPriceBaseMultiplier((Price)price, factor);
} else {
grfmsg(1, "GlobalVarChangeInfo: Price %d out of range, ignoring", price);
}