mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2026-07-24 03:56:43 +00:00
Add: Setting to disable aircraft range limit (#15433)
This commit is contained in:
@@ -50,6 +50,8 @@
|
||||
#include "void_map.h"
|
||||
#include "station_func.h"
|
||||
#include "station_base.h"
|
||||
#include "aircraft.h"
|
||||
#include "aircraft_cmd.h"
|
||||
|
||||
#include "table/strings.h"
|
||||
#include "table/settings.h"
|
||||
@@ -364,6 +366,24 @@ static void RoadVehSlopeSteepnessChanged(int32_t)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function updates the aircraft cache when the aircraft range setting is changed.
|
||||
*/
|
||||
static void AircraftRangeChanged(int32_t)
|
||||
{
|
||||
for (Aircraft *v : Aircraft::Iterate()) {
|
||||
v->acache.cached_max_range = Engine::Get(v->engine_type)->GetRange();
|
||||
v->acache.cached_max_range_sqr = v->acache.cached_max_range * v->acache.cached_max_range;
|
||||
|
||||
/* Reset destination is too far state */
|
||||
if (v->flags.Test(VehicleAirFlag::DestinationTooFar)) {
|
||||
v->flags.Reset(VehicleAirFlag::DestinationTooFar);
|
||||
SetWindowWidgetDirty(WC_VEHICLE_VIEW, v->index, WID_VV_START_STOP);
|
||||
DeleteVehicleNews(v->index, AdviceType::AircraftDestinationTooFar);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void TownFoundingChanged(int32_t)
|
||||
{
|
||||
if (_game_mode != GM_EDITOR && _settings_game.economy.found_town == TF_FORBIDDEN) {
|
||||
|
||||
Reference in New Issue
Block a user