fix: prod-bundle boot, cloud-existence leak, observation gating (final review)

- Wrap main.js body in async main() to eliminate top-level await deadlock in Rollup
- Add npc.lastPlan so clouds persist after hidden arrival/destruction until analytic envelope expires
- Add maxEnvelopeArrival() helper; rewrite playerClouds() to use lastPlan for envelope-gated clouds
- Block markSeen() while player is mid-lane (no observation from hyperspace)
- Pass obsSys=null to playerClouds when player is in a lane (don't exclude visible band from hyperspace)
- Galaxy map clicks now select-only (intel); jumps via Nav buttons / gate diamonds only
- Add preview script, favicon no-op, .playwright-mcp/ and *.png to .gitignore, update README controls text
This commit is contained in:
2026-06-12 15:35:20 +00:00
parent 395c0e851d
commit 051a111855
11 changed files with 116 additions and 78 deletions
+3
View File
@@ -102,6 +102,7 @@ export function planNpc(world, npc) {
routeLanes: best.route.lanes, startSys: origin.systemId,
startTime: t, ...itin,
};
npc.lastPlan = null; // superseded; v1 simplification: a fresh cloud implies the previous run ended
npc.state = 'transit';
world.queue.push(itin.arriveTime, 'npc-arrive', { npcId: npc.id, planId });
}
@@ -113,6 +114,7 @@ export function onNpcArrive(world, { npcId, planId }) {
const plan = npc.plan;
if (plan.finalOutcome === 'destroyed') {
npc.alive = false;
npc.lastPlan = plan; // cloud persists from the envelope until observed/expired
npc.plan = null;
npc.cargo = null;
npc.state = 'destroyed';
@@ -128,6 +130,7 @@ export function onNpcArrive(world, { npcId, planId }) {
npc.credits = Math.round((npc.credits + price * npc.cargo.qty) * 100) / 100;
world.stats.trades++;
}
npc.lastPlan = plan; // unobserved arrival: the player's cloud persists a while
npc.cargo = null;
npc.plan = null;
world.queue.push(world.t + DOCK_DELAY, 'npc-replan', { npcId });