ensure that first and second node are always different
All checks were successful
Build / build (22) (push) Successful in 40s
Build / build (18) (push) Successful in 1m9s
Build / build (20) (push) Successful in 1m2s
Build / build (18) (pull_request) Successful in 42s
Build / build (20) (pull_request) Successful in 1m6s
Build / build (22) (pull_request) Successful in 1m1s

This commit is contained in:
Sainan 2025-03-17 14:47:02 +01:00
parent a5dd3bde57
commit 7b6c7fdaae

View File

@ -137,6 +137,9 @@ export const worldStateController: RequestHandler = (req, res) => {
} }
const rng = new CRng(week); const rng = new CRng(week);
const firstNodeIndex = rng.randomInt(0, nodes.length - 1);
const firstNode = nodes[firstNodeIndex];
nodes.splice(firstNodeIndex, 1);
worldState.LiteSorties.push({ worldState.LiteSorties.push({
_id: { _id: {
$oid: Math.trunc(weekStart / 1000).toString(16) + "5e23a244740a190c" $oid: Math.trunc(weekStart / 1000).toString(16) + "5e23a244740a190c"
@ -155,7 +158,7 @@ export const worldStateController: RequestHandler = (req, res) => {
"MT_SABOTAGE", "MT_SABOTAGE",
"MT_RESCUE" "MT_RESCUE"
]), ]),
node: rng.randomElement(nodes) node: firstNode
}, },
{ {
missionType: rng.randomElement([ missionType: rng.randomElement([