diff --git a/game/reconstructed/powersub.cpp b/game/reconstructed/powersub.cpp index ae8ca76..82a66dc 100644 --- a/game/reconstructed/powersub.cpp +++ b/game/reconstructed/powersub.cpp @@ -367,8 +367,18 @@ void // (file-static one-shot, NOT an instance member: the PoweredSubsystem layout // is byte-locked by PoweredSubsystemLayoutCheck -- adding a field would // break sizeof and every offset assert downstream.) + // BT_POWER_DETACH_TEST=1 detaches the FIRST powered subsystem to tick; + // BT_POWER_DETACH_TEST= targets one by name (e.g. PPC_1, ERSLaser_1), + // which is what proves the failover on a WEAPON rather than on Avionics. + // Pair it with BT_BTNTEST=0x1a,, to switch GeneratorA off + // mid-mission through its real RIO button: the hunt must then re-attach the + // subsystem to a DIFFERENT generator, which is the case players actually hit + // (their generator dies) and the one a same-generator re-attach never tests. static int s_detachTestDone = 0; - if (getenv("BT_POWER_DETACH_TEST") && !s_detachTestDone) + const char *detach_want = getenv("BT_POWER_DETACH_TEST"); + if (detach_want != 0 && !s_detachTestDone + && (detach_want[0] == '\0' || detach_want[1] == '\0' // "1" / empty = first one + || (GetName() != 0 && strcmp(GetName(), detach_want) == 0))) { s_detachTestDone = 1; DEBUG_STREAM << "[power] TEST: detaching " << GetName()