1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-20 21:19:10 +00:00

(svn r9671) -Codechange: Implement NewGRF callback 36, which allows changing of various properties which were previously static. Vehicle max speed and train power/te/running costs are adjustable.

This commit is contained in:
2007-04-18 18:37:40 +00:00
parent aa284fd531
commit 41cf2fa69b
9 changed files with 73 additions and 14 deletions

View File

@@ -935,6 +935,17 @@ uint16 GetVehicleCallbackParent(uint16 callback, uint32 param1, uint32 param2, E
return group->g.callback.result;
}
/* Callback 36 handler */
uint GetVehicleProperty(const Vehicle *v, uint8 property, uint orig_value)
{
uint16 callback = GetVehicleCallback(CBID_VEHICLE_MODIFY_PROPERTY, property, 0, v->engine_type, v);
if (callback != CALLBACK_FAILED) return callback;
return orig_value;
}
static void DoTriggerVehicle(Vehicle *v, VehicleTrigger trigger, byte base_random_bits, bool first)
{
const SpriteGroup *group;