Changeset - r13965:4f31e407337a
[Not reviewed]
master
0 1 0
rubidium - 15 years ago 2009-12-16 00:06:51
rubidium@openttd.org
(svn r18513) -Fix [FS#3379]: sometimes NewGRFs throw invalid data at OpenTTD and that triggered a check... that if a has to be between b and c (inclusive) then c must be bigger than or equal to b (and definitely not smaller)
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/newgrf_industrytiles.cpp
Show inline comments
 
@@ -253,10 +253,10 @@ bool DrawNewIndustryTile(TileInfo *ti, I
 
	NewIndustryTileResolver(&object, gfx, ti->tile, i);
 

	
 
	group = SpriteGroup::Resolve(inds->grf_prop.spritegroup, &object);
 
	if (group == NULL || group->type != SGT_TILELAYOUT) {
 
	const TileLayoutSpriteGroup *tlgroup = (const TileLayoutSpriteGroup *)group;
 
	if (group == NULL || group->type != SGT_TILELAYOUT || tlgroup->num_sprites == 0) {
 
		return false;
 
	} else {
 
		const TileLayoutSpriteGroup *tlgroup = (const TileLayoutSpriteGroup *)group;
 
		/* Limit the building stage to the number of stages supplied. */
 
		byte stage = GetIndustryConstructionStage(ti->tile);
 
		stage = Clamp(stage - 4 + tlgroup->num_sprites, 0, tlgroup->num_sprites - 1);
0 comments (0 inline, 0 general)