Merge branch 'save_ext' into jgrpp
# Conflicts: # Makefile.src.in # findversion.sh # projects/determineversion.vbs # src/lang/dutch.txt # src/lang/korean.txt # src/network/network.cpp # src/network/network_client.cpp # src/rail.cpp # src/rail_cmd.cpp # src/saveload/afterload.cpp # src/ship_cmd.cpp # src/toolbar_gui.cpp # src/vehicle.cpp
This commit is contained in:
@@ -1741,8 +1741,11 @@ void CheckVehicleBreakdown(Vehicle *v)
|
||||
int rel, rel_old;
|
||||
|
||||
/* decrease reliability */
|
||||
v->reliability = rel = max((rel_old = v->reliability) - v->reliability_spd_dec, 0);
|
||||
if ((rel_old >> 8) != (rel >> 8)) SetWindowDirty(WC_VEHICLE_DETAILS, v->First()->index);
|
||||
if (!_settings_game.order.no_servicing_if_no_breakdowns ||
|
||||
_settings_game.difficulty.vehicle_breakdowns != 0) {
|
||||
v->reliability = rel = max((rel_old = v->reliability) - v->reliability_spd_dec, 0);
|
||||
if ((rel_old >> 8) != (rel >> 8)) SetWindowDirty(WC_VEHICLE_DETAILS, v->First()->index);
|
||||
}
|
||||
|
||||
if (v->breakdown_ctr != 0 || (v->First()->vehstatus & VS_STOPPED) ||
|
||||
_settings_game.difficulty.vehicle_breakdowns < 1 ||
|
||||
@@ -2117,6 +2120,8 @@ void VehicleEnterDepot(Vehicle *v)
|
||||
TriggerVehicle(v, VEHICLE_TRIGGER_DEPOT);
|
||||
v->MarkDirty();
|
||||
|
||||
InvalidateWindowData(WC_VEHICLE_VIEW, v->index);
|
||||
|
||||
if (v->current_order.IsType(OT_GOTO_DEPOT)) {
|
||||
SetWindowDirty(WC_VEHICLE_VIEW, v->index);
|
||||
|
||||
@@ -2400,7 +2405,10 @@ bool CanBuildVehicleInfrastructure(VehicleType type)
|
||||
|
||||
UnitID max;
|
||||
switch (type) {
|
||||
case VEH_TRAIN: max = _settings_game.vehicle.max_trains; break;
|
||||
case VEH_TRAIN:
|
||||
if (!HasAnyRailtypesAvail(_local_company)) return false;
|
||||
max = _settings_game.vehicle.max_trains;
|
||||
break;
|
||||
case VEH_ROAD: max = _settings_game.vehicle.max_roadveh; break;
|
||||
case VEH_SHIP: max = _settings_game.vehicle.max_ships; break;
|
||||
case VEH_AIRCRAFT: max = _settings_game.vehicle.max_aircraft; break;
|
||||
@@ -3209,8 +3217,10 @@ CommandCost Vehicle::SendToDepot(DoCommandFlag flags, DepotCommand command, Tile
|
||||
}
|
||||
SetWindowWidgetDirty(WC_VEHICLE_VIEW, this->index, WID_VV_START_STOP);
|
||||
|
||||
/* If there is no depot in front, reverse automatically (trains only) */
|
||||
if (this->type == VEH_TRAIN && reverse) DoCommand(this->tile, this->index, 0, DC_EXEC, CMD_REVERSE_TRAIN_DIRECTION);
|
||||
/* If there is no depot in front and the train is not already reversing, reverse automatically (trains only) */
|
||||
if (this->type == VEH_TRAIN && (reverse ^ HasBit(Train::From(this)->flags, VRF_REVERSING))) {
|
||||
DoCommand(this->tile, this->index, 0, DC_EXEC, CMD_REVERSE_TRAIN_DIRECTION);
|
||||
}
|
||||
|
||||
if (this->type == VEH_AIRCRAFT) {
|
||||
Aircraft *a = Aircraft::From(this);
|
||||
|
Reference in New Issue
Block a user