about summary refs log tree commit diff stats
path: root/tools/assign_ids
diff options
context:
space:
mode:
Diffstat (limited to 'tools/assign_ids')
-rw-r--r--tools/assign_ids/main.cpp35
1 files changed, 34 insertions, 1 deletions
diff --git a/tools/assign_ids/main.cpp b/tools/assign_ids/main.cpp index 357566a..4cf7c3f 100644 --- a/tools/assign_ids/main.cpp +++ b/tools/assign_ids/main.cpp
@@ -65,6 +65,7 @@ class AssignIds {
65 UpdateNextId(room.panels()); 65 UpdateNextId(room.panels());
66 UpdateNextId(room.masteries()); 66 UpdateNextId(room.masteries());
67 UpdateNextId(room.keyholders()); 67 UpdateNextId(room.keyholders());
68 UpdateNextId(room.ports());
68 } 69 }
69 } 70 }
70 71
@@ -111,7 +112,8 @@ class AssignIds {
111 112
112 void ProcessDoor(const HumanDoor& h_door, 113 void ProcessDoor(const HumanDoor& h_door,
113 const std::string& current_map_name) { 114 const std::string& current_map_name) {
114 if (h_door.type() == DoorType::EVENT && !h_door.latch()) { 115 if (h_door.type() == DoorType::EVENT && !h_door.latch() &&
116 !h_door.legacy_location()) {
115 return; 117 return;
116 } 118 }
117 119
@@ -245,6 +247,37 @@ class AssignIds {
245 .at(h_keyholder.name()); 247 .at(h_keyholder.name());
246 } 248 }
247 } 249 }
250
251 for (const HumanPort& h_port : h_room.ports()) {
252 if (h_port.no_shuffle()) {
253 continue;
254 }
255
256 auto& maps = *output_.mutable_maps();
257 auto& rooms = *maps[current_map_name].mutable_rooms();
258 auto& ports = *rooms[h_room.name()].mutable_ports();
259
260 if (!id_mappings_.maps().contains(current_map_name) ||
261 !id_mappings_.maps()
262 .at(current_map_name)
263 .rooms()
264 .contains(h_room.name()) ||
265 !id_mappings_.maps()
266 .at(current_map_name)
267 .rooms()
268 .at(h_room.name())
269 .ports()
270 .contains(h_port.name())) {
271 ports[h_port.name()] = next_id_++;
272 } else {
273 ports[h_port.name()] = id_mappings_.maps()
274 .at(current_map_name)
275 .rooms()
276 .at(h_room.name())
277 .ports()
278 .at(h_port.name());
279 }
280 }
248 } 281 }
249 282
250 void ProcessSpecialIds() { 283 void ProcessSpecialIds() {