mirror of https://github.com/OpenTTD/OpenTTD
(svn r25977) [1.3] -Backport from trunk:
- Fix: [Script] Do not return ERR_UNKNOWN when trying to move an order to its current location [FS#5648] (r25612) - Fix: Various misreferences in AI and GS changelog [FS#5649] (r25607) - Fix: [Script] If a NewGRF returned station type that could not be built by an AI via callback 18, an unknown error would be thrown instead of falling back to the default station [FS#5641] (r25605) - Fix: Only the front engine's date of last service was updated [FS#5550] (r25604)release/1.3
parent
1c5ff9933f
commit
e57c544643
|
@ -80,7 +80,7 @@ public:
|
|||
virtual uint GetGlyphWidth(GlyphID key);
|
||||
virtual bool GetDrawGlyphShadow();
|
||||
virtual GlyphID MapCharToGlyph(WChar key) { assert(IsPrintable(key)); return SPRITE_GLYPH | key; }
|
||||
virtual const void *GetFontTable(uint32 tag, size_t &length) { printf("%p\n", &length); length = 0; return NULL; }
|
||||
virtual const void *GetFontTable(uint32 tag, size_t &length) { length = 0; return NULL; }
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -72,10 +72,10 @@
|
|||
* \li AIOrder::SetOrderRefit
|
||||
* \li AIRail::GetMaintenanceCostFactor
|
||||
* \li AIRoad::GetMaintenanceCostFactor
|
||||
* \li AITile::GetTownAuthority
|
||||
* \li AITown::GetCargoGoal
|
||||
* \li AITown::GetGrowthRate
|
||||
* \li AITown::GetLastMonthReceived
|
||||
* \li AITown::GetTownAuthority
|
||||
* \li AITownEffectList (to walk over all available town effects)
|
||||
* \li AIVehicle::ERR_VEHICLE_TOO_LONG in case vehicle length limit is reached
|
||||
* \li AIVehicle::GetMaximumOrderDistance
|
||||
|
@ -95,7 +95,7 @@
|
|||
* Other changes:
|
||||
* \li AITown::GetLastMonthProduction no longer has prerequisites based on town
|
||||
* effects.
|
||||
* \li AITown::GetLastMonthTransported no longer has prerequisites based on
|
||||
* \li AITown::GetLastMonthTransported resp. AITown::GetLastMonthSupplied no longer has prerequisites based on
|
||||
* town effects.
|
||||
* \li AITown::GetLastMonthTransportedPercentage no longer has prerequisites
|
||||
* based on town effects.
|
||||
|
|
|
@ -627,6 +627,7 @@ static void _DoCommandReturnSetOrderFlags(class ScriptInstance *instance)
|
|||
|
||||
EnforcePrecondition(false, IsValidVehicleOrder(vehicle_id, order_position_move));
|
||||
EnforcePrecondition(false, IsValidVehicleOrder(vehicle_id, order_position_target));
|
||||
EnforcePrecondition(false, order_position_move != order_position_target);
|
||||
|
||||
int order_pos_move = ScriptOrderPositionToRealOrderPosition(vehicle_id, order_position_move);
|
||||
int order_pos_target = ScriptOrderPositionToRealOrderPosition(vehicle_id, order_position_target);
|
||||
|
|
|
@ -524,6 +524,7 @@ public:
|
|||
* @param order_position_target The target order
|
||||
* @pre IsValidVehicleOrder(vehicle_id, order_position_move).
|
||||
* @pre IsValidVehicleOrder(vehicle_id, order_position_target).
|
||||
* @pre order_position_move != order_position_target.
|
||||
* @exception ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY
|
||||
* @return True if and only if the order was moved.
|
||||
* @note If the order is moved to a lower place (e.g. from 7 to 2)
|
||||
|
|
|
@ -186,10 +186,11 @@
|
|||
if (spec == NULL) {
|
||||
DEBUG(grf, 1, "%s returned an invalid station ID for 'AI construction/purchase selection (18)' callback", file->filename);
|
||||
} else {
|
||||
p2 |= spec->cls_id | index << 8;
|
||||
/* We might have gotten an usable station spec. Try to build it, but if it fails we'll fall back to the original station. */
|
||||
if (ScriptObject::DoCommand(tile, p1, p2 | spec->cls_id | index << 8, CMD_BUILD_RAIL_STATION)) return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return ScriptObject::DoCommand(tile, p1, p2, CMD_BUILD_RAIL_STATION);
|
||||
}
|
||||
|
||||
|
|
|
@ -87,14 +87,24 @@ bool Vehicle::NeedsAutorenewing(const Company *c, bool use_renew_setting) const
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Service a vehicle and all subsequent vehicles in the consist
|
||||
*
|
||||
* @param *v The vehicle or vehicle chain being serviced
|
||||
*/
|
||||
void VehicleServiceInDepot(Vehicle *v)
|
||||
{
|
||||
v->date_of_last_service = _date;
|
||||
v->breakdowns_since_last_service = 0;
|
||||
v->reliability = v->GetEngine()->reliability;
|
||||
/* Prevent vehicles from breaking down directly after exiting the depot. */
|
||||
v->breakdown_chance /= 4;
|
||||
assert(v != NULL);
|
||||
SetWindowDirty(WC_VEHICLE_DETAILS, v->index); // ensure that last service date and reliability are updated
|
||||
|
||||
do {
|
||||
v->date_of_last_service = _date;
|
||||
v->breakdowns_since_last_service = 0;
|
||||
v->reliability = v->GetEngine()->reliability;
|
||||
/* Prevent vehicles from breaking down directly after exiting the depot. */
|
||||
v->breakdown_chance /= 4;
|
||||
v = v->Next();
|
||||
} while (v != NULL && v->HasEngineType());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue