Merge branch 'master' into jgrpp
# Conflicts: # src/company_cmd.cpp # src/core/overflowsafe_type.hpp # src/economy.cpp # src/engine_base.h # src/ground_vehicle.cpp # src/group_gui.cpp # src/industry_cmd.cpp # src/industry_gui.cpp # src/newgrf_commons.cpp # src/newgrf_engine.cpp # src/newgrf_industries.cpp # src/newgrf_object.cpp # src/newgrf_roadstop.cpp # src/newgrf_station.cpp # src/rail_gui.cpp # src/road_cmd.h # src/road_gui.cpp # src/saveload/afterload.cpp # src/script/api/script_log.cpp # src/script/api/script_log.hpp # src/settings_gui.cpp # src/settingsgen/settingsgen.cpp # src/station_cmd.cpp # src/station_cmd.h # src/station_gui.cpp # src/strgen/strgen.cpp # src/string_func.h # src/string_type.h # src/table/settings/network_private_settings.ini # src/tests/math_func.cpp # src/textfile_gui.cpp # src/timetable_gui.cpp # src/town_cmd.cpp # src/vehicle.cpp # src/waypoint_cmd.cpp # src/waypoint_cmd.h # src/widgets/dropdown.cpp
This commit is contained in:
@@ -253,7 +253,7 @@ static uint32 GetCountAndDistanceOfClosestInstance(uint32 local_id, uint32 grfid
|
||||
/* If the object type is invalid, there is none and the closest is far away. */
|
||||
if (idx >= NUM_OBJECTS) return 0 | 0xFFFF;
|
||||
|
||||
return Object::GetTypeCount(idx) << 16 | std::min(GetClosestObject(tile, idx, current), 0xFFFFu);
|
||||
return Object::GetTypeCount(idx) << 16 | ClampTo<uint16_t>(GetClosestObject(tile, idx, current));
|
||||
}
|
||||
|
||||
/** Used by the resolver to get values for feature 0F deterministic spritegroups. */
|
||||
@@ -334,7 +334,7 @@ static uint32 GetCountAndDistanceOfClosestInstance(uint32 local_id, uint32 grfid
|
||||
case 0x44: return GetTileOwner(this->tile);
|
||||
|
||||
/* Get town zone and Manhattan distance of closest town */
|
||||
case 0x45: return (t == nullptr) ? 0 : (GetTownRadiusGroup(t, this->tile) << 16 | std::min(DistanceManhattan(this->tile, t->xy), 0xFFFFu));
|
||||
case 0x45: return (t == nullptr) ? 0 : (GetTownRadiusGroup(t, this->tile) << 16 | ClampTo<uint16>(DistanceManhattan(this->tile, t->xy)));
|
||||
|
||||
/* Get square of Euclidian distance of closest town */
|
||||
case 0x46: return (t == nullptr) ? 0 : DistanceSquare(this->tile, t->xy);
|
||||
|
||||
Reference in New Issue
Block a user