diff options
author | rubidium <rubidium@openttd.org> | 2007-11-11 18:22:06 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-11-11 18:22:06 +0000 |
commit | 21c02fee879d8eb00255f0ebe3517bb9c90f39f5 (patch) | |
tree | 4038a60897194fb350a498e90f1b2c5e3d460dfc | |
parent | 9758a765125ff65930eb8ccf96657947b45a785c (diff) | |
download | openttd-21c02fee879d8eb00255f0ebe3517bb9c90f39f5.tar.xz |
(svn r11412) -Fix (r11403): animation was not turned on properly.
-Fix (r11410): wrong assumption about random reseeds made the whole thing reseed way too often, making the animation look very ugly.
-rw-r--r-- | src/industry_cmd.cpp | 8 | ||||
-rw-r--r-- | src/industry_map.h | 1 | ||||
-rw-r--r-- | src/newgrf_spritegroup.cpp | 2 |
3 files changed, 7 insertions, 4 deletions
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp index 6d08fde44..222c4530c 100644 --- a/src/industry_cmd.cpp +++ b/src/industry_cmd.cpp @@ -1437,8 +1437,9 @@ static void DoCreateNewIndustry(Industry *i, TileIndex tile, int type, const Ind i->owner = owner; r = Random(); - i->random_color = GB(r, 8, 4); - i->counter = GB(r, 0, 12); + i->random_color = GB(r, 0, 4); + i->counter = GB(r, 4, 12); + i->random = GB(r, 16, 16); i->produced_cargo_waiting[0] = 0; i->produced_cargo_waiting[1] = 0; i->incoming_cargo_waiting[0] = 0; @@ -1512,7 +1513,8 @@ static void DoCreateNewIndustry(Industry *i, TileIndex tile, int type, const Ind if (_generating_world) { SetIndustryConstructionCounter(cur_tile, 3); SetIndustryConstructionStage(cur_tile, 2); - } else if (it->gfx >= NEW_INDUSTRYTILEOFFSET) { + } + if (it->gfx >= NEW_INDUSTRYTILEOFFSET) { /* New industry */ const IndustryTileSpec *its = GetIndustryTileSpec(it->gfx); if (its->animation_info != 0xFFFF) AddAnimatedTile(cur_tile); diff --git a/src/industry_map.h b/src/industry_map.h index 3bfd45895..ea4579964 100644 --- a/src/industry_map.h +++ b/src/industry_map.h @@ -169,6 +169,7 @@ static inline void MakeIndustry(TileIndex t, IndustryID index, IndustryGfx gfx) _m[t].m3 = 0; _m[t].m4 = 0; SetIndustryGfx(t, gfx); + _me[t].m7 = Random(); } /** diff --git a/src/newgrf_spritegroup.cpp b/src/newgrf_spritegroup.cpp index 535e866b0..12131d604 100644 --- a/src/newgrf_spritegroup.cpp +++ b/src/newgrf_spritegroup.cpp @@ -252,7 +252,7 @@ static inline const SpriteGroup *ResolveRandom(const SpriteGroup *group, Resolve /* Handle triggers */ /* Magic code that may or may not do the right things... */ byte waiting_triggers = object->GetTriggers(object); - byte match = group->g.random.triggers & (waiting_triggers | object->trigger) || group->g.random.triggers == 0; + byte match = group->g.random.triggers & (waiting_triggers | object->trigger); bool res; res = (group->g.random.cmp_mode == RSG_CMP_ANY) ? |