mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-04 13:23:46 +00:00
(svn r18923) -Fix [FS#3565]: Check source stationspec exists before copying layouts.
This commit is contained in:
parent
4df90cddee
commit
cd6eac77c3
@ -1193,6 +1193,11 @@ static ChangeInfoResult StationChangeInfo(uint stid, int numinfo, int prop, Byte
|
|||||||
byte srcid = buf->ReadByte();
|
byte srcid = buf->ReadByte();
|
||||||
const StationSpec *srcstatspec = _cur_grffile->stations[srcid];
|
const StationSpec *srcstatspec = _cur_grffile->stations[srcid];
|
||||||
|
|
||||||
|
if (srcstatspec == NULL) {
|
||||||
|
grfmsg(1, "StationChangeInfo: Station %u is not defined, cannot copy sprite layout to %u.", srcid, stid + i);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
statspec->tiles = srcstatspec->tiles;
|
statspec->tiles = srcstatspec->tiles;
|
||||||
statspec->renderdata = srcstatspec->renderdata;
|
statspec->renderdata = srcstatspec->renderdata;
|
||||||
statspec->copied_renderdata = true;
|
statspec->copied_renderdata = true;
|
||||||
@ -1266,6 +1271,11 @@ static ChangeInfoResult StationChangeInfo(uint stid, int numinfo, int prop, Byte
|
|||||||
byte srcid = buf->ReadByte();
|
byte srcid = buf->ReadByte();
|
||||||
const StationSpec *srcstatspec = _cur_grffile->stations[srcid];
|
const StationSpec *srcstatspec = _cur_grffile->stations[srcid];
|
||||||
|
|
||||||
|
if (srcstatspec == NULL) {
|
||||||
|
grfmsg(1, "StationChangeInfo: Station %u is not defined, cannot copy tile layout to %u.", srcid, stid + i);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
statspec->lengths = srcstatspec->lengths;
|
statspec->lengths = srcstatspec->lengths;
|
||||||
statspec->platforms = srcstatspec->platforms;
|
statspec->platforms = srcstatspec->platforms;
|
||||||
statspec->layouts = srcstatspec->layouts;
|
statspec->layouts = srcstatspec->layouts;
|
||||||
|
Loading…
Reference in New Issue
Block a user