mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r1905) - Fix: [ 1118810 ] openttd: ship_cmd.c:642 ... Assertion failed. Mapwrap fixed in ship_cmd.c (was implicitely ok before biggermaps).
- CodeChange: rename all vehicle controllers to ...Controller for their similar behaviour
This commit is contained in:
parent
6805abe0f3
commit
1f66d60272
|
@ -821,7 +821,7 @@ static byte GetAircraftFlyingAltitude(const Vehicle *v)
|
|||
return maxz;
|
||||
}
|
||||
|
||||
static bool Aircraft_5(Vehicle *v)
|
||||
static bool AircraftController(Vehicle *v)
|
||||
{
|
||||
Station *st;
|
||||
const AirportMovingData *amd;
|
||||
|
@ -876,7 +876,7 @@ static bool Aircraft_5(Vehicle *v)
|
|||
if (amd->flag & AMED_HELI_LOWER) {
|
||||
if (UpdateAircraftSpeed(v)) {
|
||||
if (st->airport_tile == 0) {
|
||||
// FIXME - Aircraft_5 -> if station no longer exists, do not land
|
||||
// FIXME - AircraftController -> if station no longer exists, do not land
|
||||
// helicopter will circle until sign disappears, then go to next order
|
||||
// * what to do when it is the only order left, right now it just stays in 1 place
|
||||
v->u.air.state = FLYING;
|
||||
|
@ -988,8 +988,6 @@ static bool Aircraft_5(Vehicle *v)
|
|||
|
||||
if (amd->flag & AMED_LAND) {
|
||||
if (st->airport_tile == 0) {
|
||||
//FIXME -- FIXED - Aircraft_5 -> if station no longer exists, do not land
|
||||
// * what to do when it is the only order left, right now it just stays in 1 place?
|
||||
v->u.air.state = FLYING;
|
||||
AircraftNextAirportPos_and_Order(v);
|
||||
// get aircraft back on running altitude
|
||||
|
@ -1725,7 +1723,7 @@ static void AirportClearBlock(Vehicle *v, const AirportFTAClass *Airport)
|
|||
static void AirportGoToNextPosition(Vehicle *v, const AirportFTAClass *Airport)
|
||||
{
|
||||
// if aircraft is not in position, wait until it is
|
||||
if (!Aircraft_5(v)) {return;}
|
||||
if (!AircraftController(v)) {return;}
|
||||
|
||||
AirportClearBlock(v, Airport);
|
||||
AirportMove(v, Airport); // move aircraft to next position
|
||||
|
@ -2099,7 +2097,7 @@ void UpdateAirplanesOnNewStation(Station *st)
|
|||
v->u.air.pos = v->u.air.previous_pos = ap->entry_point;
|
||||
v->u.air.state = FLYING;
|
||||
// landing plane needs to be reset to flying height (only if in pause mode upgrade,
|
||||
// in normal mode, plane is reset in Aircraft_5. It doesn't hurt for FLYING
|
||||
// in normal mode, plane is reset in AircraftController. It doesn't hurt for FLYING
|
||||
GetNewVehiclePos(v, &gp);
|
||||
// set new position x,y,z
|
||||
SetAircraftPosition(v, gp.x, gp.y, GetAircraftFlyingAltitude(v));
|
||||
|
|
|
@ -1214,7 +1214,7 @@ static inline void ClearSlot(Vehicle *v, RoadStop *rs)
|
|||
rs->slot[v->u.road.slotindex] = INVALID_SLOT;
|
||||
}
|
||||
|
||||
static void RoadVehEventHandler(Vehicle *v)
|
||||
static void RoadVehController(Vehicle *v)
|
||||
{
|
||||
GetNewVehiclePosResult gp;
|
||||
byte new_dir, old_dir;
|
||||
|
@ -1592,7 +1592,7 @@ static void AgeRoadVehCargo(Vehicle *v)
|
|||
void RoadVeh_Tick(Vehicle *v)
|
||||
{
|
||||
AgeRoadVehCargo(v);
|
||||
RoadVehEventHandler(v);
|
||||
RoadVehController(v);
|
||||
}
|
||||
|
||||
static void CheckIfRoadVehNeedsService(Vehicle *v)
|
||||
|
|
|
@ -691,7 +691,6 @@ static const byte _ship_subcoord[4][6][3] = {
|
|||
}
|
||||
};
|
||||
|
||||
|
||||
static void ShipController(Vehicle *v)
|
||||
{
|
||||
GetNewVehiclePosResult gp;
|
||||
|
@ -779,7 +778,7 @@ static void ShipController(Vehicle *v)
|
|||
}
|
||||
} else {
|
||||
// new tile
|
||||
if (TileX(gp.new_tile) == MapMaxX() || TileY(gp.new_tile) == MapMaxY())
|
||||
if (TileX(gp.new_tile) >= MapMaxX() || TileY(gp.new_tile) >= MapMaxY())
|
||||
goto reverse_direction;
|
||||
|
||||
dir = ShipGetNewDirectionFromTiles(gp.new_tile, gp.old_tile);
|
||||
|
|
Loading…
Reference in New Issue