From ddf4ab267221da432f30f83214be174bee660321 Mon Sep 17 00:00:00 2001 From: Olivier Gagnon Date: Wed, 25 May 2022 20:49:11 -0400 Subject: [PATCH] dont generate coding contract offline because SF1.1 --- src/engine.tsx | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/engine.tsx b/src/engine.tsx index cc9e097610..5a16e7f544 100644 --- a/src/engine.tsx +++ b/src/engine.tsx @@ -272,18 +272,20 @@ const Engine: { const numCyclesOffline = Math.floor(timeOffline / CONSTANTS._idleSpeed); // Generate coding contracts - let numContracts = 0; - if (numCyclesOffline < 3000 * 100) { - // if we have less than 100 rolls, just roll them exactly. - for (let i = 0; i < numCyclesOffline / 3000; i++) { - if (Math.random() < 0.25) numContracts++; + if (Player.sourceFiles.length > 0) { + let numContracts = 0; + if (numCyclesOffline < 3000 * 100) { + // if we have less than 100 rolls, just roll them exactly. + for (let i = 0; i < numCyclesOffline / 3000; i++) { + if (Math.random() < 0.25) numContracts++; + } + } else { + // just average it. + numContracts = (numCyclesOffline / 3000) * 0.25; + } + for (let i = 0; i < numContracts; i++) { + generateRandomContract(); } - } else { - // just average it. - numContracts = (numCyclesOffline / 3000) * 0.25; - } - for (let i = 0; i < numContracts; i++) { - generateRandomContract(); } let offlineReputation = 0;