diff --git a/restoration/source410/BT/EMITTER.CPP b/restoration/source410/BT/EMITTER.CPP index 15185618..369fe6f8 100644 --- a/restoration/source410/BT/EMITTER.CPP +++ b/restoration/source410/BT/EMITTER.CPP @@ -194,7 +194,14 @@ Emitter::Emitter( // updates / ServiceDischarge instead -- that path joins the network wave.) // weaponAlarm.SetLevel(LoadingState); - if (owner->GetInstance() != Entity::ReplicantInstance) + // The binary's master gate: MasterInstance + DynamicFlag -- the + // simulationFlags 0xC/0x100 pair, now decoded as engine enum identities + // (InstanceBits=2 makes InstanceMask 0xC; DynamicBit=8 makes DynamicFlag + // 0x100; Entity::DefaultFlags carries both, seeded from the MakeMessage). + if ( + (owner->simulationFlags & Entity::InstanceMask) == Entity::MasterInstance && + (owner->simulationFlags & Entity::DynamicFlag) != 0 + ) { SetPerformance(&Emitter::EmitterSimulation); } diff --git a/restoration/source410/BT/GYRO.CPP b/restoration/source410/BT/GYRO.CPP index b2b8d62e..909004cd 100644 --- a/restoration/source410/BT/GYRO.CPP +++ b/restoration/source410/BT/GYRO.CPP @@ -120,7 +120,14 @@ Gyroscope::Gyroscope( // // The master instance runs the gyro per-frame. // - if (owner->GetInstance() != Entity::ReplicantInstance) + // The binary's master gate: MasterInstance + DynamicFlag -- the + // simulationFlags 0xC/0x100 pair, now decoded as engine enum identities + // (InstanceBits=2 makes InstanceMask 0xC; DynamicBit=8 makes DynamicFlag + // 0x100; Entity::DefaultFlags carries both, seeded from the MakeMessage). + if ( + (owner->simulationFlags & Entity::InstanceMask) == Entity::MasterInstance && + (owner->simulationFlags & Entity::DynamicFlag) != 0 + ) { SetPerformance(&Gyroscope::GyroscopeSimulation); } diff --git a/restoration/source410/BT/HEAT.CPP b/restoration/source410/BT/HEAT.CPP index 13fde9ba..66b1ae55 100644 --- a/restoration/source410/BT/HEAT.CPP +++ b/restoration/source410/BT/HEAT.CPP @@ -418,7 +418,14 @@ HeatSink::HeatSink( // the weapons) override with their own Performance in their ctors, each of // which chains this step. // - if (owner->GetInstance() != Entity::ReplicantInstance) + // The binary's master gate: MasterInstance + DynamicFlag -- the + // simulationFlags 0xC/0x100 pair, now decoded as engine enum identities + // (InstanceBits=2 makes InstanceMask 0xC; DynamicBit=8 makes DynamicFlag + // 0x100; Entity::DefaultFlags carries both, seeded from the MakeMessage). + if ( + (owner->simulationFlags & Entity::InstanceMask) == Entity::MasterInstance && + (owner->simulationFlags & Entity::DynamicFlag) != 0 + ) { SetPerformance(&HeatSink::HeatSinkSimulation); } @@ -875,7 +882,14 @@ HeatWatcher::HeatWatcher( // the segment-copy mask + the master flag; our tree's established // equivalent is the replicant test every sibling ctor uses). // - if (owner->GetInstance() != Entity::ReplicantInstance) + // The binary's master gate: MasterInstance + DynamicFlag -- the + // simulationFlags 0xC/0x100 pair, now decoded as engine enum identities + // (InstanceBits=2 makes InstanceMask 0xC; DynamicBit=8 makes DynamicFlag + // 0x100; Entity::DefaultFlags carries both, seeded from the MakeMessage). + if ( + (owner->simulationFlags & Entity::InstanceMask) == Entity::MasterInstance && + (owner->simulationFlags & Entity::DynamicFlag) != 0 + ) { SetPerformance(&HeatWatcher::WatchSimulation); } @@ -1045,7 +1059,14 @@ Condenser::Condenser( // // Install the per-frame refrigeration Performance. // - if (owner->GetInstance() != Entity::ReplicantInstance) + // The binary's master gate: MasterInstance + DynamicFlag -- the + // simulationFlags 0xC/0x100 pair, now decoded as engine enum identities + // (InstanceBits=2 makes InstanceMask 0xC; DynamicBit=8 makes DynamicFlag + // 0x100; Entity::DefaultFlags carries both, seeded from the MakeMessage). + if ( + (owner->simulationFlags & Entity::InstanceMask) == Entity::MasterInstance && + (owner->simulationFlags & Entity::DynamicFlag) != 0 + ) { SetPerformance(&Condenser::RefrigerationSimulation); } @@ -1226,7 +1247,14 @@ AggregateHeatSink::AggregateHeatSink( << " conductance=" << thermalConductance << endl << flush; } - if (owner->GetInstance() != Entity::ReplicantInstance) + // The binary's master gate: MasterInstance + DynamicFlag -- the + // simulationFlags 0xC/0x100 pair, now decoded as engine enum identities + // (InstanceBits=2 makes InstanceMask 0xC; DynamicBit=8 makes DynamicFlag + // 0x100; Entity::DefaultFlags carries both, seeded from the MakeMessage). + if ( + (owner->simulationFlags & Entity::InstanceMask) == Entity::MasterInstance && + (owner->simulationFlags & Entity::DynamicFlag) != 0 + ) { SetPerformance(&AggregateHeatSink::RadiatorSimulation); } diff --git a/restoration/source410/BT/HUD.CPP b/restoration/source410/BT/HUD.CPP index 8c427094..c616e883 100644 --- a/restoration/source410/BT/HUD.CPP +++ b/restoration/source410/BT/HUD.CPP @@ -84,7 +84,14 @@ HUD::HUD( // // The master instance runs the HUD per-frame. // - if (owner->GetInstance() != Entity::ReplicantInstance) + // The binary's master gate: MasterInstance + DynamicFlag -- the + // simulationFlags 0xC/0x100 pair, now decoded as engine enum identities + // (InstanceBits=2 makes InstanceMask 0xC; DynamicBit=8 makes DynamicFlag + // 0x100; Entity::DefaultFlags carries both, seeded from the MakeMessage). + if ( + (owner->simulationFlags & Entity::InstanceMask) == Entity::MasterInstance && + (owner->simulationFlags & Entity::DynamicFlag) != 0 + ) { SetPerformance(&HUD::HudSimulation); } diff --git a/restoration/source410/BT/MYOMERS.CPP b/restoration/source410/BT/MYOMERS.CPP index 0b9d43e9..21b2e40f 100644 --- a/restoration/source410/BT/MYOMERS.CPP +++ b/restoration/source410/BT/MYOMERS.CPP @@ -111,7 +111,14 @@ Myomers::Myomers( // The master instance runs the myomer per-frame (the same gate every // sibling uses; the binary's is the segment-copy/master flag pair). // - if (owner->GetInstance() != Entity::ReplicantInstance) + // The binary's master gate: MasterInstance + DynamicFlag -- the + // simulationFlags 0xC/0x100 pair, now decoded as engine enum identities + // (InstanceBits=2 makes InstanceMask 0xC; DynamicBit=8 makes DynamicFlag + // 0x100; Entity::DefaultFlags carries both, seeded from the MakeMessage). + if ( + (owner->simulationFlags & Entity::InstanceMask) == Entity::MasterInstance && + (owner->simulationFlags & Entity::DynamicFlag) != 0 + ) { SetPerformance(&Myomers::MyomersSimulation); } diff --git a/restoration/source410/BT/POWERSUB.CPP b/restoration/source410/BT/POWERSUB.CPP index 6ff69708..a81dcc81 100644 --- a/restoration/source410/BT/POWERSUB.CPP +++ b/restoration/source410/BT/POWERSUB.CPP @@ -167,7 +167,14 @@ PoweredSubsystem::PoweredSubsystem( // simulation. Derived subsystems (the weapons, Sensor, ...) override with // their own Performance in their ctors, each of which chains this step. // - if (owner->GetInstance() != Entity::ReplicantInstance) + // The binary's master gate: MasterInstance + DynamicFlag -- the + // simulationFlags 0xC/0x100 pair, now decoded as engine enum identities + // (InstanceBits=2 makes InstanceMask 0xC; DynamicBit=8 makes DynamicFlag + // 0x100; Entity::DefaultFlags carries both, seeded from the MakeMessage). + if ( + (owner->simulationFlags & Entity::InstanceMask) == Entity::MasterInstance && + (owner->simulationFlags & Entity::DynamicFlag) != 0 + ) { SetPerformance(&PoweredSubsystem::PoweredSubsystemSimulation); } @@ -665,7 +672,14 @@ Generator::Generator( // // Install the generator's per-frame electrical Performance. // - if (owner->GetInstance() != Entity::ReplicantInstance) + // The binary's master gate: MasterInstance + DynamicFlag -- the + // simulationFlags 0xC/0x100 pair, now decoded as engine enum identities + // (InstanceBits=2 makes InstanceMask 0xC; DynamicBit=8 makes DynamicFlag + // 0x100; Entity::DefaultFlags carries both, seeded from the MakeMessage). + if ( + (owner->simulationFlags & Entity::InstanceMask) == Entity::MasterInstance && + (owner->simulationFlags & Entity::DynamicFlag) != 0 + ) { SetPerformance(&Generator::GeneratorSimulation); } @@ -797,7 +811,14 @@ PowerWatcher::PowerWatcher( // // Install the per-frame watchdog on the master instance. // - if (owner->GetInstance() != Entity::ReplicantInstance) + // The binary's master gate: MasterInstance + DynamicFlag -- the + // simulationFlags 0xC/0x100 pair, now decoded as engine enum identities + // (InstanceBits=2 makes InstanceMask 0xC; DynamicBit=8 makes DynamicFlag + // 0x100; Entity::DefaultFlags carries both, seeded from the MakeMessage). + if ( + (owner->simulationFlags & Entity::InstanceMask) == Entity::MasterInstance && + (owner->simulationFlags & Entity::DynamicFlag) != 0 + ) { SetPerformance(&PowerWatcher::Simulation); } diff --git a/restoration/source410/BT/TORSO.CPP b/restoration/source410/BT/TORSO.CPP index da3ca778..634714b4 100644 --- a/restoration/source410/BT/TORSO.CPP +++ b/restoration/source410/BT/TORSO.CPP @@ -87,7 +87,6 @@ Torso::Torso( Check(owner); Check_Pointer(r); - isDamagedCopy = (owner->GetInstance() == Entity::ReplicantInstance); statusFlags = 0; buttonAccelerationPerSecond = r->buttonAccelerationPerSecond; @@ -168,19 +167,25 @@ Torso::Torso( lastUpdateTime = 0L; // - // Install the per-frame Performance. The binary's gate @004b6b0c is - // (owner->simulationFlags & 0xC) == 0 && (owner->simulationFlags & 0x100) - // != 0 -- the master-segment flag pair seeded by the mech stream builders, - // which are not reconstructed yet. [T2] Until they land, the whole - // watcher family mirrors that gate with the instance test (same sites: - // heat.cpp / powersub.cpp / gyro.cpp registrations); revisit together. + // Install the per-frame Performance -- the binary's gate @004b6b0c + // verbatim: (flags & 0xC) == 0 && (flags & 0x100) != 0, which decodes to + // the engine's own MasterInstance + DynamicFlag (InstanceBits=2 puts the + // instance field at mask 0xC with ReplicantInstance=4; DynamicBit=8 is + // 0x100). Entity::DefaultFlags = DynamicFlag|MasterInstance and the + // engine seeds simulationFlags from the MakeMessage, so the gate is live + // with no stream-builder dependency. [T2 RETIRED 5.3.119.] // - if (owner->GetInstance() != Entity::ReplicantInstance) + if ( + (owner->simulationFlags & Entity::InstanceMask) == Entity::MasterInstance && + (owner->simulationFlags & Entity::DynamicFlag) != 0 + ) { + isDamagedCopy = 0; SetPerformance(&Torso::TorsoSimulation); } else { + isDamagedCopy = 1; SetPerformance(&Torso::TorsoCopySimulation); // binary PTR @00510c1c } diff --git a/restoration/source410/BT/TORSO.NOTES.md b/restoration/source410/BT/TORSO.NOTES.md index 055d6efb..773a957d 100644 --- a/restoration/source410/BT/TORSO.NOTES.md +++ b/restoration/source410/BT/TORSO.NOTES.md @@ -75,10 +75,15 @@ Members carved from `dynamicsState[16]` → `[12]`: `targetTwist` @0x218, `twistAtUpdate` @0x21C, `twistRate` @0x238, `lastUpdateTime` @0x254 (`Time`, init `0L` — plain `0` is ambiguous between the long/float assignment operators under BC4.52). Ctor now registers the copy Performance on replicants -(binary PTR @00510c1c). [T2] The registration gate mirrors the binary's -`(owner->simulationFlags & 0xC) == 0 && (flags & 0x100) != 0` with the -instance test, consistent with the whole watcher family, until the mech -stream builders (which seed those flag bits) are reconstructed. +(binary PTR @00510c1c). [T2 RETIRED 5.3.119] The gate is now the binary's +own pair, decoded as engine enum identities: `(flags & 0xC)` is the Entity +INSTANCE field (InstanceBits=2, ReplicantInstance=4) and `0x100` is +Entity::DynamicFlag (DynamicBit=8). Mover::DefaultFlags = +DynamicFlag|MasterInstance and ENTITY.CPP seeds simulationFlags from the +MakeMessage's instanceFlags, so the authentic gate was live all along -- +no stream-builder dependency existed, and the BT411 donor's +"MasterHeatSinkFlag" name was a fabrication. The whole registration +family (heat x4, powersub x3, gyro, hud, myomers, emitter) flipped with it. **Staged feeders**: `Read/WriteUpdateRecord` (the census remainder in this TU) stamp `twistAtUpdate`/`twistRate`/`lastUpdateTime` from console updates.