Callback: Industry availability

From GRFSpecs
Revision as of 18:57, 16 June 2011 by Pm-bot (talk | contribs) (Create a separate page for each callback)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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.