summaryrefslogtreecommitdiff
path: root/src/ai
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2009-03-18 19:32:13 +0000
committerfrosch <frosch@openttd.org>2009-03-18 19:32:13 +0000
commit6dd04a9a7804e0d4cecb74dc88dab1fd8c8382a6 (patch)
tree5b3edf89230e9a4cf637194daab09e36914f83e4 /src/ai
parentea2c50281e34c8c0ade102552fc3d0f336496de9 (diff)
downloadopenttd-6dd04a9a7804e0d4cecb74dc88dab1fd8c8382a6.tar.xz
(svn r15763) -Codechange/Fix: Add Engine::GetDisplayDefaultCapacity() and use it everywhere, so CB 36 is also used everywhere.
Diffstat (limited to 'src/ai')
-rw-r--r--src/ai/api/ai_engine.cpp8
-rw-r--r--src/ai/api/ai_event_types.cpp9
2 files changed, 7 insertions, 10 deletions
diff --git a/src/ai/api/ai_engine.cpp b/src/ai/api/ai_engine.cpp
index 3948a406a..669c44ec5 100644
--- a/src/ai/api/ai_engine.cpp
+++ b/src/ai/api/ai_engine.cpp
@@ -6,9 +6,10 @@
#include "ai_cargo.hpp"
#include "../../company_func.h"
#include "../../strings_func.h"
-#include "../../aircraft.h"
#include "../../vehicle_func.h"
#include "../../settings_type.h"
+#include "../../rail.h"
+#include "../../engine_base.h"
#include "../../articulated_vehicles.h"
#include "table/strings.h"
@@ -77,11 +78,8 @@
} break;
case VEH_SHIP:
- return e->u.ship.capacity;
- break;
-
case VEH_AIRCRAFT:
- return AircraftDefaultCargoCapacity(e->GetDefaultCargoType(), &e->u.air);
+ return e->GetDisplayDefaultCapacity();
break;
default: NOT_REACHED();
diff --git a/src/ai/api/ai_event_types.cpp b/src/ai/api/ai_event_types.cpp
index 469d53776..f02cfc957 100644
--- a/src/ai/api/ai_event_types.cpp
+++ b/src/ai/api/ai_event_types.cpp
@@ -3,9 +3,11 @@
/** @file ai_event_types.cpp Implementation of all EventTypes. */
#include "ai_event_types.hpp"
+#include "../../command_type.h"
#include "../../strings_func.h"
#include "../../settings_type.h"
-#include "../../aircraft.h"
+#include "../../rail.h"
+#include "../../engine_base.h"
#include "../../articulated_vehicles.h"
#include "table/strings.h"
@@ -41,11 +43,8 @@ int32 AIEventEnginePreview::GetCapacity()
} break;
case VEH_SHIP:
- return e->u.ship.capacity;
- break;
-
case VEH_AIRCRAFT:
- return AircraftDefaultCargoCapacity(e->GetDefaultCargoType(), &e->u.air);
+ return e->GetDisplayDefaultCapacity();
break;
default: NOT_REACHED();