From ee8c37c3d9fb5b62e24b0272fd93cd50acaa80f6 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sat, 28 Aug 2010 18:50:32 +0000 Subject: (svn r20661) -Codechange: implement the "decide colour" callback for objects --- src/object_cmd.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/object_cmd.cpp') diff --git a/src/object_cmd.cpp b/src/object_cmd.cpp index 29564f8fe..c4f17f576 100644 --- a/src/object_cmd.cpp +++ b/src/object_cmd.cpp @@ -75,6 +75,11 @@ void BuildObject(ObjectType type, TileIndex tile, CompanyID owner, Town *town) /* If the object wants only one colour, then give it that colour. */ if ((spec->flags & OBJECT_FLAG_2CC_COLOUR) == 0) o->colour &= 0xF; + if (HasBit(spec->callback_mask, CBM_OBJ_COLOUR)) { + uint16 res = GetObjectCallback(CBID_OBJECT_COLOUR, o->colour, 0, spec, o, tile); + if (res != CALLBACK_FAILED) o->colour = GB(res, 0, 8); + } + assert(o->town != NULL); TILE_AREA_LOOP(t, ta) { -- cgit v1.2.3-54-g00ecf