(svn r3034) -NewGRF: Improve error checking of setting price bases.

This commit is contained in:
peter1138
2005-10-12 09:54:29 +00:00
parent 3fae53a61d
commit ec28f947aa
3 changed files with 11 additions and 6 deletions

View File

@@ -1070,8 +1070,13 @@ static bool GlobalVarChangeInfo(uint gvid, int numinfo, int prop, byte **bufp, i
case 0x08: { /* Cost base factor */
FOR_EACH_OBJECT {
byte factor = grf_load_byte(&buf);
uint price = gvid + i;
SetPriceBaseMultiplier(gvid + i, factor);
if (price < NUM_PRICES) {
SetPriceBaseMultiplier(price, factor);
} else {
grfmsg(GMS_WARN, "GlobalVarChangeInfo: Price %d out of range, ignoring.", price);
}
}
} break;
default: