summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorplanetmaker <planetmaker@openttd.org>2013-10-17 21:27:08 +0000
committerplanetmaker <planetmaker@openttd.org>2013-10-17 21:27:08 +0000
commit88286d33ab7d94c14896388790956321ac9cda52 (patch)
tree8fbd6c5ad5dc95e5611753f10a013a3bc89839ab
parent6f62458e3b7ef08a05974570e5e2c69a60d9400c (diff)
downloadopenttd-88286d33ab7d94c14896388790956321ac9cda52.tar.xz
(svn r25873) -Codechange: Add property for the amount of generated objects upon map creation to default objects
-rw-r--r--src/newgrf_object.h1
-rw-r--r--src/table/object_land.h12
2 files changed, 7 insertions, 6 deletions
diff --git a/src/newgrf_object.h b/src/newgrf_object.h
index 2c01b42d4..77b80894b 100644
--- a/src/newgrf_object.h
+++ b/src/newgrf_object.h
@@ -73,6 +73,7 @@ struct ObjectSpec {
uint16 callback_mask; ///< Bitmask of requested/allowed callbacks.
uint8 height; ///< The height of this structure, in heightlevels; max MAX_TILE_HEIGHT.
uint8 views; ///< The number of views.
+ uint8 generate_amount; ///< Number of objects which are attempted to be generated per 256^2 map during world generation.
bool enabled; ///< Is this spec enabled?
/**
diff --git a/src/table/object_land.h b/src/table/object_land.h
index b6c90cc38..42c3d5696 100644
--- a/src/table/object_land.h
+++ b/src/table/object_land.h
@@ -123,7 +123,7 @@ static const DrawTileSprites _object_hq[] = {
#undef TILE_SPRITE_LINE
-#define M(name, size, build_cost_multiplier, clear_cost_multiplier, height, climate, flags) { GRFFilePropsBase<2>(), INVALID_OBJECT_CLASS, name, climate, size, build_cost_multiplier, clear_cost_multiplier, 0, 0, flags, {0, 0, 0, 0}, 0, height, 1, true }
+#define M(name, size, build_cost_multiplier, clear_cost_multiplier, height, climate, gen_amount, flags) { GRFFilePropsBase<2>(), INVALID_OBJECT_CLASS, name, climate, size, build_cost_multiplier, clear_cost_multiplier, 0, 0, flags, {0, 0, 0, 0}, 0, height, 1, gen_amount, true }
/* Climates
* T = Temperate
@@ -136,11 +136,11 @@ static const DrawTileSprites _object_hq[] = {
#define Y 8
/** Specification of the original object structures. */
extern const ObjectSpec _original_objects[] = {
- M(STR_LAI_OBJECT_DESCRIPTION_TRANSMITTER, 0x11, 0, 0, 10, T|A|S , OBJECT_FLAG_CANNOT_REMOVE | OBJECT_FLAG_ONLY_IN_SCENEDIT),
- M(STR_LAI_OBJECT_DESCRIPTION_LIGHTHOUSE, 0x11, 0, 0, 8, T|A , OBJECT_FLAG_CANNOT_REMOVE | OBJECT_FLAG_ONLY_IN_SCENEDIT),
- M(STR_TOWN_BUILDING_NAME_STATUE_1, 0x11, 0, 0, 5, T|S|A|Y, OBJECT_FLAG_CANNOT_REMOVE | OBJECT_FLAG_ONLY_IN_GAME | OBJECT_FLAG_ONLY_IN_SCENEDIT), // Yes, we disallow building this everywhere. Happens in "special" case!
- M(STR_LAI_OBJECT_DESCRIPTION_COMPANY_OWNED_LAND, 0x11, 10, 10, 0, T|S|A|Y, OBJECT_FLAG_AUTOREMOVE | OBJECT_FLAG_ONLY_IN_GAME | OBJECT_FLAG_CLEAR_INCOME | OBJECT_FLAG_HAS_NO_FOUNDATION ), // Only non-silly use case is to use it when you cannot build a station, so disallow bridges
- M(STR_LAI_OBJECT_DESCRIPTION_COMPANY_HEADQUARTERS, 0x22, 0, 0, 7, T|S|A|Y, OBJECT_FLAG_CANNOT_REMOVE | OBJECT_FLAG_ONLY_IN_GAME),
+ M(STR_LAI_OBJECT_DESCRIPTION_TRANSMITTER, 0x11, 0, 0, 10, T|A|S , 15, OBJECT_FLAG_CANNOT_REMOVE | OBJECT_FLAG_ONLY_IN_SCENEDIT),
+ M(STR_LAI_OBJECT_DESCRIPTION_LIGHTHOUSE, 0x11, 0, 0, 8, T|A , 7, OBJECT_FLAG_CANNOT_REMOVE | OBJECT_FLAG_ONLY_IN_SCENEDIT),
+ M(STR_TOWN_BUILDING_NAME_STATUE_1, 0x11, 0, 0, 5, T|S|A|Y, 0, OBJECT_FLAG_CANNOT_REMOVE | OBJECT_FLAG_ONLY_IN_GAME | OBJECT_FLAG_ONLY_IN_SCENEDIT), // Yes, we disallow building this everywhere. Happens in "special" case!
+ M(STR_LAI_OBJECT_DESCRIPTION_COMPANY_OWNED_LAND, 0x11, 10, 10, 0, T|S|A|Y, 0, OBJECT_FLAG_AUTOREMOVE | OBJECT_FLAG_ONLY_IN_GAME | OBJECT_FLAG_CLEAR_INCOME | OBJECT_FLAG_HAS_NO_FOUNDATION ), // Only non-silly use case is to use it when you cannot build a station, so disallow bridges
+ M(STR_LAI_OBJECT_DESCRIPTION_COMPANY_HEADQUARTERS, 0x22, 0, 0, 7, T|S|A|Y, 0, OBJECT_FLAG_CANNOT_REMOVE | OBJECT_FLAG_ONLY_IN_GAME),
};
#undef M