43 byte visual_effect; // NOTE: this is not 100% implemented yet, at the moment it is only used as a 'fallback' value |
43 byte visual_effect; // NOTE: this is not 100% implemented yet, at the moment it is only used as a 'fallback' value |
44 // for when the 'powered wagon' callback fails. But it should really also determine what |
44 // for when the 'powered wagon' callback fails. But it should really also determine what |
45 // kind of visual effect to generate for a vehicle (default, steam, diesel, electric). |
45 // kind of visual effect to generate for a vehicle (default, steam, diesel, electric). |
46 // Same goes for the callback result, which atm is only used to check if a wagon is powered. |
46 // Same goes for the callback result, which atm is only used to check if a wagon is powered. |
47 byte shorten_factor; ///< length on main map for this type is 8 - shorten_factor |
47 byte shorten_factor; ///< length on main map for this type is 8 - shorten_factor |
48 byte tractive_effort; ///< Tractive effort coefficient |
48 byte tractive_effort; ///< Tractive effort coefficient |
49 byte user_def_data; ///< Property 0x25: "User-defined bit mask" Used only for (very few) NewGRF vehicles |
49 byte user_def_data; ///< Property 0x25: "User-defined bit mask" Used only for (very few) NewGRF vehicles |
50 }; |
50 }; |
51 |
51 |
52 struct ShipVehicleInfo { |
52 struct ShipVehicleInfo { |
53 byte image_index; |
53 byte image_index; |
307 /** |
307 /** |
308 * Remove all engine replacement settings for the player. |
308 * Remove all engine replacement settings for the player. |
309 * @param erl The renewlist for a given player. |
309 * @param erl The renewlist for a given player. |
310 * @return The new renewlist for the player. |
310 * @return The new renewlist for the player. |
311 */ |
311 */ |
312 void RemoveAllEngineReplacement(EngineRenewList* erl); |
312 void RemoveAllEngineReplacement(EngineRenewList *erl); |
313 |
313 |
314 /** |
314 /** |
315 * Retrieve the engine replacement in a given renewlist for an original engine type. |
315 * Retrieve the engine replacement in a given renewlist for an original engine type. |
316 * @param erl The renewlist to search in. |
316 * @param erl The renewlist to search in. |
317 * @param engine Engine type to be replaced. |
317 * @param engine Engine type to be replaced. |
326 * @param old_engine The original engine type. |
326 * @param old_engine The original engine type. |
327 * @param new_engine The replacement engine type. |
327 * @param new_engine The replacement engine type. |
328 * @param flags The calling command flags. |
328 * @param flags The calling command flags. |
329 * @return 0 on success, CMD_ERROR on failure. |
329 * @return 0 on success, CMD_ERROR on failure. |
330 */ |
330 */ |
331 CommandCost AddEngineReplacement(EngineRenewList* erl, EngineID old_engine, EngineID new_engine, GroupID group, uint32 flags); |
331 CommandCost AddEngineReplacement(EngineRenewList *erl, EngineID old_engine, EngineID new_engine, GroupID group, uint32 flags); |
332 |
332 |
333 /** |
333 /** |
334 * Remove an engine replacement from a given renewlist. |
334 * Remove an engine replacement from a given renewlist. |
335 * @param erl The renewlist from which to remove the replacement |
335 * @param erl The renewlist from which to remove the replacement |
336 * @param engine The original engine type. |
336 * @param engine The original engine type. |
337 * @param flags The calling command flags. |
337 * @param flags The calling command flags. |
338 * @return 0 on success, CMD_ERROR on failure. |
338 * @return 0 on success, CMD_ERROR on failure. |
339 */ |
339 */ |
340 CommandCost RemoveEngineReplacement(EngineRenewList* erl, EngineID engine, GroupID group, uint32 flags); |
340 CommandCost RemoveEngineReplacement(EngineRenewList *erl, EngineID engine, GroupID group, uint32 flags); |
341 |
341 |
342 /** When an engine is made buildable or is removed from being buildable, add/remove it from the build/autoreplace lists |
342 /** When an engine is made buildable or is removed from being buildable, add/remove it from the build/autoreplace lists |
343 * @param type The type of engine |
343 * @param type The type of engine |
344 */ |
344 */ |
345 void AddRemoveEngineFromAutoreplaceAndBuildWindows(VehicleType type); |
345 void AddRemoveEngineFromAutoreplaceAndBuildWindows(VehicleType type); |