magico13 / KCT

Kerbal Construction Time - An addon for Kerbal Space Program
29 stars 40 forks source link

Intermittent issue: Upgrading a pad while a new pad is building causes the pad-to-be-upgraded to lose track #159

Open NathanKell opened 7 years ago

NathanKell commented 7 years ago

I had two pads, one at Tier 4 and one at Tier 2. I chose to build a third pad, then immediately tried to upgrade the Tier 2 pad, but it had reset to tier 1 and thus started upgrading to tier 2.

NOTE: I have not had a chance to try to repro this clean, so please don't worry about it atm unless you hear about it from someone else. Just sticking this here so I don't forget.

pianojosh commented 7 years ago

I am also having an issue with a pad upgrade not "taking" but I'm not currently building or even have a second pad.

KCT appears to be spamming the logs repeatedly with the following content:

Updating launchpad destruction state.
Facility SpaceCenter/LaunchPad upgraded to lvl -1
VAB rates:
0.3
0
SPH Rates:
0.1 0
pianojosh commented 7 years ago

Here is the relevant snippet from my save for when an upgrade is in-progress that doesn't "take":

                UpgradingBuilding
                {
                    upgradeLevel = 0
                    currentLevel = -1
                    launchpadID = 0
                    id = SpaceCenter/LaunchPad
                    commonName = LaunchPad
                    progress = 779738.24703568767
                    BP = 6777015.027073849
                    cost = 15000
                    UpgradeProcessed = False
                    isLaunchpad = True
                }
pianojosh commented 7 years ago

Here's the snippet when the upgrade does work:

                UpgradingBuilding
                {
                    upgradeLevel = 1
                    currentLevel = 0
                    launchpadID = 0
                    id = SpaceCenter/LaunchPad
                    commonName = LaunchPad
                    progress = 5952014.1120023131
                    BP = 6777015.027073849
                    cost = 15000
                    UpgradeProcessed = False
                    isLaunchpad = True
                }
magico13 commented 7 years ago

Are you running the latest build? You can try to just delete that entire entry and manually set the level to the correct one. Also, this is a different issue and should be in it's own issue on GitHub, not under this one, thanks :)

On Jul 8, 2017 20:16, "pianojosh" notifications@github.com wrote:

Here's the snippet when the upgrade does work:

            UpgradingBuilding
            {
                upgradeLevel = 1
                currentLevel = 0
                launchpadID = 0
                id = SpaceCenter/LaunchPad
                commonName = LaunchPad
                progress = 5952014.1120023131
                BP = 6777015.027073849
                cost = 15000
                UpgradeProcessed = False
                isLaunchpad = True
            }

You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/magico13/KCT/issues/159#issuecomment-313888905, or mute the thread https://github.com/notifications/unsubscribe-auth/AFC21YKWnWETEo_MJ4ukYGutGrqNMoqHks5sMBvAgaJpZM4ONry5 .

pianojosh commented 7 years ago

Fair enough, I think they might have the same underlying cause though.

@NathanKell, can you take a look at the save where the unlock is failing, before the unlock completes, if you have a snapshot of that? In my save that's exhibiting this issue, the launch pad has a level of -1 instead of 0. I just created a new game and the beginning launch pad has a level of 0, and in that save, the upgrade is working as expected.

pianojosh commented 7 years ago

@magico13 Per my version file, I have 1.3.9.0.

Also, I can confirm that manually editing my save to set the KCT_LaunchPad to level = 0 instead of level = -1 and changing the UpgradingBuilding to upgradeLevel = 1 and currentLevel = 0 both makes the upgrade work as expected and stops the logspam.

magico13 commented 7 years ago

@pianojosh good to know you could get it to stop. I've seen similar things happen when it does something incorrectly and then keeps dropping levels until it gets caught in the -1 loop you saw. Btw, the best place to check the version is either in the log (Module Manager spits out all the versions), by checking the .dll version itself (right click, go to properties, then details). The version file is updated manually and only during releases, but the .dll version is done automatically every single build and will be way more precise.

I really should just try to override the upgrade buttons again, but I haven't gotten a chance to look into that again recently. It'd fix a lot of glitches.