From b404f89e166479ebecb1291454405d068411e3da Mon Sep 17 00:00:00 2001 From: alex Date: Mon, 7 Sep 2026 22:14:37 -0400 Subject: [PATCH] tests: restore remaining 'requires' data-key text in fixtures --- src/game/data/techtree.h | 2 +- src/game/design/rules.cpp | 8 ++++---- tests/game_design/mini_catalog.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/game/data/techtree.h b/src/game/data/techtree.h index 6cd77d8..9c01173 100644 --- a/src/game/data/techtree.h +++ b/src/game/data/techtree.h @@ -2,7 +2,7 @@ // // tech { // name "IND_Waldo" family "IND" type P threat N group TORPS option_cost 1.2 -// requires_tech "TECH" | "GRP_" -- prerequisite beyond the allows edge +// requires "TECH" | "GRP_" -- prerequisite beyond the allows edge // allows "CHILD RP:cost Human:% Zuul:% Hiver:% Tarkas:% Liir:% Morrigi:%" // strategy { inc TECHBEN_X dec TECHBEN_Y } // ship { section STEM ... } -- "new section" notice (not a build gate) diff --git a/src/game/design/rules.cpp b/src/game/design/rules.cpp index fd84cfe..902bf50 100644 --- a/src/game/design/rules.cpp +++ b/src/game/design/rules.cpp @@ -248,7 +248,7 @@ std::vector Ruleset::validate(const Design& d) const { if (want->empty()) continue; if (!part->def || !iequals(part->def->stem, *want)) add(v, "A8", Level::Error, - m.stem + " requires_tech " + slot_str(part->slot) + " section " + *want + ", got " + + m.stem + " requires " + slot_str(part->slot) + " section " + *want + ", got " + (part->def ? part->def->stem : std::string("none")), part->slot); } @@ -366,7 +366,7 @@ std::vector Ruleset::validate(const Design& d) const { } if (known && bank.weapon.empty()) for (const std::string& t : w->requires_tech) - if (!known->satisfies(cat.tech, t)) add(v, "C2", Level::Error, w->stem + " requires_tech " + t, p->slot, bi); + if (!known->satisfies(cat.tech, t)) add(v, "C2", Level::Error, w->stem + " requires " + t, p->slot, bi); } } @@ -403,9 +403,9 @@ std::vector Ruleset::validate(const Design& d) const { if (!cat.tech.find(t) && !data::is_group_ref(t)) add(v, "C1", Level::Warn, s.stem + " requires unknown tech " + t, p->slot); else if (known && !known->satisfies(cat.tech, t)) - add(v, "C1", gate, s.stem + " requires_tech " + t, p->slot); + add(v, "C1", gate, s.stem + " requires " + t, p->slot); if (unobtainable(t, race)) - add(v, "C5", Level::Error, s.stem + " requires_tech " + t + ", which " + std::string(rk) + " can never research", p->slot); + add(v, "C5", Level::Error, s.stem + " requires " + t + ", which " + std::string(rk) + " can never research", p->slot); } if (auto hct = hull_class_tech(s); hct && known && !known->satisfies(cat.tech, *hct)) add(v, "C4", gate, s.stem + " is a " + fold(s.section_class_text) + " section; " + *hct + " not researched", p->slot); diff --git a/tests/game_design/mini_catalog.cpp b/tests/game_design/mini_catalog.cpp index dd55265..9e74680 100644 --- a/tests/game_design/mini_catalog.cpp +++ b/tests/game_design/mini_catalog.cpp @@ -43,7 +43,7 @@ std::string de_armor(const char* extra = "") { std::string de_fission(const char* drive) { return "shipsection { model c.X Section_Type Engine section_class Destroyer socket_fore EngineNode\n" - " requires DRV_Fissn requires_tech " + std::string(drive) + + " requires DRV_Fissn requires " + std::string(drive) + "\n health 450 mass 2500 cost 5000 cpoints 1380 engine_techera fission ftlspeed .2 nodespeed 4 range 9\n" + std::string(kArmorOptions) + " option DRV_RecFiss\n" " netforcelimits { force_forward 23000 force_right 23000 force_up 23000 torque_yaw 5 torque_pitch 5 torque_roll 5 speed 40 rotspeed 10 }\n" +