Merge remote-tracking branch 'upstream/1.11' into 1.11
This commit is contained in:
@@ -47,6 +47,8 @@
|
||||
#include "table/industry_land.h"
|
||||
#include "table/build_industry.h"
|
||||
|
||||
#include "citymania/cm_highlight.hpp"
|
||||
|
||||
#include "safeguards.h"
|
||||
|
||||
IndustryPool _industry_pool("Industry");
|
||||
@@ -199,6 +201,7 @@ Industry::~Industry()
|
||||
for (Station *st : this->stations_near) {
|
||||
st->industries_near.erase(this);
|
||||
}
|
||||
citymania::UpdateIndustryHighlight();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -569,8 +572,8 @@ static void AnimateTile_Industry(TileIndex tile)
|
||||
|
||||
if (_settings_client.sound.ambient) {
|
||||
switch (m & 7) {
|
||||
case 2: SndPlayTileFx(SND_2D_RIP_2, tile); break;
|
||||
case 6: SndPlayTileFx(SND_29_RIP, tile); break;
|
||||
case 2: SndPlayTileFx(SND_2D_SUGAR_MINE_1, tile); break;
|
||||
case 6: SndPlayTileFx(SND_29_SUGAR_MINE_2, tile); break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -589,7 +592,7 @@ static void AnimateTile_Industry(TileIndex tile)
|
||||
byte m = GetAnimationFrame(tile);
|
||||
|
||||
if (_industry_anim_offs_toffee[m] == 0xFF && _settings_client.sound.ambient) {
|
||||
SndPlayTileFx(SND_30_CARTOON_SOUND, tile);
|
||||
SndPlayTileFx(SND_30_TOFFEE_QUARRY, tile);
|
||||
}
|
||||
|
||||
if (++m >= 70) {
|
||||
@@ -635,9 +638,9 @@ static void AnimateTile_Industry(TileIndex tile)
|
||||
byte m = GetAnimationFrame(tile) + 1;
|
||||
|
||||
switch (m) {
|
||||
case 1: if (_settings_client.sound.ambient) SndPlayTileFx(SND_2C_MACHINERY, tile); break;
|
||||
case 23: if (_settings_client.sound.ambient) SndPlayTileFx(SND_2B_COMEDY_HIT, tile); break;
|
||||
case 28: if (_settings_client.sound.ambient) SndPlayTileFx(SND_2A_EXTRACT_AND_POP, tile); break;
|
||||
case 1: if (_settings_client.sound.ambient) SndPlayTileFx(SND_2C_TOY_FACTORY_1, tile); break;
|
||||
case 23: if (_settings_client.sound.ambient) SndPlayTileFx(SND_2B_TOY_FACTORY_2, tile); break;
|
||||
case 28: if (_settings_client.sound.ambient) SndPlayTileFx(SND_2A_TOY_FACTORY_3, tile); break;
|
||||
default:
|
||||
if (m >= 50) {
|
||||
int n = GetIndustryAnimationLoop(tile) + 1;
|
||||
@@ -700,7 +703,7 @@ static void AnimateTile_Industry(TileIndex tile)
|
||||
byte m = GetAnimationFrame(tile);
|
||||
if (!(m & 0x40)) {
|
||||
SetAnimationFrame(tile, m | 0x40);
|
||||
if (_settings_client.sound.ambient) SndPlayTileFx(SND_0B_MINING_MACHINERY, tile);
|
||||
if (_settings_client.sound.ambient) SndPlayTileFx(SND_0B_MINE, tile);
|
||||
}
|
||||
if (state & 7) return;
|
||||
} else {
|
||||
@@ -801,7 +804,7 @@ static void TileLoopIndustry_BubbleGenerator(TileIndex tile)
|
||||
{ 49, 59, 60, 65 },
|
||||
};
|
||||
|
||||
if (_settings_client.sound.ambient) SndPlayTileFx(SND_2E_EXTRACT_AND_POP, tile);
|
||||
if (_settings_client.sound.ambient) SndPlayTileFx(SND_2E_BUBBLE_GENERATOR, tile);
|
||||
|
||||
int dir = Random() & 3;
|
||||
|
||||
@@ -899,7 +902,7 @@ static void TileLoop_Industry(TileIndex tile)
|
||||
|
||||
case GFX_POWERPLANT_SPARKS:
|
||||
if (Chance16(1, 3)) {
|
||||
if (_settings_client.sound.ambient) SndPlayTileFx(SND_0C_ELECTRIC_SPARK, tile);
|
||||
if (_settings_client.sound.ambient) SndPlayTileFx(SND_0C_POWER_STATION, tile);
|
||||
AddAnimatedTile(tile);
|
||||
}
|
||||
break;
|
||||
@@ -1098,7 +1101,7 @@ static bool SearchLumberMillTrees(TileIndex tile, void *user_data)
|
||||
|
||||
_industry_sound_ctr = 1;
|
||||
_industry_sound_tile = tile;
|
||||
if (_settings_client.sound.ambient) SndPlayTileFx(SND_38_CHAINSAW, tile);
|
||||
if (_settings_client.sound.ambient) SndPlayTileFx(SND_38_LUMBER_MILL_1, tile);
|
||||
|
||||
DoCommand(tile, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR);
|
||||
|
||||
@@ -1200,10 +1203,10 @@ void OnTick_Industry()
|
||||
_industry_sound_ctr++;
|
||||
|
||||
if (_industry_sound_ctr == 75) {
|
||||
if (_settings_client.sound.ambient) SndPlayTileFx(SND_37_BALLOON_SQUEAK, _industry_sound_tile);
|
||||
if (_settings_client.sound.ambient) SndPlayTileFx(SND_37_LUMBER_MILL_2, _industry_sound_tile);
|
||||
} else if (_industry_sound_ctr == 160) {
|
||||
_industry_sound_ctr = 0;
|
||||
if (_settings_client.sound.ambient) SndPlayTileFx(SND_36_CARTOON_CRASH, _industry_sound_tile);
|
||||
if (_settings_client.sound.ambient) SndPlayTileFx(SND_36_LUMBER_MILL_3, _industry_sound_tile);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1905,6 +1908,7 @@ static void DoCreateNewIndustry(Industry *i, TileIndex tile, IndustryType type,
|
||||
InvalidateWindowData(WC_INDUSTRY_DIRECTORY, 0, IDIWD_FORCE_REBUILD);
|
||||
|
||||
if (!_generating_world) PopulateStationsNearby(i);
|
||||
citymania::UpdateIndustryHighlight();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user