mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 09:10:42 +00:00
45246f2085
The replay-path computePlayerStatus left alliance/target/embargo/ nukeTargetsMe at false, which meant the WebGL NamePass had no data for those status icons after we switched names off canvas2D — they just stopped appearing. Add an opts param taking localPlayerID + tileState. When localPlayerID is set, fill the relative flags by checking the local player's allies/targets/embargoes against each other player's smallID; embargo is bilateral (either side). nukeTargetsMe walks active nukes and checks their targetTile's owner via the tileState buffer. Plumb localPlayerID = myPlayer?.smallID() and tileState from populateFrame so the live path uses the new mode. Emit an entry when only a relative flag is true (previously could be dropped if no base flag was set). allianceReq and allianceFraction stay deferred (need local PlayerID string for outgoing requests and current tick for fraction). 18 new tests covering both modes — replay (relative flags forced false), and live (alliance one-way, target one-way, embargo bilateral, self-flags suppressed, nukeTargetsMe with/without tileState, relative-flag-alone emits, localPlayerID=0 falls back to replay, allianceReq/allianceFraction stay deferred).