diff options
author | rubidium <rubidium@openttd.org> | 2007-07-09 20:08:25 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-07-09 20:08:25 +0000 |
commit | e84363b4db136be876606450ea35d4186fe0eae6 (patch) | |
tree | 12fc144dcff919b030af8acc977d785bd29ebf48 /src/newgrf_industrytiles.cpp | |
parent | 7cb7488836eb11b8da5ec9481b4bd32156716793 (diff) | |
download | openttd-e84363b4db136be876606450ea35d4186fe0eae6.tar.xz |
(svn r10494) -Fix (r10490): possible null dereference in some exotic newgrfs.
Diffstat (limited to 'src/newgrf_industrytiles.cpp')
-rw-r--r-- | src/newgrf_industrytiles.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/newgrf_industrytiles.cpp b/src/newgrf_industrytiles.cpp index 75e61f6ba..77993eafa 100644 --- a/src/newgrf_industrytiles.cpp +++ b/src/newgrf_industrytiles.cpp @@ -229,9 +229,13 @@ bool DrawNewIndustryTile(TileInfo *ti, Industry *i, IndustryGfx gfx, const Indus } } -bool PerformIndustryTileSlopeCheck(TileIndex tile, const IndustryTileSpec *its, IndustryGfx gfx) +bool PerformIndustryTileSlopeCheck(TileIndex tile, const IndustryTileSpec *its, IndustryType type, IndustryGfx gfx) { - uint16 callback_res = GetIndustryTileCallback(CBID_INDTILE_SHAPE_CHECK, 0, 0, gfx, NULL, tile); + Industry ind; + ind.xy = 0; + ind.type = type; + + uint16 callback_res = GetIndustryTileCallback(CBID_INDTILE_SHAPE_CHECK, 0, 0, gfx, &ind, tile); if (its->grf_prop.grffile->grf_version < 7) { return callback_res != 0; } |