summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-08-06 17:35:20 +0000
committersmatz <smatz@openttd.org>2009-08-06 17:35:20 +0000
commit50d03a87511183edc614cbaad14a297949e87e71 (patch)
tree07f64fac40bcfaf499386c6b722d930d8e5e2755
parent23fd4bedd8fa426ac90e76326a70440216258876 (diff)
downloadopenttd-50d03a87511183edc614cbaad14a297949e87e71.tar.xz
(svn r17091) -Fix (r17089)(r17090): regression test was right
-rw-r--r--bin/ai/regression/regression.txt24
-rw-r--r--src/vehicle.cpp7
2 files changed, 16 insertions, 15 deletions
diff --git a/bin/ai/regression/regression.txt b/bin/ai/regression/regression.txt
index 68fdee2cb..1ac7b1242 100644
--- a/bin/ai/regression/regression.txt
+++ b/bin/ai/regression/regression.txt
@@ -8365,7 +8365,7 @@
GetNumWagons(): 3
GetLength(): 24
GetWagonEngineType(): 9
- GetWagonAge(): 0
+ GetWagonAge(): 1
GetWagonEngineType(): 27
GetWagonAge(): 0
GetWagonEngineType(): 27
@@ -8401,11 +8401,11 @@
14 => 1
12 => 1
Age ListDump:
- 17 => 0
- 16 => 0
- 14 => 0
- 13 => 0
- 12 => 0
+ 17 => 1
+ 16 => 1
+ 14 => 1
+ 13 => 1
+ 12 => 1
MaxAge ListDump:
16 => 10980
14 => 10980
@@ -8413,11 +8413,11 @@
13 => 5490
12 => 5490
AgeLeft ListDump:
- 16 => 10980
- 14 => 10980
- 17 => 7320
- 13 => 5490
- 12 => 5490
+ 16 => 10979
+ 14 => 10979
+ 17 => 7319
+ 13 => 5489
+ 12 => 5489
CurrentSpeed ListDump:
12 => 21
17 => 0
@@ -8435,7 +8435,7 @@
16 => 0
14 => 0
13 => 0
- 12 => 0
+ 12 => -1
ProfitLastYear ListDump:
17 => 0
16 => 0
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index b00e4bb88..4943e6902 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -576,9 +576,10 @@ static void RunVehicleDayProc()
/* Call the 32-day callback if needed */
if ((v->day_counter & 0x1F) == 0) {
uint16 callback = GetVehicleCallback(CBID_VEHICLE_32DAY_CALLBACK, 0, 0, v->engine_type, v);
- if (callback == CALLBACK_FAILED) return;
- if (HasBit(callback, 0)) TriggerVehicle(v, VEHICLE_TRIGGER_CALLBACK_32); // Trigger vehicle trigger 10
- if (HasBit(callback, 1)) v->colourmap = PAL_NONE;
+ if (callback != CALLBACK_FAILED) {
+ if (HasBit(callback, 0)) TriggerVehicle(v, VEHICLE_TRIGGER_CALLBACK_32); // Trigger vehicle trigger 10
+ if (HasBit(callback, 1)) v->colourmap = PAL_NONE;
+ }
}
/* This is called once per day for each vehicle, but not in the first tick of the day */