From 3485791000c76fe0e8788759d033a1ce26294488 Mon Sep 17 00:00:00 2001 From: fusion32 Date: Mon, 8 Dec 2025 23:14:43 -0300 Subject: fix a problem with sector refreshing delays at startup I misread the original initial values for `RefreshX` and `RefreshY` from the binary which caused the behavior, and a confused comment from me. Thanks to Gustinos from OTLand for catching that. I actualy done a small back of the envelope calculation and it seems that, using a config similar to the one from the leaked files, it would have taken ~100 hours for it to start refreshing sectors, meaning this feature has NEVER actually been tested. I'd expect unexpected bugs to emerge from this change. --- src/operate.cc | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/operate.cc b/src/operate.cc index 68bf61c..6419051 100644 --- a/src/operate.cc +++ b/src/operate.cc @@ -2953,17 +2953,9 @@ void RefreshMap(void){ void RefreshCylinders(void){ // TODO(fusion): `RefreshedCylinders` is the number of cylinders we attempt to // refresh in this function, which is called every minute or so by `AdvanceGame`. - // We should probably rename it to something more clear. - - // TODO(fusion): This might be on purpose but `RefreshX` and `RefreshY` will be - // way below `SectorXMin` and `SectorYMin` the first N times this function is - // called and depending on the value of `RefreshedCylinders`, could take a few - // hours before we even start refreshing the map. - // If the intent is to delay refreshing cylinders until some time after startup, - // we should change how this function is called by `AdvanceGame` instead. - - static int RefreshX = -1; - static int RefreshY = -1; + // We should probably rename it to something clearer. + static int RefreshX = INT_MAX; + static int RefreshY = INT_MAX; for(int i = 0; i < RefreshedCylinders; i += 1){ if(RefreshX < SectorXMax){ RefreshX += 1; -- cgit v1.2.3