author | rubidium |
Fri, 25 Apr 2008 15:20:48 +0000 | |
branch | noai |
changeset 10355 | ee4b5f7a5bf2 |
parent 10294 | 7798ae816af8 |
child 10455 | 22c441f5adf9 |
permissions | -rw-r--r-- |
9476 | 1 |
/* $Id$ */ |
2 |
||
3 |
/** @file newgrf_house.cpp */ |
|
4 |
||
5 |
#include "stdafx.h" |
|
6 |
#include "openttd.h" |
|
7 |
#include "variables.h" |
|
8 |
#include "debug.h" |
|
9723
eee46cb39750
(svn r11796) [NoAI] -Sync: with trunk r11502:11795.
rubidium
parents:
9722
diff
changeset
|
9 |
#include "viewport_func.h" |
9505 | 10 |
#include "landscape.h" |
9476 | 11 |
#include "town.h" |
12 |
#include "town_map.h" |
|
13 |
#include "sprite.h" |
|
14 |
#include "newgrf.h" |
|
15 |
#include "newgrf_house.h" |
|
16 |
#include "newgrf_spritegroup.h" |
|
17 |
#include "newgrf_callbacks.h" |
|
18 |
#include "newgrf_town.h" |
|
19 |
#include "newgrf_sound.h" |
|
9624 | 20 |
#include "newgrf_commons.h" |
9722
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
21 |
#include "transparency.h" |
9723
eee46cb39750
(svn r11796) [NoAI] -Sync: with trunk r11502:11795.
rubidium
parents:
9722
diff
changeset
|
22 |
#include "functions.h" |
9724
b39bc69bb2f2
(svn r12051) [NoAI] -Sync: with trunk (r11795:12050).
rubidium
parents:
9723
diff
changeset
|
23 |
#include "player_func.h" |
10294 | 24 |
#include "animated_tile_func.h" |
25 |
#include "date_func.h" |
|
9724
b39bc69bb2f2
(svn r12051) [NoAI] -Sync: with trunk (r11795:12050).
rubidium
parents:
9723
diff
changeset
|
26 |
|
b39bc69bb2f2
(svn r12051) [NoAI] -Sync: with trunk (r11795:12050).
rubidium
parents:
9723
diff
changeset
|
27 |
#include "table/strings.h" |
b39bc69bb2f2
(svn r12051) [NoAI] -Sync: with trunk (r11795:12050).
rubidium
parents:
9723
diff
changeset
|
28 |
#include "table/sprites.h" |
b39bc69bb2f2
(svn r12051) [NoAI] -Sync: with trunk (r11795:12050).
rubidium
parents:
9723
diff
changeset
|
29 |
#include "table/town_land.h" |
9476 | 30 |
|
31 |
static BuildingCounts _building_counts; |
|
32 |
static HouseClassMapping _class_mapping[HOUSE_CLASS_MAX]; |
|
33 |
||
9624 | 34 |
HouseOverrideManager _house_mngr(NEW_HOUSE_OFFSET, HOUSE_MAX, INVALID_HOUSE_ID); |
9476 | 35 |
|
9826
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9732
diff
changeset
|
36 |
/** |
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9732
diff
changeset
|
37 |
* Check and update town and house values. |
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9732
diff
changeset
|
38 |
* |
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9732
diff
changeset
|
39 |
* Checked are the HouseIDs. Updated are the |
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9732
diff
changeset
|
40 |
* town population the number of houses per |
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9732
diff
changeset
|
41 |
* town, the town radius and the max passengers |
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9732
diff
changeset
|
42 |
* of the town. |
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9732
diff
changeset
|
43 |
*/ |
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9732
diff
changeset
|
44 |
void UpdateHousesAndTowns() |
9476 | 45 |
{ |
9724
b39bc69bb2f2
(svn r12051) [NoAI] -Sync: with trunk (r11795:12050).
rubidium
parents:
9723
diff
changeset
|
46 |
Town *town; |
9701
d1ac22c62f64
(svn r11036) [NoAI] -Sync: with trunk r10774:11035.
rubidium
parents:
9694
diff
changeset
|
47 |
InitializeBuildingCounts(); |
d1ac22c62f64
(svn r11036) [NoAI] -Sync: with trunk r10774:11035.
rubidium
parents:
9694
diff
changeset
|
48 |
|
9826
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9732
diff
changeset
|
49 |
/* Reset town population and num_houses */ |
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9732
diff
changeset
|
50 |
FOR_ALL_TOWNS(town) { |
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9732
diff
changeset
|
51 |
town->population = 0; |
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9732
diff
changeset
|
52 |
town->num_houses = 0; |
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9732
diff
changeset
|
53 |
} |
9724
b39bc69bb2f2
(svn r12051) [NoAI] -Sync: with trunk (r11795:12050).
rubidium
parents:
9723
diff
changeset
|
54 |
|
9476 | 55 |
for (TileIndex t = 0; t < MapSize(); t++) { |
56 |
HouseID house_id; |
|
57 |
||
58 |
if (!IsTileType(t, MP_HOUSE)) continue; |
|
59 |
||
60 |
house_id = GetHouseType(t); |
|
61 |
if (!GetHouseSpecs(house_id)->enabled && house_id >= NEW_HOUSE_OFFSET) { |
|
62 |
/* The specs for this type of house are not available any more, so |
|
63 |
* replace it with the substitute original house type. */ |
|
9701
d1ac22c62f64
(svn r11036) [NoAI] -Sync: with trunk r10774:11035.
rubidium
parents:
9694
diff
changeset
|
64 |
house_id = _house_mngr.GetSubstituteID(house_id); |
d1ac22c62f64
(svn r11036) [NoAI] -Sync: with trunk r10774:11035.
rubidium
parents:
9694
diff
changeset
|
65 |
SetHouseType(t, house_id); |
9476 | 66 |
} |
9826
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9732
diff
changeset
|
67 |
|
9724
b39bc69bb2f2
(svn r12051) [NoAI] -Sync: with trunk (r11795:12050).
rubidium
parents:
9723
diff
changeset
|
68 |
town = GetTownByTile(t); |
b39bc69bb2f2
(svn r12051) [NoAI] -Sync: with trunk (r11795:12050).
rubidium
parents:
9723
diff
changeset
|
69 |
IncreaseBuildingCount(town, house_id); |
b39bc69bb2f2
(svn r12051) [NoAI] -Sync: with trunk (r11795:12050).
rubidium
parents:
9723
diff
changeset
|
70 |
if (IsHouseCompleted(t)) town->population += GetHouseSpecs(house_id)->population; |
9826
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9732
diff
changeset
|
71 |
|
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9732
diff
changeset
|
72 |
/* Increase the number of houses for every house tile which |
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9732
diff
changeset
|
73 |
* has a size bit set. Multi tile buildings have got only |
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9732
diff
changeset
|
74 |
* one tile with such a bit set, so there is no problem. */ |
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9732
diff
changeset
|
75 |
if (GetHouseSpecs(GetHouseType(t))->building_flags & BUILDING_HAS_1_TILE) { |
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9732
diff
changeset
|
76 |
town->num_houses++; |
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9732
diff
changeset
|
77 |
} |
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9732
diff
changeset
|
78 |
} |
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9732
diff
changeset
|
79 |
|
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9732
diff
changeset
|
80 |
/* Update the population and num_house dependant values */ |
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9732
diff
changeset
|
81 |
FOR_ALL_TOWNS(town) { |
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9732
diff
changeset
|
82 |
UpdateTownRadius(town); |
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9732
diff
changeset
|
83 |
UpdateTownMaxPass(town); |
9476 | 84 |
} |
85 |
} |
|
86 |
||
87 |
HouseClassID AllocateHouseClassID(byte grf_class_id, uint32 grfid) |
|
88 |
{ |
|
89 |
/* Start from 1 because 0 means that no class has been assigned. */ |
|
90 |
for (int i = 1; i != lengthof(_class_mapping); i++) { |
|
91 |
HouseClassMapping *map = &_class_mapping[i]; |
|
92 |
||
93 |
if (map->class_id == grf_class_id && map->grfid == grfid) return (HouseClassID)i; |
|
94 |
||
95 |
if (map->class_id == 0 && map->grfid == 0) { |
|
96 |
map->class_id = grf_class_id; |
|
97 |
map->grfid = grfid; |
|
98 |
return (HouseClassID)i; |
|
99 |
} |
|
100 |
} |
|
101 |
return HOUSE_NO_CLASS; |
|
102 |
} |
|
103 |
||
104 |
void InitializeBuildingCounts() |
|
105 |
{ |
|
106 |
memset(&_building_counts, 0, sizeof(_building_counts)); |
|
107 |
} |
|
108 |
||
109 |
/** |
|
110 |
* IncreaseBuildingCount() |
|
111 |
* Increase the count of a building when it has been added by a town. |
|
112 |
* @param t The town that the building is being built in |
|
113 |
* @param house_id The id of the house being added |
|
114 |
*/ |
|
115 |
void IncreaseBuildingCount(Town *t, HouseID house_id) |
|
116 |
{ |
|
117 |
HouseClassID class_id = GetHouseSpecs(house_id)->class_id; |
|
118 |
||
9628
b5c2449616b5
(svn r10195) [NoAI] -Sync: with trunk r10119:10194.
rubidium
parents:
9626
diff
changeset
|
119 |
if (!_loaded_newgrf_features.has_newhouses) return; |
9476 | 120 |
|
121 |
/* If there are 255 buildings of this type in this town, there are also |
|
122 |
* at least that many houses of the same class in the town, and |
|
123 |
* therefore on the map as well. */ |
|
124 |
if (t->building_counts.id_count[house_id] == 255) return; |
|
125 |
||
126 |
t->building_counts.id_count[house_id]++; |
|
127 |
if (_building_counts.id_count[house_id] < 255) _building_counts.id_count[house_id]++; |
|
128 |
||
129 |
/* Similarly, if there are 255 houses of this class in this town, there |
|
130 |
* must be at least that number on the map too. */ |
|
131 |
if (class_id == HOUSE_NO_CLASS || t->building_counts.class_count[class_id] == 255) return; |
|
132 |
||
133 |
t->building_counts.class_count[class_id]++; |
|
134 |
if (_building_counts.class_count[class_id] < 255) _building_counts.class_count[class_id]++; |
|
135 |
} |
|
136 |
||
137 |
/** |
|
138 |
* DecreaseBuildingCount() |
|
139 |
* Decrease the number of a building when it is deleted. |
|
140 |
* @param t The town that the building was built in |
|
141 |
* @param house_id The id of the house being removed |
|
142 |
*/ |
|
143 |
void DecreaseBuildingCount(Town *t, HouseID house_id) |
|
144 |
{ |
|
145 |
HouseClassID class_id = GetHouseSpecs(house_id)->class_id; |
|
146 |
||
9628
b5c2449616b5
(svn r10195) [NoAI] -Sync: with trunk r10119:10194.
rubidium
parents:
9626
diff
changeset
|
147 |
if (!_loaded_newgrf_features.has_newhouses) return; |
9476 | 148 |
|
149 |
if (t->building_counts.id_count[house_id] > 0) t->building_counts.id_count[house_id]--; |
|
150 |
if (_building_counts.id_count[house_id] > 0) _building_counts.id_count[house_id]--; |
|
151 |
||
152 |
if (class_id == HOUSE_NO_CLASS) return; |
|
153 |
||
154 |
if (t->building_counts.class_count[class_id] > 0) t->building_counts.class_count[class_id]--; |
|
155 |
if (_building_counts.class_count[class_id] > 0) _building_counts.class_count[class_id]--; |
|
156 |
} |
|
157 |
||
158 |
static uint32 HouseGetRandomBits(const ResolverObject *object) |
|
159 |
{ |
|
160 |
const TileIndex tile = object->u.house.tile; |
|
161 |
return (tile == INVALID_TILE || !IsTileType(tile, MP_HOUSE)) ? 0 : GetHouseRandomBits(tile); |
|
162 |
} |
|
163 |
||
164 |
static uint32 HouseGetTriggers(const ResolverObject *object) |
|
165 |
{ |
|
166 |
const TileIndex tile = object->u.house.tile; |
|
167 |
return (tile == INVALID_TILE || !IsTileType(tile, MP_HOUSE)) ? 0 : GetHouseTriggers(tile); |
|
168 |
} |
|
169 |
||
170 |
static void HouseSetTriggers(const ResolverObject *object, int triggers) |
|
171 |
{ |
|
172 |
const TileIndex tile = object->u.house.tile; |
|
173 |
if (IsTileType(tile, MP_HOUSE)) SetHouseTriggers(tile, triggers); |
|
174 |
} |
|
175 |
||
176 |
static uint32 GetNumHouses(HouseID house_id, const Town *town) |
|
177 |
{ |
|
178 |
uint8 map_id_count, town_id_count, map_class_count, town_class_count; |
|
179 |
HouseClassID class_id = GetHouseSpecs(house_id)->class_id; |
|
180 |
||
181 |
map_id_count = _building_counts.id_count[house_id]; |
|
182 |
map_class_count = _building_counts.class_count[class_id]; |
|
183 |
town_id_count = town->building_counts.id_count[house_id]; |
|
184 |
town_class_count = town->building_counts.class_count[class_id]; |
|
185 |
||
186 |
return map_class_count << 24 | town_class_count << 16 | map_id_count << 8 | town_id_count; |
|
187 |
} |
|
188 |
||
189 |
static uint32 GetGRFParameter(HouseID house_id, byte parameter) |
|
190 |
{ |
|
191 |
const HouseSpec *hs = GetHouseSpecs(house_id); |
|
192 |
const GRFFile *file = hs->grffile; |
|
193 |
||
194 |
if (parameter >= file->param_end) return 0; |
|
195 |
return file->param[parameter]; |
|
196 |
} |
|
197 |
||
9626 | 198 |
uint32 GetNearbyTileInformation(byte parameter, TileIndex tile) |
199 |
{ |
|
200 |
tile = GetNearbyTile(parameter, tile); |
|
9724
b39bc69bb2f2
(svn r12051) [NoAI] -Sync: with trunk (r11795:12050).
rubidium
parents:
9723
diff
changeset
|
201 |
return GetNearbyTileInformation(tile); |
9626 | 202 |
} |
203 |
||
9476 | 204 |
/** |
205 |
* HouseGetVariable(): |
|
206 |
* |
|
207 |
* Used by the resolver to get values for feature 07 deterministic spritegroups. |
|
208 |
*/ |
|
209 |
static uint32 HouseGetVariable(const ResolverObject *object, byte variable, byte parameter, bool *available) |
|
210 |
{ |
|
211 |
const Town *town = object->u.house.town; |
|
212 |
TileIndex tile = object->u.house.tile; |
|
213 |
HouseID house_id = object->u.house.house_id; |
|
214 |
||
215 |
if (object->scope == VSG_SCOPE_PARENT) { |
|
216 |
return TownGetVariable(variable, parameter, available, town); |
|
217 |
} |
|
218 |
||
219 |
switch (variable) { |
|
220 |
/* Construction stage. */ |
|
9869
6404afe43575
(svn r12597) [NoAI] -Sync: with trunk r12501:12596.
rubidium
parents:
9826
diff
changeset
|
221 |
case 0x40: return (IsTileType(tile, MP_HOUSE) ? GetHouseBuildingStage(tile) : 0) | TileHash2Bit(TileX(tile), TileY(tile)) << 2; |
9476 | 222 |
|
223 |
/* Building age. */ |
|
9722
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
224 |
case 0x41: return Clamp(_cur_year - GetHouseConstructionYear(tile), 0, 0xFF); |
9476 | 225 |
|
226 |
/* Town zone */ |
|
227 |
case 0x42: return GetTownRadiusGroup(town, tile); |
|
228 |
||
229 |
/* Terrain type */ |
|
230 |
case 0x43: return GetTerrainType(tile); |
|
231 |
||
232 |
/* Number of this type of building on the map. */ |
|
233 |
case 0x44: return GetNumHouses(house_id, town); |
|
234 |
||
235 |
/* Whether the town is being created or just expanded. */ |
|
236 |
case 0x45: return _generating_world ? 1 : 0; |
|
237 |
||
238 |
/* Current animation frame. */ |
|
239 |
case 0x46: return IsTileType(tile, MP_HOUSE) ? GetHouseAnimationFrame(tile) : 0; |
|
240 |
||
241 |
||
242 |
/* Building counts for old houses with id = parameter. */ |
|
243 |
case 0x60: return GetNumHouses(parameter, town); |
|
244 |
||
245 |
/* Building counts for new houses with id = parameter. */ |
|
246 |
case 0x61: { |
|
247 |
const HouseSpec *hs = GetHouseSpecs(house_id); |
|
248 |
if (hs->grffile == NULL) return 0; |
|
249 |
||
9624 | 250 |
HouseID new_house = _house_mngr.GetID(parameter, hs->grffile->grfid); |
9476 | 251 |
return new_house == INVALID_HOUSE_ID ? 0 : GetNumHouses(new_house, town); |
252 |
} |
|
253 |
||
254 |
/* Land info for nearby tiles. */ |
|
9626 | 255 |
case 0x62: return GetNearbyTileInformation(parameter, tile); |
9476 | 256 |
|
257 |
/* Read GRF parameter */ |
|
258 |
case 0x7F: return GetGRFParameter(object->u.house.house_id, parameter); |
|
259 |
} |
|
260 |
||
261 |
DEBUG(grf, 1, "Unhandled house property 0x%X", variable); |
|
262 |
||
263 |
*available = false; |
|
264 |
return UINT_MAX; |
|
265 |
} |
|
266 |
||
267 |
static const SpriteGroup *HouseResolveReal(const ResolverObject *object, const SpriteGroup *group) |
|
268 |
{ |
|
269 |
/* Houses do not have 'real' groups */ |
|
270 |
return NULL; |
|
271 |
} |
|
272 |
||
273 |
/** |
|
274 |
* NewHouseResolver(): |
|
275 |
* |
|
276 |
* Returns a resolver object to be used with feature 07 spritegroups. |
|
277 |
*/ |
|
278 |
static void NewHouseResolver(ResolverObject *res, HouseID house_id, TileIndex tile, Town *town) |
|
279 |
{ |
|
280 |
res->GetRandomBits = HouseGetRandomBits; |
|
281 |
res->GetTriggers = HouseGetTriggers; |
|
282 |
res->SetTriggers = HouseSetTriggers; |
|
283 |
res->GetVariable = HouseGetVariable; |
|
284 |
res->ResolveReal = HouseResolveReal; |
|
285 |
||
286 |
res->u.house.tile = tile; |
|
287 |
res->u.house.town = town; |
|
288 |
res->u.house.house_id = house_id; |
|
289 |
||
9694
e72987579514
(svn r10775) [NoAI] -Sync: with trunk r10535:r10774.
rubidium
parents:
9628
diff
changeset
|
290 |
res->callback = CBID_NO_CALLBACK; |
9476 | 291 |
res->callback_param1 = 0; |
292 |
res->callback_param2 = 0; |
|
293 |
res->last_value = 0; |
|
294 |
res->trigger = 0; |
|
295 |
res->reseed = 0; |
|
9826
9707ad4c9b60
(svn r12462) [NoAI] -Sync: with trunk r12304:12461.
rubidium
parents:
9732
diff
changeset
|
296 |
res->count = 0; |
9476 | 297 |
} |
298 |
||
9694
e72987579514
(svn r10775) [NoAI] -Sync: with trunk r10535:r10774.
rubidium
parents:
9628
diff
changeset
|
299 |
uint16 GetHouseCallback(CallbackID callback, uint32 param1, uint32 param2, HouseID house_id, Town *town, TileIndex tile) |
9476 | 300 |
{ |
301 |
ResolverObject object; |
|
302 |
const SpriteGroup *group; |
|
303 |
||
304 |
NewHouseResolver(&object, house_id, tile, town); |
|
305 |
object.callback = callback; |
|
306 |
object.callback_param1 = param1; |
|
9624 | 307 |
object.callback_param2 = param2; |
9476 | 308 |
|
309 |
group = Resolve(GetHouseSpecs(house_id)->spritegroup, &object); |
|
310 |
if (group == NULL || group->type != SGT_CALLBACK) return CALLBACK_FAILED; |
|
311 |
||
312 |
return group->g.callback.result; |
|
313 |
} |
|
314 |
||
315 |
void DrawTileLayout(const TileInfo *ti, const SpriteGroup *group, byte stage, HouseID house_id) |
|
316 |
{ |
|
317 |
const DrawTileSprites *dts = group->g.layout.dts; |
|
318 |
const DrawTileSeqStruct *dtss; |
|
319 |
||
9732 | 320 |
SpriteID image = dts->ground.sprite; |
321 |
SpriteID pal = dts->ground.pal; |
|
9476 | 322 |
|
9704 | 323 |
if (IS_CUSTOM_SPRITE(image)) image += stage; |
324 |
||
9476 | 325 |
if (GB(image, 0, SPRITE_WIDTH) != 0) DrawGroundSprite(image, pal); |
326 |
||
9869
6404afe43575
(svn r12597) [NoAI] -Sync: with trunk r12501:12596.
rubidium
parents:
9826
diff
changeset
|
327 |
/* End now, if houses are invisible */ |
6404afe43575
(svn r12597) [NoAI] -Sync: with trunk r12501:12596.
rubidium
parents:
9826
diff
changeset
|
328 |
if (IsInvisibilitySet(TO_HOUSES)) return; |
6404afe43575
(svn r12597) [NoAI] -Sync: with trunk r12501:12596.
rubidium
parents:
9826
diff
changeset
|
329 |
|
9476 | 330 |
foreach_draw_tile_seq(dtss, dts->seq) { |
9732 | 331 |
if (GB(dtss->image.sprite, 0, SPRITE_WIDTH) == 0) continue; |
9476 | 332 |
|
9732 | 333 |
image = dtss->image.sprite; |
334 |
pal = dtss->image.pal; |
|
9476 | 335 |
|
9704 | 336 |
if (IS_CUSTOM_SPRITE(image)) image += stage; |
337 |
||
9722
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
338 |
if ((HasBit(image, SPRITE_MODIFIER_OPAQUE) || !IsTransparencySet(TO_HOUSES)) && HasBit(image, PALETTE_MODIFIER_COLOR)) { |
9476 | 339 |
if (pal == 0) { |
340 |
const HouseSpec *hs = GetHouseSpecs(house_id); |
|
9722
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
341 |
if (HasBit(hs->callback_mask, CBM_HOUSE_COLOUR)) { |
9704 | 342 |
uint16 callback = GetHouseCallback(CBID_HOUSE_COLOUR, 0, 0, house_id, GetTownByTile(ti->tile), ti->tile); |
9476 | 343 |
if (callback != CALLBACK_FAILED) { |
344 |
/* If bit 14 is set, we should use a 2cc colour map, else use the callback value. */ |
|
9722
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
345 |
pal = HasBit(callback, 14) ? GB(callback, 0, 8) + SPR_2CCMAP_BASE : callback; |
9476 | 346 |
} |
347 |
} else { |
|
9869
6404afe43575
(svn r12597) [NoAI] -Sync: with trunk r12501:12596.
rubidium
parents:
9826
diff
changeset
|
348 |
pal = hs->random_colour[TileHash2Bit(ti->x, ti->y)] + PALETTE_RECOLOR_START; |
9476 | 349 |
} |
350 |
} |
|
351 |
} else { |
|
352 |
pal = PAL_NONE; |
|
353 |
} |
|
354 |
||
355 |
if ((byte)dtss->delta_z != 0x80) { |
|
356 |
AddSortableSpriteToDraw( |
|
357 |
image, pal, |
|
358 |
ti->x + dtss->delta_x, ti->y + dtss->delta_y, |
|
359 |
dtss->size_x, dtss->size_y, |
|
9694
e72987579514
(svn r10775) [NoAI] -Sync: with trunk r10535:r10774.
rubidium
parents:
9628
diff
changeset
|
360 |
dtss->size_z, ti->z + dtss->delta_z, |
9722
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
361 |
IsTransparencySet(TO_HOUSES) |
9476 | 362 |
); |
363 |
} else { |
|
9722
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
364 |
AddChildSpriteScreen(image, pal, (byte)dtss->delta_x, (byte)dtss->delta_y, IsTransparencySet(TO_HOUSES)); |
9476 | 365 |
} |
366 |
} |
|
367 |
} |
|
368 |
||
369 |
void DrawNewHouseTile(TileInfo *ti, HouseID house_id) |
|
370 |
{ |
|
371 |
const HouseSpec *hs = GetHouseSpecs(house_id); |
|
372 |
const SpriteGroup *group; |
|
373 |
ResolverObject object; |
|
374 |
||
9694
e72987579514
(svn r10775) [NoAI] -Sync: with trunk r10535:r10774.
rubidium
parents:
9628
diff
changeset
|
375 |
if (ti->tileh != SLOPE_FLAT) DrawFoundation(ti, FOUNDATION_LEVELED); |
9476 | 376 |
|
377 |
NewHouseResolver(&object, house_id, ti->tile, GetTownByTile(ti->tile)); |
|
378 |
||
379 |
group = Resolve(hs->spritegroup, &object); |
|
380 |
if (group == NULL || group->type != SGT_TILELAYOUT) { |
|
381 |
/* XXX: This is for debugging purposes really, and shouldn't stay. */ |
|
382 |
DrawGroundSprite(SPR_SHADOW_CELL, PAL_NONE); |
|
383 |
} else { |
|
384 |
/* Limit the building stage to the number of stages supplied. */ |
|
385 |
byte stage = GetHouseBuildingStage(ti->tile); |
|
9722
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
386 |
stage = Clamp(stage - 4 + group->g.layout.num_sprites, 0, group->g.layout.num_sprites - 1); |
9476 | 387 |
DrawTileLayout(ti, group, stage, house_id); |
388 |
} |
|
389 |
} |
|
390 |
||
391 |
void AnimateNewHouseTile(TileIndex tile) |
|
392 |
{ |
|
393 |
const HouseSpec *hs = GetHouseSpecs(GetHouseType(tile)); |
|
394 |
byte animation_speed = hs->animation_speed; |
|
395 |
bool frame_set_by_callback = false; |
|
396 |
||
9722
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
397 |
if (HasBit(hs->callback_mask, CBM_HOUSE_ANIMATION_SPEED)) { |
9624 | 398 |
uint16 callback_res = GetHouseCallback(CBID_HOUSE_ANIMATION_SPEED, 0, 0, GetHouseType(tile), GetTownByTile(tile), tile); |
9722
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
399 |
if (callback_res != CALLBACK_FAILED) animation_speed = Clamp(callback_res & 0xFF, 2, 16); |
9476 | 400 |
} |
401 |
||
402 |
/* An animation speed of 2 means the animation frame changes 4 ticks, and |
|
403 |
* increasing this value by one doubles the wait. 2 is the minimum value |
|
404 |
* allowed for animation_speed, which corresponds to 120ms, and 16 is the |
|
405 |
* maximum, corresponding to around 33 minutes. */ |
|
406 |
if (_tick_counter % (1 << animation_speed) != 0) return; |
|
407 |
||
408 |
byte frame = GetHouseAnimationFrame(tile); |
|
409 |
byte num_frames = GB(hs->animation_frames, 0, 7); |
|
410 |
||
9722
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
411 |
if (HasBit(hs->callback_mask, CBM_HOUSE_ANIMATION_NEXT_FRAME)) { |
9476 | 412 |
uint32 param = (hs->extra_flags & CALLBACK_1A_RANDOM_BITS) ? Random() : 0; |
9624 | 413 |
uint16 callback_res = GetHouseCallback(CBID_HOUSE_ANIMATION_NEXT_FRAME, param, 0, GetHouseType(tile), GetTownByTile(tile), tile); |
9476 | 414 |
|
415 |
if (callback_res != CALLBACK_FAILED) { |
|
416 |
frame_set_by_callback = true; |
|
417 |
||
418 |
switch (callback_res & 0xFF) { |
|
419 |
case 0xFF: |
|
420 |
DeleteAnimatedTile(tile); |
|
421 |
break; |
|
422 |
case 0xFE: |
|
423 |
/* Carry on as normal. */ |
|
424 |
frame_set_by_callback = false; |
|
425 |
break; |
|
426 |
default: |
|
427 |
frame = callback_res & 0xFF; |
|
428 |
break; |
|
429 |
} |
|
430 |
||
431 |
/* If the lower 7 bits of the upper byte of the callback |
|
432 |
* result are not empty, it is a sound effect. */ |
|
10294 | 433 |
if (GB(callback_res, 8, 7) != 0) PlayTileSound(hs->grffile, GB(callback_res, 8, 7), tile); |
9476 | 434 |
} |
435 |
} |
|
436 |
||
437 |
if (!frame_set_by_callback) { |
|
438 |
if (frame < num_frames) { |
|
439 |
frame++; |
|
9722
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
440 |
} else if (frame == num_frames && HasBit(hs->animation_frames, 7)) { |
9476 | 441 |
/* This animation loops, so start again from the beginning */ |
442 |
frame = 0; |
|
443 |
} else { |
|
444 |
/* This animation doesn't loop, so stay here */ |
|
445 |
DeleteAnimatedTile(tile); |
|
446 |
} |
|
447 |
} |
|
448 |
||
449 |
SetHouseAnimationFrame(tile, frame); |
|
450 |
MarkTileDirtyByTile(tile); |
|
451 |
} |
|
452 |
||
10294 | 453 |
void ChangeHouseAnimationFrame(const GRFFile *file, TileIndex tile, uint16 callback_result) |
9476 | 454 |
{ |
455 |
switch (callback_result & 0xFF) { |
|
456 |
case 0xFD: /* Do nothing. */ break; |
|
457 |
case 0xFE: AddAnimatedTile(tile); break; |
|
458 |
case 0xFF: DeleteAnimatedTile(tile); break; |
|
459 |
default: |
|
460 |
SetHouseAnimationFrame(tile, callback_result & 0xFF); |
|
461 |
AddAnimatedTile(tile); |
|
462 |
break; |
|
463 |
} |
|
464 |
/* If the lower 7 bits of the upper byte of the callback |
|
465 |
* result are not empty, it is a sound effect. */ |
|
10294 | 466 |
if (GB(callback_result, 8, 7) != 0) PlayTileSound(file, GB(callback_result, 8, 7), tile); |
9476 | 467 |
} |
468 |
||
469 |
bool CanDeleteHouse(TileIndex tile) |
|
470 |
{ |
|
471 |
const HouseSpec *hs = GetHouseSpecs(GetHouseType(tile)); |
|
472 |
||
473 |
/* Human players are always allowed to remove buildings, as is water and |
|
474 |
* anyone using the scenario editor. */ |
|
475 |
if ((IsValidPlayer(_current_player) && IsHumanPlayer(_current_player)) |
|
476 |
|| _current_player == OWNER_WATER || _current_player == OWNER_NONE) return true; |
|
477 |
||
9722
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
478 |
if (HasBit(hs->callback_mask, CBM_HOUSE_DENY_DESTRUCTION)) { |
9624 | 479 |
uint16 callback_res = GetHouseCallback(CBID_HOUSE_DENY_DESTRUCTION, 0, 0, GetHouseType(tile), GetTownByTile(tile), tile); |
9476 | 480 |
return (callback_res == CALLBACK_FAILED || callback_res == 0); |
481 |
} else { |
|
482 |
return !(hs->extra_flags & BUILDING_IS_PROTECTED); |
|
483 |
} |
|
484 |
} |
|
485 |
||
486 |
static void AnimationControl(TileIndex tile, uint16 random_bits) |
|
487 |
{ |
|
488 |
const HouseSpec *hs = GetHouseSpecs(GetHouseType(tile)); |
|
489 |
||
9722
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
490 |
if (HasBit(hs->callback_mask, CBM_HOUSE_ANIMATION_START_STOP)) { |
9476 | 491 |
uint32 param = (hs->extra_flags & SYNCHRONISED_CALLBACK_1B) ? (GB(Random(), 0, 16) | random_bits << 16) : Random(); |
9624 | 492 |
uint16 callback_res = GetHouseCallback(CBID_HOUSE_ANIMATION_START_STOP, param, 0, GetHouseType(tile), GetTownByTile(tile), tile); |
9476 | 493 |
|
10294 | 494 |
if (callback_res != CALLBACK_FAILED) ChangeHouseAnimationFrame(hs->grffile, tile, callback_res); |
9476 | 495 |
} |
496 |
} |
|
497 |
||
498 |
bool NewHouseTileLoop(TileIndex tile) |
|
499 |
{ |
|
500 |
const HouseSpec *hs = GetHouseSpecs(GetHouseType(tile)); |
|
501 |
||
502 |
if (GetHouseProcessingTime(tile) > 0) { |
|
503 |
DecHouseProcessingTime(tile); |
|
504 |
return true; |
|
505 |
} |
|
506 |
||
9722
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
507 |
TriggerHouse(tile, HOUSE_TRIGGER_TILE_LOOP); |
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
508 |
TriggerHouse(tile, HOUSE_TRIGGER_TILE_LOOP_TOP); |
9476 | 509 |
|
9722
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
510 |
if (HasBit(hs->callback_mask, CBM_HOUSE_ANIMATION_START_STOP)) { |
9476 | 511 |
/* If this house is marked as having a synchronised callback, all the |
512 |
* tiles will have the callback called at once, rather than when the |
|
513 |
* tile loop reaches them. This should only be enabled for the northern |
|
514 |
* tile, or strange things will happen (here, and in TTDPatch). */ |
|
515 |
if (hs->extra_flags & SYNCHRONISED_CALLBACK_1B) { |
|
516 |
uint16 random = GB(Random(), 0, 16); |
|
517 |
||
518 |
if (hs->building_flags & BUILDING_HAS_1_TILE) AnimationControl(tile, random); |
|
519 |
if (hs->building_flags & BUILDING_2_TILES_Y) AnimationControl(TILE_ADDXY(tile, 0, 1), random); |
|
520 |
if (hs->building_flags & BUILDING_2_TILES_X) AnimationControl(TILE_ADDXY(tile, 1, 0), random); |
|
521 |
if (hs->building_flags & BUILDING_HAS_4_TILES) AnimationControl(TILE_ADDXY(tile, 1, 1), random); |
|
522 |
} else { |
|
523 |
AnimationControl(tile, 0); |
|
524 |
} |
|
525 |
} |
|
526 |
||
527 |
/* Check callback 21, which determines if a house should be destroyed. */ |
|
9722
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
528 |
if (HasBit(hs->callback_mask, CBM_HOUSE_DESTRUCTION)) { |
9624 | 529 |
uint16 callback_res = GetHouseCallback(CBID_HOUSE_DESTRUCTION, 0, 0, GetHouseType(tile), GetTownByTile(tile), tile); |
10294 | 530 |
if (callback_res != CALLBACK_FAILED && GB(callback_res, 0, 8) > 0) { |
9476 | 531 |
ClearTownHouse(GetTownByTile(tile), tile); |
532 |
return false; |
|
533 |
} |
|
534 |
} |
|
535 |
||
536 |
SetHouseProcessingTime(tile, hs->processing_time); |
|
537 |
return true; |
|
538 |
} |
|
9722
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
539 |
|
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
540 |
static void DoTriggerHouse(TileIndex tile, HouseTrigger trigger, byte base_random, bool first) |
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
541 |
{ |
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
542 |
ResolverObject object; |
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
543 |
|
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
544 |
/* We can't trigger a non-existent building... */ |
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
545 |
assert(IsTileType(tile, MP_HOUSE)); |
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
546 |
|
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
547 |
HouseID hid = GetHouseType(tile); |
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
548 |
HouseSpec *hs = GetHouseSpecs(hid); |
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
549 |
|
10355
ee4b5f7a5bf2
(svn r12896) [NoAI] -Sync: with trunk r12824:r12895.
rubidium
parents:
10294
diff
changeset
|
550 |
if (hs->spritegroup == NULL) return; |
ee4b5f7a5bf2
(svn r12896) [NoAI] -Sync: with trunk r12824:r12895.
rubidium
parents:
10294
diff
changeset
|
551 |
|
9722
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
552 |
NewHouseResolver(&object, hid, tile, GetTownByTile(tile)); |
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
553 |
|
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
554 |
object.callback = CBID_RANDOM_TRIGGER; |
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
555 |
object.trigger = trigger; |
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
556 |
|
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
557 |
const SpriteGroup *group = Resolve(hs->spritegroup, &object); |
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
558 |
if (group == NULL) return; |
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
559 |
|
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
560 |
byte new_random_bits = Random(); |
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
561 |
byte random_bits = GetHouseRandomBits(tile); |
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
562 |
random_bits &= ~object.reseed; |
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
563 |
random_bits |= (first ? new_random_bits : base_random) & object.reseed; |
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
564 |
SetHouseRandomBits(tile, random_bits); |
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
565 |
|
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
566 |
switch (trigger) { |
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
567 |
case HOUSE_TRIGGER_TILE_LOOP: |
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
568 |
/* Random value already set. */ |
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
569 |
break; |
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
570 |
|
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
571 |
case HOUSE_TRIGGER_TILE_LOOP_TOP: |
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
572 |
if (!first) break; |
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
573 |
/* Random value of first tile already set. */ |
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
574 |
if (hs->building_flags & BUILDING_2_TILES_Y) DoTriggerHouse(TILE_ADDXY(tile, 0, 1), trigger, random_bits, false); |
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
575 |
if (hs->building_flags & BUILDING_2_TILES_X) DoTriggerHouse(TILE_ADDXY(tile, 1, 0), trigger, random_bits, false); |
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
576 |
if (hs->building_flags & BUILDING_HAS_4_TILES) DoTriggerHouse(TILE_ADDXY(tile, 1, 1), trigger, random_bits, false); |
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
577 |
break; |
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
578 |
} |
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
579 |
} |
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
580 |
|
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
581 |
void TriggerHouse(TileIndex t, HouseTrigger trigger) |
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
582 |
{ |
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
583 |
DoTriggerHouse(t, trigger, 0, true); |
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
584 |
} |