MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / SelectConnectedRooms

Function SelectConnectedRooms

editor/selectedroom.cpp:145–165  ·  view source on GitHub ↗

Add all the connected room to the selected list Parameters: room - the starting room Returns: the number of rooms added to the list

Source from the content-addressed store, hash-verified

143// Parameters: room - the starting room
144// Returns: the number of rooms added to the list
145int SelectConnectedRooms(int roomnum) {
146 int count;
147 int s;
148
149 if (IsRoomSelected(roomnum)) // this room already selected?
150 return 0;
151
152 // Add this rooom to selected list
153 Selected_rooms[N_selected_rooms++] = roomnum;
154 count = 1;
155
156 State_changed = 1;
157
158 // Now add this room's children
159 for (s = 0; s < Rooms[roomnum].num_portals; s++) {
160 if (Rooms[roomnum].portals[s].croom != -1)
161 count += SelectConnectedRooms(Rooms[roomnum].portals[s].croom);
162 }
163
164 return count;
165}
166
167static int *Save_selected_rooms;
168static int N_save_selected_rooms = -1; //-1 means empty list

Callers 2

OnEditSelectAttachedMethod · 0.85
RotateRoomsFunction · 0.85

Calls 1

IsRoomSelectedFunction · 0.85

Tested by

no test coverage detected