Difference between revisions of "Callback: Refit cost factor"
From GRFSpecs
Jump to navigationJump to search (→Refit cost factor (15E): Mention the misc flag for auto-refit) |
(→Refit cost factor (15E): Return now signed.) |
||
Line 19: | Line 19: | ||
'''Return values:''' |
'''Return values:''' |
||
− | * Bits 0-13: |
+ | * Bits 0-13: Signed refit cost factor, cost base depends on the vehicle type and is the same as for the refit cost property. Negative cost factors allow refit revenue, useful for example if refits are used to change the number of articulated parts. |
* Bit 14: If set, the refit is allowed as an auto-refit as long as bit 4 of the miscellaneous flags is set as well. |
* Bit 14: If set, the refit is allowed as an auto-refit as long as bit 4 of the miscellaneous flags is set as well. |
||
Revision as of 15:39, 6 November 2011
Refit cost factor (15E)
This callback can be used to override the refit cost property of vehicles. This callback will also be called in purchase list scope, so either limit the used variables to what is available in the purchase list or branch on the special purchase list cargo type.
Variable 10 contains information about the target cargo type similar to variable 47.
Format: ccccwwtt
Variable | Value |
---|---|
tt | The cargo type being refitted to; translated if a translation table has been installed |
ww | Subtype being refitted to |
cccc | The cargo class value of the cargo being refitted to |
Return values:
- Bits 0-13: Signed refit cost factor, cost base depends on the vehicle type and is the same as for the refit cost property. Negative cost factors allow refit revenue, useful for example if refits are used to change the number of articulated parts.
- Bit 14: If set, the refit is allowed as an auto-refit as long as bit 4 of the miscellaneous flags is set as well.
If the callback fails, the value of the refit cost property is used.