summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2007-09-28 17:09:50 +0000
committerglx <glx@openttd.org>2007-09-28 17:09:50 +0000
commitc07e91fd78b47afe3fe4c400bd9d94fa1d5eb371 (patch)
tree57ead32a69d513e995ca13461cda271b0074d190 /src
parent08fd0030d25777b4eb081f6393bd8a123d7b4941 (diff)
downloadopenttd-c07e91fd78b47afe3fe4c400bd9d94fa1d5eb371.tar.xz
(svn r11181) -Codechange: add support for newgrf callback 14A (Belugas)
Diffstat (limited to 'src')
-rw-r--r--src/industry_cmd.cpp5
-rw-r--r--src/newgrf_callbacks.h2
2 files changed, 6 insertions, 1 deletions
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp
index b6a45382d..4fd566b17 100644
--- a/src/industry_cmd.cpp
+++ b/src/industry_cmd.cpp
@@ -1459,6 +1459,11 @@ static void DoCreateNewIndustry(Industry *i, TileIndex tile, int type, const Ind
i->last_month_production[1] = i->production_rate[1] * 8;
i->founder = _current_player;
+ if (HASBIT(indspec->callback_flags, CBM_IND_DECIDE_COLOUR)) {
+ uint16 res = GetIndustryCallback(CBID_INDUSTRY_DECIDE_COLOUR, 0, 0, i, type, INVALID_TILE);
+ if (res != CALLBACK_FAILED) i->random_color = GB(res, 0, 4);
+ }
+
if (HASBIT(indspec->callback_flags, CBM_IND_INPUT_CARGO_TYPES)) {
for (j = 0; j < lengthof(i->accepts_cargo); j++) i->accepts_cargo[j] = CT_INVALID;
for (j = 0; j < lengthof(i->accepts_cargo); j++) {
diff --git a/src/newgrf_callbacks.h b/src/newgrf_callbacks.h
index 16f5169d0..0d5de6feb 100644
--- a/src/newgrf_callbacks.h
+++ b/src/newgrf_callbacks.h
@@ -193,7 +193,7 @@ enum CallbackID {
CBID_STATION_LAND_SLOPE_CHECK = 0x149, // not implemented
/** Called to determine the color of an industry. */
- CBID_INDUSTRY_DECIDE_COLOUR = 0x14A, // not implemented
+ CBID_INDUSTRY_DECIDE_COLOUR = 0x14A,
/** Customize the input cargo types of a newly build industry. */
CBID_INDUSTRY_INPUT_CARGO_TYPES = 0x14B,