Skip to content

Commit c94a5bd

Browse files
committed
refactor: move house runtime_data from common building class
1 parent c0283ea commit c94a5bd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+1169
-773
lines changed

src/building/building.cpp

-8
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ void building::new_fill_in_data_for_type(e_building_type _tp, tile2i _tl, int or
7272
reserved_id = false; // city_buildings_unknown_value();
7373
size = props.building_size;
7474
//creation_sequence_index = building_extra_data.created_sequence++;
75-
sentiment.house_happiness = 50;
7675
distance_from_entry = 0;
7776

7877
map_random_7bit = map_random_get(tile.grid_offset()) & 0x7f;
@@ -93,13 +92,6 @@ void building::new_fill_in_data_for_type(e_building_type _tp, tile2i _tl, int or
9392
house_size = 4;
9493
}
9594

96-
// subtype
97-
if (is_house()) {
98-
data.house.level = (e_house_level)(type - BUILDING_HOUSE_VACANT_LOT);
99-
} else {
100-
data.house.level = HOUSE_CRUDE_HUT;
101-
}
102-
10395
// unique data
10496
output_resource_first_id = RESOURCE_NONE;
10597
dcast()->on_create(orientation);

src/building/building.h

-38
Original file line numberDiff line numberDiff line change
@@ -216,43 +216,6 @@ class building {
216216
union impl_data_t {
217217
char data[512] = { 0 };
218218

219-
struct {
220-
e_house_level level;
221-
uint16_t foods[8];
222-
uint16_t inventory[8];
223-
uint8_t booth_juggler;
224-
uint8_t bandstand_juggler;
225-
uint8_t bandstand_musician;
226-
uint8_t pavillion_musician;
227-
uint8_t pavillion_dancer;
228-
uint8_t senet_player;
229-
uint8_t magistrate;
230-
uint8_t bullfighter;
231-
uint8_t school;
232-
uint8_t library;
233-
uint8_t academy;
234-
uint8_t apothecary;
235-
uint8_t dentist;
236-
uint8_t mortuary;
237-
uint8_t physician;
238-
uint8_t temple_osiris;
239-
uint8_t temple_ra;
240-
uint8_t temple_ptah;
241-
uint8_t temple_seth;
242-
uint8_t temple_bast;
243-
uint8_t no_space_to_expand;
244-
uint8_t num_foods;
245-
uint8_t entertainment;
246-
uint8_t education;
247-
uint8_t health;
248-
uint8_t num_gods;
249-
uint8_t shrine_access;
250-
uint8_t devolve_delay;
251-
uint8_t evolve_text_id;
252-
uint8_t bazaar_access;
253-
uint8_t water_supply;
254-
} house;
255-
256219
struct {
257220
uint8_t variant;
258221
uint8_t statue_offset;
@@ -275,7 +238,6 @@ class building {
275238
bool is_adjacent_to_water;
276239
uint16_t storage_id;
277240
union {
278-
signed char house_happiness;
279241
signed char native_anger;
280242
} sentiment;
281243
animation_t minimap_anim;

0 commit comments

Comments
 (0)