--- a/src/ai/api/ai_engine.cpp Tue Apr 15 22:18:11 2008 +0000
+++ b/src/ai/api/ai_engine.cpp Tue Apr 15 22:29:00 2008 +0000
@@ -38,7 +38,7 @@
/* static */ CargoID AIEngine::GetCargoType(EngineID engine_id)
{
- if (!IsValidEngine(engine_id)) return 0;
+ if (!IsValidEngine(engine_id)) return -1;
switch (::GetEngine(engine_id)->type) {
case VEH_ROAD: {
@@ -74,9 +74,9 @@
return ::CanRefitTo(engine_id, cargo_id);
}
-/* static */ uint32 AIEngine::GetCapacity(EngineID engine_id)
+/* static */ int32 AIEngine::GetCapacity(EngineID engine_id)
{
- if (!IsValidEngine(engine_id)) return 0;
+ if (!IsValidEngine(engine_id)) return -1;
switch (::GetEngine(engine_id)->type) {
case VEH_ROAD:
@@ -86,7 +86,7 @@
if (capacities[c] == 0) continue;
return capacities[c];
}
- return 0;
+ return -1;
} break;
case VEH_SHIP: {
@@ -103,16 +103,16 @@
}
}
-/* static */ uint32 AIEngine::GetReliability(EngineID engine_id)
+/* static */ int32 AIEngine::GetReliability(EngineID engine_id)
{
- if (!IsValidEngine(engine_id)) return 0;
+ if (!IsValidEngine(engine_id)) return -1;
return (::GetEngine(engine_id)->reliability * 100 >> 16);
}
-/* static */ uint32 AIEngine::GetMaxSpeed(EngineID engine_id)
+/* static */ int32 AIEngine::GetMaxSpeed(EngineID engine_id)
{
- if (!IsValidEngine(engine_id)) return 0;
+ if (!IsValidEngine(engine_id)) return -1;
switch (::GetEngine(engine_id)->type) {
case VEH_ROAD: {
@@ -141,9 +141,9 @@
}
}
-/* static */ uint32 AIEngine::GetPrice(EngineID engine_id)
+/* static */ int32 AIEngine::GetPrice(EngineID engine_id)
{
- if (!IsValidEngine(engine_id)) return 0;
+ if (!IsValidEngine(engine_id)) return -1;
switch (::GetEngine(engine_id)->type) {
case VEH_ROAD: {
@@ -170,16 +170,16 @@
}
}
-/* static */ uint32 AIEngine::GetMaxAge(EngineID engine_id)
+/* static */ int32 AIEngine::GetMaxAge(EngineID engine_id)
{
- if (!IsValidEngine(engine_id)) return 0;
+ if (!IsValidEngine(engine_id)) return -1;
return ::GetEngine(engine_id)->lifelength * 366;
}
/* static */ Money AIEngine::GetRunningCost(EngineID engine_id)
{
- if (!IsValidEngine(engine_id)) return 0;
+ if (!IsValidEngine(engine_id)) return -1;
/* We need to create an instance in order to obtain GetRunningCost.
* This means we temporary allocate a vehicle in the pool, but