diff options
author | frosch <frosch@openttd.org> | 2011-05-03 20:19:57 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2011-05-03 20:19:57 +0000 |
commit | dbfd156eb6df4648b05661beb152735ad05fb28e (patch) | |
tree | 9c570ff6cbf20e2cb7c340644ac3ca571c4f1140 | |
parent | 3c86fddf4ecd0cb194d10f73e36a0f6d6ff827d2 (diff) | |
download | openttd-dbfd156eb6df4648b05661beb152735ad05fb28e.tar.xz |
(svn r22416) -Fix: When action14 specified different values for the palette, the values were OR-ed. Use the last set value instead.
-rw-r--r-- | src/newgrf.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 85d9a7ef8..bf99651c1 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -6527,15 +6527,20 @@ static bool ChangeGRFPalette(size_t len, ByteReader *buf) buf->Skip(len); } else { char data = buf->ReadByte(); + GRFPalette pal = GRFP_GRF_UNSET; switch (data) { case '*': - case 'A': _cur_grfconfig->palette |= GRFP_GRF_ANY; break; - case 'W': _cur_grfconfig->palette |= GRFP_GRF_WINDOWS; break; - case 'D': _cur_grfconfig->palette |= GRFP_GRF_DOS; break; + case 'A': pal = GRFP_GRF_ANY; break; + case 'W': pal = GRFP_GRF_WINDOWS; break; + case 'D': pal = GRFP_GRF_DOS; break; default: grfmsg(2, "StaticGRFInfo: unexpected value '%02x' for 'INFO'->'PALS', ignoring this field", data); break; } + if (pal != GRFP_GRF_UNSET) { + _cur_grfconfig->palette &= ~GRFP_GRF_MASK; + _cur_grfconfig->palette |= pal; + } } return true; } |