summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2007-11-22 22:37:06 +0000
committerglx <glx@openttd.org>2007-11-22 22:37:06 +0000
commitb78801fa335bcea4ad64e2318dfd5e35c4f59d86 (patch)
tree0f4fd8f46328cd5366e736a6d2bf88b92fefe209 /src
parent11889b6da1f75ba819b53dcbf37f34a4069e88a0 (diff)
downloadopenttd-b78801fa335bcea4ad64e2318dfd5e35c4f59d86.tar.xz
(svn r11494) -Fix [FS#1461] (r11450): cargo translation table was now loaded too late ;)
Diffstat (limited to 'src')
-rw-r--r--src/newgrf.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index 9411649d3..65590d870 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -2103,7 +2103,7 @@ static void FeatureChangeInfo(byte *buf, int len)
/* GSF_CANAL */ NULL,
/* GSF_BRIDGE */ BridgeChangeInfo,
/* GSF_TOWNHOUSE */ TownHouseChangeInfo,
- /* GSF_GLOBALVAR */ GlobalVarChangeInfo,
+ /* GSF_GLOBALVAR */ NULL, /* Global variables are handled during reservation */
/* GSF_INDUSTRYTILES */IndustrytilesChangeInfo,
/* GSF_INDUSTRIES */ IndustriesChangeInfo,
/* GSF_CARGOS */ NULL, /* Cargo is handled during reservation */
@@ -2227,7 +2227,7 @@ static void ReserveChangeInfo(byte *buf, int len)
buf++;
uint8 feature = grf_load_byte(&buf);
- if (feature != GSF_CARGOS) return;
+ if (feature != GSF_CARGOS && feature != GSF_GLOBALVAR) return;
uint8 numprops = grf_load_byte(&buf);
uint8 numinfo = grf_load_byte(&buf);
@@ -2235,10 +2235,19 @@ static void ReserveChangeInfo(byte *buf, int len)
while (numprops-- && buf < bufend) {
uint8 prop = grf_load_byte(&buf);
+ bool ignoring = false;
- if (CargoChangeInfo(index, numinfo, prop, &buf, bufend - buf)) {
- grfmsg(2, "ReserveChangeInfo: Ignoring property 0x%02X (not implemented)", prop);
+ switch (feature) {
+ default: NOT_REACHED();
+ case GSF_CARGOS:
+ ignoring = CargoChangeInfo(index, numinfo, prop, &buf, bufend - buf);
+ break;
+ case GSF_GLOBALVAR:
+ ignoring = GlobalVarChangeInfo(index, numinfo, prop, &buf, bufend - buf);
+ break;
}
+
+ if (ignoring) grfmsg(2, "ReserveChangeInfo: Ignoring property 0x%02X (not implemented)", prop);
}
}