mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-16 00:12:51 +00:00
(svn r22416) -Fix: When action14 specified different values for the palette, the values were OR-ed. Use the last set value instead.
This commit is contained in:
parent
6f9553404b
commit
27a2b53237
@ -6527,15 +6527,20 @@ static bool ChangeGRFPalette(size_t len, ByteReader *buf)
|
|||||||
buf->Skip(len);
|
buf->Skip(len);
|
||||||
} else {
|
} else {
|
||||||
char data = buf->ReadByte();
|
char data = buf->ReadByte();
|
||||||
|
GRFPalette pal = GRFP_GRF_UNSET;
|
||||||
switch (data) {
|
switch (data) {
|
||||||
case '*':
|
case '*':
|
||||||
case 'A': _cur_grfconfig->palette |= GRFP_GRF_ANY; break;
|
case 'A': pal = GRFP_GRF_ANY; break;
|
||||||
case 'W': _cur_grfconfig->palette |= GRFP_GRF_WINDOWS; break;
|
case 'W': pal = GRFP_GRF_WINDOWS; break;
|
||||||
case 'D': _cur_grfconfig->palette |= GRFP_GRF_DOS; break;
|
case 'D': pal = GRFP_GRF_DOS; break;
|
||||||
default:
|
default:
|
||||||
grfmsg(2, "StaticGRFInfo: unexpected value '%02x' for 'INFO'->'PALS', ignoring this field", data);
|
grfmsg(2, "StaticGRFInfo: unexpected value '%02x' for 'INFO'->'PALS', ignoring this field", data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (pal != GRFP_GRF_UNSET) {
|
||||||
|
_cur_grfconfig->palette &= ~GRFP_GRF_MASK;
|
||||||
|
_cur_grfconfig->palette |= pal;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user