Index: src/script/api/script_event.hpp =================================================================== --- src/script/api/script_event.hpp (revision 24478) +++ src/script/api/script_event.hpp (working copy) @@ -53,8 +53,12 @@ ET_ADMIN_PORT, ET_WINDOW_WIDGET_CLICK, ET_GOAL_QUESTION_ANSWER, + + ET_VEHICLE_OLD, + ET_EXCLUSIVE_TRANSPORT_RIGHTS, ET_ROAD_RECONSTRUCTION, + }; /** Index: src/script/api/script_event_types.hpp =================================================================== --- src/script/api/script_event_types.hpp (revision 24478) +++ src/script/api/script_event_types.hpp (working copy) @@ -509,6 +509,21 @@ VehicleID vehicle_id; ///< The vehicle that is lost. }; +class ScriptEventVehicleOld : public ScriptEvent { +public: + ScriptEventVehicleOld(VehicleID vehicle_id) : + ScriptEvent(ET_VEHICLE_OLD), + vehicle_id(vehicle_id) + {} + + static ScriptEventVehicleOld *Convert(ScriptEvent *instance) { return (ScriptEventVehicleOld *)instance; } + + VehicleID GetVehicleID() { return this->vehicle_id; } + +private: + VehicleID vehicle_id; +}; + /** * Event VehicleWaitingInDepot, indicating a vehicle has arrived a depot and is now waiting there. * @api ai Index: src/vehicle.cpp =================================================================== --- src/vehicle.cpp (revision 24478) +++ src/vehicle.cpp (working copy) @@ -1224,6 +1224,7 @@ SetDParam(0, v->index); AddVehicleAdviceNewsItem(str, v->index); + AI::NewEvent(v->owner, new ScriptEventVehicleOld(v->index)); } /**