[BUG] Shipyards never stop working #239
Labels
bug:unconfirmed
All new bug reports that are yet to be confirmed (eg. by providing more details)
bug
All bug reports
Version: latest/master
Hello, real bug this time as far as I can tell :)
Apologies for very poor PHP skills. Learning on the fly.
In short the shipyards never ever stop working, even when their queue is actually empty, "accumulating" production time while inactive, and then being able to instantly pop out massive amounts of ships. Debug/investigation isn't fun, due to time-sensitive reproduction, but issue can be quickly observed with some manual debugging.
This check is the root cause of the issue, and fails to properly detect that a queue is indeed empty.
Adding a basic debug log
error_log("Queue is non-0: adding production time = $ProductionTime") ;
right inside the body and refreshing the shipyard page of any inactive planet show that each refresh adds production time.Requesting ship construction while this buffer is high enough leads to instant build queues (up until the buffer is fully consumed), which is particularly noticeable with a higher game speed multiplier : hours worth of production are typically instantaneous.
Proposed fix : replace with
if (!empty($ThePlanet['shipyardQueue']))
. Confirmed to work for shipyards, but NOT retroactive : the buffer will still need to be consumed.Side note:
While the core issue is that this time leads to (I believe) improper build time mechanics, a fun side-effect is that with enough accumulated time (not much), accessing the overview Page throws this highly funky stack in the logs (but appears just fine to the user)
I have no idea why, nor do I believe it worth investigating further at this point.
Regards,
Scott
The text was updated successfully, but these errors were encountered: