Changeset - r17906:b068a0f5f28a
[Not reviewed]
master
0 1 0
frosch - 13 years ago 2011-08-06 10:47:37
frosch@openttd.org
(svn r22721) -Fix (r22518): Conditionally hiding a sprite caused subsequent items of the spritelayout to use wrong registers.
1 file changed with 3 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/newgrf_commons.cpp
Show inline comments
 
@@ -647,8 +647,7 @@ void NewGRFSpriteLayout::ProcessRegister
 
				/* Apply registers */
 
				if ((flags & TLF_DODRAW) && GetRegister(regs->dodraw) == 0) {
 
					result->image.sprite = 0;
 
					continue;
 
				}
 
				} else {
 
				if (HasBit(result->image.sprite, SPRITE_MODIFIER_CUSTOM_SPRITE)) result->image.sprite += resolved_sprite;
 
				if (flags & TLF_SPRITE) result->image.sprite += (int16)GetRegister(regs->sprite); // mask to 16 bits to avoid trouble
 

	
 
@@ -664,9 +663,10 @@ void NewGRFSpriteLayout::ProcessRegister
 
				}
 
			}
 
		}
 
		}
 

	
 
		/* Is the palette affected by an action-1-2-3 chain? */
 
		if (HasBit(result->image.pal, SPRITE_MODIFIER_CUSTOM_SPRITE) || (flags & TLF_PALETTE_REG_FLAGS)) {
 
		if (result->image.sprite != 0 && (HasBit(result->image.pal, SPRITE_MODIFIER_CUSTOM_SPRITE) || (flags & TLF_PALETTE_REG_FLAGS))) {
 
			/* Does the var10 value apply to this sprite? */
 
			uint8 var10 = (flags & TLF_PALETTE_VAR10) ? regs->palette_var10 : (ground && separate_ground ? 1 : 0);
 
			if (var10 == resolved_var10) {
0 comments (0 inline, 0 general)