diff options
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/datapacker/main.cpp | 4 | ||||
| -rw-r--r-- | tools/validator/human_processor.cpp | 5 | ||||
| -rw-r--r-- | tools/validator/structs.h | 2 | ||||
| -rw-r--r-- | tools/validator/validator.cpp | 11 |
4 files changed, 21 insertions, 1 deletions
| diff --git a/tools/datapacker/main.cpp b/tools/datapacker/main.cpp index 3ddb11f..d9fcbe2 100644 --- a/tools/datapacker/main.cpp +++ b/tools/datapacker/main.cpp | |||
| @@ -380,6 +380,10 @@ class DataPacker { | |||
| 380 | door.add_doors( | 380 | door.add_doors( |
| 381 | container_.FindOrAddDoor(map_name, di.name(), current_map_name)); | 381 | container_.FindOrAddDoor(map_name, di.name(), current_map_name)); |
| 382 | } | 382 | } |
| 383 | |||
| 384 | for (const std::string& ending_name : h_door.endings()) { | ||
| 385 | door.add_endings(container_.FindOrAddEnding(ending_name)); | ||
| 386 | } | ||
| 383 | 387 | ||
| 384 | if (h_door.has_control_center_color()) { | 388 | if (h_door.has_control_center_color()) { |
| 385 | door.set_control_center_color(h_door.control_center_color()); | 389 | door.set_control_center_color(h_door.control_center_color()); |
| diff --git a/tools/validator/human_processor.cpp b/tools/validator/human_processor.cpp index 5a7e78a..f53dc79 100644 --- a/tools/validator/human_processor.cpp +++ b/tools/validator/human_processor.cpp | |||
| @@ -337,6 +337,11 @@ class HumanProcessor { | |||
| 337 | DoorInfo& other_door_info = info_.doors[complete_door_identifier]; | 337 | DoorInfo& other_door_info = info_.doors[complete_door_identifier]; |
| 338 | other_door_info.doors_referenced_by.push_back(door_identifier); | 338 | other_door_info.doors_referenced_by.push_back(door_identifier); |
| 339 | } | 339 | } |
| 340 | |||
| 341 | for (const std::string& ei : h_door.endings()) { | ||
| 342 | EndingInfo& ending_info = info_.endings[ei]; | ||
| 343 | ending_info.doors_referenced_by.push_back(door_identifier); | ||
| 344 | } | ||
| 340 | } | 345 | } |
| 341 | 346 | ||
| 342 | void ProcessConnectionsFile(std::filesystem::path path, | 347 | void ProcessConnectionsFile(std::filesystem::path path, |
| diff --git a/tools/validator/structs.h b/tools/validator/structs.h index f7d9dc1..958038d 100644 --- a/tools/validator/structs.h +++ b/tools/validator/structs.h | |||
| @@ -92,6 +92,8 @@ struct LetterInfo { | |||
| 92 | 92 | ||
| 93 | struct EndingInfo { | 93 | struct EndingInfo { |
| 94 | std::vector<RoomIdentifier> defined_in; | 94 | std::vector<RoomIdentifier> defined_in; |
| 95 | |||
| 96 | std::vector<DoorIdentifier> doors_referenced_by; | ||
| 95 | }; | 97 | }; |
| 96 | 98 | ||
| 97 | struct CollectedInfo { | 99 | struct CollectedInfo { |
| diff --git a/tools/validator/validator.cpp b/tools/validator/validator.cpp index b33f602..f802460 100644 --- a/tools/validator/validator.cpp +++ b/tools/validator/validator.cpp | |||
| @@ -245,7 +245,16 @@ void ValidateLetter(const LetterIdentifier& letter_identifier, | |||
| 245 | 245 | ||
| 246 | void ValidateEnding(const std::string& ending_name, | 246 | void ValidateEnding(const std::string& ending_name, |
| 247 | const EndingInfo& ending_info) { | 247 | const EndingInfo& ending_info) { |
| 248 | if (ending_info.defined_in.size() > 1) { | 248 | if (ending_info.defined_in.empty()) { |
| 249 | std::cout << "Ending " << ending_name | ||
| 250 | << " has no definition, but was referenced:" << std::endl; | ||
| 251 | |||
| 252 | for (const DoorIdentifier& door_identifier : | ||
| 253 | ending_info.doors_referenced_by) { | ||
| 254 | std::cout << " DOOR " << door_identifier.ShortDebugString() | ||
| 255 | << std::endl; | ||
| 256 | } | ||
| 257 | } else if (ending_info.defined_in.size() > 1) { | ||
| 249 | std::cout << "Ending " << ending_name | 258 | std::cout << "Ending " << ending_name |
| 250 | << " was defined in multiple places:" << std::endl; | 259 | << " was defined in multiple places:" << std::endl; |
| 251 | 260 | ||
