summaryrefslogtreecommitdiff
path: root/src/roadveh_cmd.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2011-11-08 17:27:13 +0000
committerfrosch <frosch@openttd.org>2011-11-08 17:27:13 +0000
commit52774235eb6eb8affb7e68b94c490d3f09e7ae31 (patch)
treeaf07d5b6df28b5c9fdcef94e0f67ecec290e1764 /src/roadveh_cmd.cpp
parent30874b5e81af0fff2f42d34b9b105ee86666b8ac (diff)
downloadopenttd-52774235eb6eb8affb7e68b94c490d3f09e7ae31.tar.xz
(svn r23148) -Change: [NewGRF] Check the results of various callbacks for validness.
Diffstat (limited to 'src/roadveh_cmd.cpp')
-rw-r--r--src/roadveh_cmd.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp
index 74e1e9c14..e6198bbc0 100644
--- a/src/roadveh_cmd.cpp
+++ b/src/roadveh_cmd.cpp
@@ -165,6 +165,7 @@ static uint GetRoadVehLength(const RoadVehicle *v)
uint16 veh_len = GetVehicleCallback(CBID_VEHICLE_LENGTH, 0, 0, v->engine_type, v);
if (veh_len != CALLBACK_FAILED) {
+ if (veh_len >= VEHICLE_LENGTH) ErrorUnknownCallbackResult(v->GetGRFID(), CBID_VEHICLE_LENGTH, veh_len);
length -= Clamp(veh_len, 0, VEHICLE_LENGTH - 1);
}