Difference between revisions of "Callback: Refit cost factor"

From GRFSpecs
Jump to navigationJump to search
(Refit cost factor (15E))
 
(→‎Refit cost factor (15E): Mention the misc flag for auto-refit)
Line 19: Line 19:
   
 
'''Return values:'''
 
'''Return values:'''
* Bits 0-13: Refit cost factor, cost base depends on the vehicle type and is the same as the refit cost property.
+
* Bits 0-13: Refit cost factor, cost base depends on the vehicle type and is the same as for the refit cost property.
* Bit 14: If set, the refit is allowed as an auto-refit.
+
* 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.
 
If the callback fails, the value of the refit cost property is used.

Revision as of 00:57, 4 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: Refit cost factor, cost base depends on the vehicle type and is the same as for the refit cost property.
  • 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.