mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-17 21:25:40 +00:00
(svn r10942) -Fix [FS#1133]: make the AI not crash when it has ships as the AI does not support them.
This commit is contained in:
parent
0fed821efb
commit
e56e520673
@ -241,14 +241,6 @@ static Money AiGetBasePrice(const Player* p)
|
|||||||
return base;
|
return base;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
static EngineID AiChooseShipToBuild(byte cargo, Money money)
|
|
||||||
{
|
|
||||||
// XXX: not done
|
|
||||||
return INVALID_ENGINE;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static EngineID AiChooseRoadVehToReplaceWith(const Player* p, const Vehicle* v)
|
static EngineID AiChooseRoadVehToReplaceWith(const Player* p, const Vehicle* v)
|
||||||
{
|
{
|
||||||
Money avail_money = p->player_money + v->value;
|
Money avail_money = p->player_money + v->value;
|
||||||
@ -279,9 +271,7 @@ static EngineID AiChooseTrainToReplaceWith(const Player* p, const Vehicle* v)
|
|||||||
|
|
||||||
static EngineID AiChooseShipToReplaceWith(const Player* p, const Vehicle* v)
|
static EngineID AiChooseShipToReplaceWith(const Player* p, const Vehicle* v)
|
||||||
{
|
{
|
||||||
error("!AiChooseShipToReplaceWith");
|
/* Ships are not implemented in this (broken) AI */
|
||||||
|
|
||||||
/* maybe useless, but avoids compiler warning this way */
|
|
||||||
return INVALID_ENGINE;
|
return INVALID_ENGINE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -402,7 +392,7 @@ static void AiHandleReplaceAircraft(Player *p)
|
|||||||
|
|
||||||
static void AiHandleReplaceShip(Player *p)
|
static void AiHandleReplaceShip(Player *p)
|
||||||
{
|
{
|
||||||
error("!AiHandleReplaceShip");
|
/* Ships are not implemented in this (broken) AI */
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef EngineID CheckReplaceProc(const Player* p, const Vehicle* v);
|
typedef EngineID CheckReplaceProc(const Player* p, const Vehicle* v);
|
||||||
@ -1550,12 +1540,6 @@ static void AiWantAircraftRoute(Player *p)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void AiWantShipRoute(Player *p)
|
|
||||||
{
|
|
||||||
// XXX
|
|
||||||
// error("AiWaitShipRoute");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void AiStateWantNewRoute(Player *p)
|
static void AiStateWantNewRoute(Player *p)
|
||||||
@ -1589,8 +1573,7 @@ static void AiStateWantNewRoute(Player *p)
|
|||||||
if (_patches.ai_disable_veh_aircraft) continue;
|
if (_patches.ai_disable_veh_aircraft) continue;
|
||||||
AiWantAircraftRoute(p);
|
AiWantAircraftRoute(p);
|
||||||
} else {
|
} else {
|
||||||
if (_patches.ai_disable_veh_ship) continue;
|
/* Ships are not implemented in this (broken) AI */
|
||||||
AiWantShipRoute(p);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// got a route?
|
// got a route?
|
||||||
@ -3565,20 +3548,17 @@ static void AiStateBuildAircraftVehicles(Player *p)
|
|||||||
|
|
||||||
static void AiStateCheckShipStuff(Player *p)
|
static void AiStateCheckShipStuff(Player *p)
|
||||||
{
|
{
|
||||||
// XXX
|
/* Ships are not implemented in this (broken) AI */
|
||||||
error("!AiStateCheckShipStuff");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void AiStateBuildDefaultShipBlocks(Player *p)
|
static void AiStateBuildDefaultShipBlocks(Player *p)
|
||||||
{
|
{
|
||||||
// XXX
|
/* Ships are not implemented in this (broken) AI */
|
||||||
error("!AiStateBuildDefaultShipBlocks");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void AiStateDoShipStuff(Player *p)
|
static void AiStateDoShipStuff(Player *p)
|
||||||
{
|
{
|
||||||
// XXX
|
/* Ships are not implemented in this (broken) AI */
|
||||||
error("!AiStateDoShipStuff");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void AiStateSellVeh(Player *p)
|
static void AiStateSellVeh(Player *p)
|
||||||
@ -3614,8 +3594,7 @@ static void AiStateSellVeh(Player *p)
|
|||||||
|
|
||||||
DoCommand(0, v->index, 0, DC_EXEC, CMD_SELL_AIRCRAFT);
|
DoCommand(0, v->index, 0, DC_EXEC, CMD_SELL_AIRCRAFT);
|
||||||
} else if (v->type == VEH_SHIP) {
|
} else if (v->type == VEH_SHIP) {
|
||||||
// XXX: not implemented
|
/* Ships are not implemented in this (broken) AI */
|
||||||
error("!v->type == VEH_SHIP");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user