Merge branch 'master' into jgrpp
# Conflicts: # src/core/smallmap_type.hpp # src/lang/korean.txt # src/network/network_content.cpp # src/smallmap_gui.cpp # src/station_cmd.cpp
This commit is contained in:
@@ -130,8 +130,8 @@
|
||||
|
||||
/* static */ int ScriptAirport::GetNoiseLevelIncrease(TileIndex tile, AirportType type)
|
||||
{
|
||||
extern Town *AirportGetNearestTown(const AirportSpec *as, const TileIterator &it);
|
||||
extern uint8 GetAirportNoiseLevelForTown(const AirportSpec *as, TileIterator &it, TileIndex town_tile);
|
||||
extern Town *AirportGetNearestTown(const AirportSpec *as, const TileIterator &it, uint &mindist);
|
||||
extern uint8 GetAirportNoiseLevelForDistance(const AirportSpec *as, uint distance);
|
||||
|
||||
if (!::IsValidTile(tile)) return -1;
|
||||
if (!IsAirportInformationAvailable(type)) return -1;
|
||||
@@ -139,8 +139,9 @@
|
||||
if (_settings_game.economy.station_noise_level) {
|
||||
const AirportSpec *as = ::AirportSpec::Get(type);
|
||||
AirportTileTableIterator it(as->table[0], tile);
|
||||
const Town *t = AirportGetNearestTown(as, it);
|
||||
return GetAirportNoiseLevelForTown(as, it, t->xy);
|
||||
uint dist;
|
||||
AirportGetNearestTown(as, it, dist);
|
||||
return GetAirportNoiseLevelForDistance(as, dist);
|
||||
}
|
||||
|
||||
return 1;
|
||||
@@ -148,13 +149,14 @@
|
||||
|
||||
/* static */ TownID ScriptAirport::GetNearestTown(TileIndex tile, AirportType type)
|
||||
{
|
||||
extern Town *AirportGetNearestTown(const AirportSpec *as, const TileIterator &it);
|
||||
extern Town *AirportGetNearestTown(const AirportSpec *as, const TileIterator &it, uint &mindist);
|
||||
|
||||
if (!::IsValidTile(tile)) return INVALID_TOWN;
|
||||
if (!IsAirportInformationAvailable(type)) return INVALID_TOWN;
|
||||
|
||||
const AirportSpec *as = AirportSpec::Get(type);
|
||||
return AirportGetNearestTown(as, AirportTileTableIterator(as->table[0], tile))->index;
|
||||
uint dist;
|
||||
return AirportGetNearestTown(as, AirportTileTableIterator(as->table[0], tile), dist)->index;
|
||||
}
|
||||
|
||||
/* static */ uint16 ScriptAirport::GetMaintenanceCostFactor(AirportType type)
|
||||
|
@@ -245,7 +245,7 @@ static int32 LookupWithBuildOnSlopes(::Slope slope, Array *existing, int32 start
|
||||
|
||||
/* Now perform the actual rotation. */
|
||||
for (int j = 0; j < base_rotate; j++) {
|
||||
for (int i = 0; i < existing->size; i++) {
|
||||
for (size_t i = 0; i < existing->size; i++) {
|
||||
existing->array[i] = RotateNeighbour(existing->array[i]);
|
||||
}
|
||||
start = RotateNeighbour(start);
|
||||
@@ -256,7 +256,7 @@ static int32 LookupWithBuildOnSlopes(::Slope slope, Array *existing, int32 start
|
||||
RoadBits start_roadbits = NeighbourToRoadBits(start);
|
||||
RoadBits new_roadbits = start_roadbits | NeighbourToRoadBits(end);
|
||||
RoadBits existing_roadbits = ROAD_NONE;
|
||||
for (int i = 0; i < existing->size; i++) {
|
||||
for (size_t i = 0; i < existing->size; i++) {
|
||||
existing_roadbits |= NeighbourToRoadBits(existing->array[i]);
|
||||
}
|
||||
|
||||
@@ -354,7 +354,7 @@ static bool NormaliseTileOffset(int32 *tile)
|
||||
/* The start tile and end tile cannot be the same tile either. */
|
||||
if (start == end) return -1;
|
||||
|
||||
for (int i = 0; i < existing->size; i++) {
|
||||
for (size_t i = 0; i < existing->size; i++) {
|
||||
if (!NormaliseTileOffset(&existing->array[i])) return -1;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user