mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-27 14:14:27 +01:00
(svn r22224) [1.1] -Backport from trunk:
- Fix: Compilation when compiling with --disable-ai (r22222) - Fix: When downloading a file via HTTP failed mid-way and OpenTTD fell back to the old system the partial downloaded amount would be counted twice [FS#4543] (r22208) - Fix: The 'center' (for movement) of vehicles is (currently still) always at 4/8th original vehicle length from the front, so trains should stop at the same location regardless of the length of the front engine [FS#4545] (r22206) - Fix: Make the base costs for building and demolishing NewObjects also local to the individual NewGRFs (r22204) - Fix: Removing a station order could stop when removing first automatic order (r22200) - Fix: Invalidate the object build window when using the date cheat (r22193)
This commit is contained in:
@@ -100,7 +100,7 @@ int RoadVehicle::GetDisplayImageWidth(Point *offset) const
|
||||
offset->x = reference_width / 2;
|
||||
offset->y = 0;
|
||||
}
|
||||
return this->gcache.cached_veh_length * reference_width / 8;
|
||||
return this->gcache.cached_veh_length * reference_width / VEHICLE_LENGTH;
|
||||
}
|
||||
|
||||
static SpriteID GetRoadVehIcon(EngineID engine)
|
||||
@@ -161,11 +161,11 @@ void DrawRoadVehEngine(int left, int right, int preferred_x, int y, EngineID eng
|
||||
*/
|
||||
static uint GetRoadVehLength(const RoadVehicle *v)
|
||||
{
|
||||
uint length = 8;
|
||||
uint length = VEHICLE_LENGTH;
|
||||
|
||||
uint16 veh_len = GetVehicleCallback(CBID_VEHICLE_LENGTH, 0, 0, v->engine_type, v);
|
||||
if (veh_len != CALLBACK_FAILED) {
|
||||
length -= Clamp(veh_len, 0, 7);
|
||||
length -= Clamp(veh_len, 0, VEHICLE_LENGTH - 1);
|
||||
}
|
||||
|
||||
return length;
|
||||
@@ -262,7 +262,7 @@ CommandCost CmdBuildRoadVehicle(TileIndex tile, DoCommandFlag flags, const Engin
|
||||
|
||||
v->roadtype = HasBit(e->info.misc_flags, EF_ROAD_TRAM) ? ROADTYPE_TRAM : ROADTYPE_ROAD;
|
||||
v->compatible_roadtypes = RoadTypeToRoadTypes(v->roadtype);
|
||||
v->gcache.cached_veh_length = 8;
|
||||
v->gcache.cached_veh_length = VEHICLE_LENGTH;
|
||||
|
||||
if (e->flags & ENGINE_EXCLUSIVE_PREVIEW) SetBit(v->vehicle_flags, VF_BUILT_AS_PROTOTYPE);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user