Mercurial > hg > openttd
changeset 14366:be9a32dedb76 draft
(svn r18923) -Fix [FS#3565]: Check source stationspec exists before copying layouts.
author | peter1138 <peter1138@openttd.org> |
---|---|
date | Wed, 27 Jan 2010 10:17:09 +0000 |
parents | 476512b9eefc |
children | de46f55c4e38 |
files | src/newgrf.cpp |
diffstat | 1 files changed, 10 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -1193,6 +1193,11 @@ byte srcid = buf->ReadByte(); 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->renderdata = srcstatspec->renderdata; statspec->copied_renderdata = true; @@ -1266,6 +1271,11 @@ byte srcid = buf->ReadByte(); 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->platforms = srcstatspec->platforms; statspec->layouts = srcstatspec->layouts;