summaryrefslogtreecommitdiff
path: root/src/ai/default
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-08-19 16:51:15 +0000
committerrubidium <rubidium@openttd.org>2007-08-19 16:51:15 +0000
commitdc454841fd7bce436a1ba152f216ee7fced0dded (patch)
tree3f46b4c931ec639dbba56fee8815e95c1f11b9e5 /src/ai/default
parent4ef6e75609e46026df3e5ecccc6bbd167c2b7192 (diff)
downloadopenttd-dc454841fd7bce436a1ba152f216ee7fced0dded.tar.xz
(svn r10942) -Fix [FS#1133]: make the AI not crash when it has ships as the AI does not support them.
Diffstat (limited to 'src/ai/default')
-rw-r--r--src/ai/default/default.cpp37
1 files changed, 8 insertions, 29 deletions
diff --git a/src/ai/default/default.cpp b/src/ai/default/default.cpp
index 35cdc29c8..24755a281 100644
--- a/src/ai/default/default.cpp
+++ b/src/ai/default/default.cpp
@@ -241,14 +241,6 @@ static Money AiGetBasePrice(const Player* p)
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)
{
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)
{
- error("!AiChooseShipToReplaceWith");
-
- /* maybe useless, but avoids compiler warning this way */
+ /* Ships are not implemented in this (broken) AI */
return INVALID_ENGINE;
}
@@ -402,7 +392,7 @@ static void AiHandleReplaceAircraft(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);
@@ -1550,12 +1540,6 @@ static void AiWantAircraftRoute(Player *p)
}
}
-static void AiWantShipRoute(Player *p)
-{
- // XXX
-// error("AiWaitShipRoute");
-}
-
static void AiStateWantNewRoute(Player *p)
@@ -1589,8 +1573,7 @@ static void AiStateWantNewRoute(Player *p)
if (_patches.ai_disable_veh_aircraft) continue;
AiWantAircraftRoute(p);
} else {
- if (_patches.ai_disable_veh_ship) continue;
- AiWantShipRoute(p);
+ /* Ships are not implemented in this (broken) AI */
}
// got a route?
@@ -3565,20 +3548,17 @@ static void AiStateBuildAircraftVehicles(Player *p)
static void AiStateCheckShipStuff(Player *p)
{
- // XXX
- error("!AiStateCheckShipStuff");
+ /* Ships are not implemented in this (broken) AI */
}
static void AiStateBuildDefaultShipBlocks(Player *p)
{
- // XXX
- error("!AiStateBuildDefaultShipBlocks");
+ /* Ships are not implemented in this (broken) AI */
}
static void AiStateDoShipStuff(Player *p)
{
- // XXX
- error("!AiStateDoShipStuff");
+ /* Ships are not implemented in this (broken) AI */
}
static void AiStateSellVeh(Player *p)
@@ -3613,9 +3593,8 @@ static void AiStateSellVeh(Player *p)
}
DoCommand(0, v->index, 0, DC_EXEC, CMD_SELL_AIRCRAFT);
- } else if (v->type == VEH_SHIP) {
- // XXX: not implemented
- error("!v->type == VEH_SHIP");
+ } else if (v->type == VEH_SHIP) {
+ /* Ships are not implemented in this (broken) AI */
}
}