(svn r10493) -Codechange: update some callback ID enums to reflect their changed usage, add a few and update the comments.

This commit is contained in:
rubidium
2007-07-09 19:38:12 +00:00
parent 0452fc482d
commit b876be0064
5 changed files with 121 additions and 112 deletions

View File

@@ -231,7 +231,7 @@ void TrainConsistChanged(Vehicle* v)
/* check the vehicle length (callback) */
uint16 veh_len = CALLBACK_FAILED;
if (HASBIT(EngInfo(u->engine_type)->callbackmask, CBM_VEHICLE_LENGTH)) {
veh_len = GetVehicleCallback(CBID_TRAIN_VEHICLE_LENGTH, 0, 0, u->engine_type, u);
veh_len = GetVehicleCallback(CBID_VEHICLE_LENGTH, 0, 0, u->engine_type, u);
}
if (veh_len == CALLBACK_FAILED) veh_len = rvi_u->shorten_factor;
veh_len = clamp(veh_len, 0, u->next == NULL ? 7 : 5); // the clamp on vehicles not the last in chain is stricter, as too short wagons can break the 'follow next vehicle' code