Changeset - r3634:eca83bf029a4
[Not reviewed]
master
0 1 0
peter1138 - 18 years ago 2006-04-23 10:50:09
peter1138@openttd.org
(svn r4539) - NewGRF: always check that the action 0x2 feature matches the action 0x1, not just on 'normal' sprite groups.
1 file changed with 8 insertions and 5 deletions:
0 comments (0 inline, 0 general)
newgrf.c
Show inline comments
 
@@ -1330,12 +1330,20 @@ static void NewSpriteGroup(byte *buf, in
 
		_cur_grffile->spritegroups = realloc(_cur_grffile->spritegroups, (setid + 1) * sizeof(*_cur_grffile->spritegroups));
 
		// Initialise new space to NULL
 
		for (; _cur_grffile->spritegroups_count < (setid + 1); _cur_grffile->spritegroups_count++)
 
			_cur_grffile->spritegroups[_cur_grffile->spritegroups_count] = NULL;
 
	}
 

	
 
	if (feature != _cur_grffile->spriteset_feature) {
 
		grfmsg(GMS_WARN, "NewSpriteGroup: sprite set feature 0x%02X does not match action feature 0x%02X, skipping.",
 
				_cur_grffile->spriteset_feature, feature);
 
		/* Clear this group's reference */
 
		_cur_grffile->spritegroups[setid] = NULL;
 
		return;
 
	}
 

	
 
	switch (type) {
 
		/* Deterministic Sprite Group */
 
		case 0x81: // Self scope, byte
 
		case 0x82: // Parent scope, byte
 
		{
 
			DeterministicSpriteGroup *dg;
 
@@ -1446,17 +1454,12 @@ static void NewSpriteGroup(byte *buf, in
 

	
 
			if (!_cur_grffile->spriteset_start) {
 
				grfmsg(GMS_ERROR, "NewSpriteGroup: No sprite set to work on! Skipping.");
 
				return;
 
			}
 

	
 
			if (_cur_grffile->spriteset_feature != feature) {
 
				grfmsg(GMS_ERROR, "NewSpriteGroup: Group feature 0x%02X doesn't match set feature 0x%X! Playing it risky and trying to use it anyway.", feature, _cur_grffile->spriteset_feature);
 
				// return; // XXX: we can't because of MB's newstats.grf --pasky
 
			}
 

	
 
			if (_cur_grffile->first_spriteset == 0)
 
				_cur_grffile->first_spriteset = _cur_grffile->spriteset_start;
 

	
 
			group = AllocateSpriteGroup();
 
			group->type = SGT_REAL;
 
			rg = &group->g.real;
0 comments (0 inline, 0 general)