summaryrefslogtreecommitdiff
path: root/industry_cmd.c
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2006-04-15 01:06:53 +0000
committerbelugas <belugas@openttd.org>2006-04-15 01:06:53 +0000
commitea706f8eade49a6dd61be942ba6d16e7847ccbeb (patch)
tree9f5582fd2da07ef84be1070e505d2b9bd98bbf03 /industry_cmd.c
parent504f88902e99187d28748efbf19b1e92b5c8852f (diff)
downloadopenttd-ea706f8eade49a6dd61be942ba6d16e7847ccbeb.tar.xz
(svn r4425) Fix bug introduced in r4411 : while IS_BYTE_INSIDE, max value is STRICKLY LESS THEN. This caused airports animations to stay unanimated. Industries were similarly affected.
Thanks to Richk67 for finding it. Also, more Gfx define and use.
Diffstat (limited to 'industry_cmd.c')
-rw-r--r--industry_cmd.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/industry_cmd.c b/industry_cmd.c
index 04a11f398..c84248abe 100644
--- a/industry_cmd.c
+++ b/industry_cmd.c
@@ -271,7 +271,7 @@ IndustryType GetIndustryType(TileIndex tile)
for (iloop = IT_COAL_MINE; iloop < IT_END; iloop += 1) {
if (IS_BYTE_INSIDE(this_type, industry_gfx_Solver[iloop].MinGfx,
- industry_gfx_Solver[iloop].MaxGfx)) {
+ industry_gfx_Solver[iloop].MaxGfx+1)) {
return iloop;
}
}
@@ -633,15 +633,17 @@ static void AnimateTile_Industry(TileIndex tile)
}
break;
- case 30: case 31: case 32:
+ case GFX_OILWELL_ANIM1:
+ case GFX_OILWELL_ANIM2:
+ case GFX_OILWELL_ANIM3:
if ((_tick_counter & 7) == 0) {
bool b = CHANCE16(1,7);
IndustryGfx gfx = GetIndustryGfx(tile);
m = GB(_m[tile].m1, 0, 2) + 1;
- if (m == 4 && (m = 0, ++gfx) == 32 + 1 && (gfx = 30, b)) {
+ if (m == 4 && (m = 0, ++gfx) == GFX_OILWELL_ANIM3 + 1 && (gfx = GFX_OILWELL_ANIM1, b)) {
_m[tile].m1 = 0x83;
- SetIndustryGfx(tile, 29);
+ SetIndustryGfx(tile, GFX_OILWELL_BASE);
DeleteAnimatedTile(tile);
} else {
SB(_m[tile].m1, 0, 2, m);