diff options
author | peter1138 <peter1138@openttd.org> | 2005-10-12 09:54:29 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2005-10-12 09:54:29 +0000 |
commit | ec28f947aa3d7ac94a1cfeb6d86c15c81252ee03 (patch) | |
tree | f5a7c1c6a6479ae68b002a2fc606e9aff5153826 /newgrf.c | |
parent | 3fae53a61d9b17f91f7f3bc1665f3c920952708f (diff) | |
download | openttd-ec28f947aa3d7ac94a1cfeb6d86c15c81252ee03.tar.xz |
(svn r3034) -NewGRF: Improve error checking of setting price bases.
Diffstat (limited to 'newgrf.c')
-rw-r--r-- | newgrf.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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: |