Callback: Industry availability
From GRFSpecs
Jump to navigationJump to search
Industry availability (22)
Called when TTDPatch needs to know if a given industry type is available.
Return zero to make your type available, or any nonzero value to disable it. This callback is intended for limiting your type as a whole, so you can't access any industry-specific variables, just the global ones. A good example for the use of this callback is a nuclear power plant that isn't allowed to appear before 1970.
During this callback, variable 18 (extra callback info 2) can contain the following values:
Variable 18 | Meaning |
---|---|
0 | TTD is generating a map and needs to know if your type can appear. |
1 | TTD decided to build a new random industry during regular gameplay and needs to know if it can choose your type. |
2 | The user tries to build/prospect for your industry via the new industry window. TTD needs to know if the player is allowed to do this. |