KSP-RO / KerbalRenamer

BSD 2-Clause "Simplified" License
8 stars 12 forks source link

Custom profile freezes KSP when entering naut center #14

Open jwvanderbeck opened 2 years ago

jwvanderbeck commented 2 years ago

I renamed the CUSTOM profile to something else and changed the weights. When starting a new game the UI still showed the profile named CUSTOM instead of my new name but thought that might be a UI bug.

Well once I got in game and tried to go to the Astronaut Center the whole game froze for several minutes and my log was spammed with entries that look like KerbalRenamer was probably trying to still load a profile named CUSTOM

Don't know if this is a bug or user error?


    Renamer.KerbalRenamer.LoadProfile (System.String profileName) (at <f4c47156481b432f88268b6f5159e724>:0)
    Renamer.KerbalRenamer.LoadProfile (System.String profileName) (at <f4c47156481b432f88268b6f5159e724>:0)
    Renamer.KerbalRenamer.LoadProfile (System.String profileName) (at <f4c47156481b432f88268b6f5159e724>:0)
    Renamer.KerbalRenamer.LoadProfile (System.String profileName) (at <f4c47156481b432f88268b6f5159e724>:0)
    Renamer.KerbalRenamer.LoadProfile (System.String profileName) (at <f4c47156481b432f88268b6f5159e724>:0)
    Renamer.KerbalRenamer.LoadProfile (System.String profileName) (at <f4c47156481b432f88268b6f5159e724>:0)
    Renamer.KerbalRenamer.LoadProfile (System.String profileName) (at <f4c47156481b432f88268b6f5159e724>:0)
    Renamer.KerbalRenamer.LoadProfile (System.String profileName) (at <f4c47156481b432f88268b6f5159e724>:0)
    Renamer.KerbalRenamer.LoadProfile (System.String profileName) (at <f4c47156481b432f88268b6f5159e724>:0)
    Renamer.KerbalRenamer.LoadProfile (System.String profileName) (at <f4c47156481b432f88268b6f5159e724>:0)
    Renamer.KerbalRenamer.LoadProfile (System.String profileName) (at <f4c47156481b432f88268b6f5159e724>:0)
    Renamer.KerbalRenamer.LoadProfile (System.String profileName) (at <f4c47156481b432f88268b6f5159e724>:0)
    Renamer.KerbalRenamer.LoadProfile (System.String profileName) (at <f4c47156481b432f88268b6f5159e724>:0)
    Renamer.KerbalRenamer.LoadProfile (System.String profileName) (at <f4c47156481b432f88268b6f5159e724>:0)
    Renamer.KerbalRenamer.LoadProfile (System.String profileName) (at <f4c47156481b432f88268b6f5159e724>:0)
    Renamer.KerbalRenamer.LoadProfile (System.String profileName) (at <f4c47156481b432f88268b6f5159e724>:0)
    Renamer.KerbalRenamer.LoadProfile (System.String profileName) (at <f4c47156481b432f88268b6f5159e724>:0)
    Renamer.KerbalRenamer.LoadProfile (System.String profileName) (at <f4c47156481b432f88268b6f5159e724>:0)
    Renamer.KerbalRenamer.LoadProfile (System.String profileName) (at <f4c47156481b432f88268b6f5159e724>:0)
    Renamer.KerbalRenamer.LoadProfile (System.String profileName) (at <f4c47156481b432f88268b6f5159e724>:0)
    Renamer.KerbalRenamer.LoadProfile (System.String profileName) (at <f4c47156481b432f88268b6f5159e724>:0)
    Renamer.KerbalRenamer.LoadProfile (System.String profileName) (at <f4c47156481b432f88268b6f5159e724>:0)
    Renamer.KerbalRenamer.LoadProfile (System.String profileName) (at <f4c47156481b432f88268b6f5159e724>:0)
    Renamer.KerbalRenamer.LoadProfile (System.String profileName) (at <f4c47156481b432f88268b6f5159e724>:0)
    Renamer.KerbalRenamer.LoadProfile (System.String profileName) (at <f4c47156481b432f88268b6f5159e724>:0)
    UrlDir.get_AllDirectories () (at <39c0323fb6b449a4aaf3465c00ed3c8d>:0)
    UrlDir+<get_AllDirectories>d__57.MoveNext () (at <39c0323fb6b449a4aaf3465c00ed3c8d>:0)
    UrlDir+<get_AllDirectories>d__57.MoveNext () (at <39c0323fb6b449a4aaf3465c00ed3c8d>:0)
    UrlDir+<get_AllDirectories>d__57.MoveNext () (at <39c0323fb6b449a4aaf3465c00ed3c8d>:0)
    UrlDir+<get_AllDirectories>d__57.MoveNext () (at <39c0323fb6b449a4aaf3465c00ed3c8d>:0)
    UrlDir+<get_AllConfigFiles>d__61.MoveNext () (at <39c0323fb6b449a4aaf3465c00ed3c8d>:0)
    UrlDir+<get_AllConfigs>d__63.MoveNext () (at <39c0323fb6b449a4aaf3465c00ed3c8d>:0)
    UrlDir+<GetConfigs>d__65.MoveNext () (at <39c0323fb6b449a4aaf3465c00ed3c8d>:0)
    GameDatabase.GetConfigNodes (System.String typeName) (at <39c0323fb6b449a4aaf3465c00ed3c8d>:0)
    Renamer.KerbalRenamer.LoadProfile (System.String profileName) (at <f4c47156481b432f88268b6f5159e724>:0)
    Renamer.KerbalRenamer.LoadProfile (System.String profileName) (at <f4c47156481b432f88268b6f5159e724>:0)
    Renamer.KerbalRenamer.LoadProfile (System.String profileName) (at <f4c47156481b432f88268b6f5159e724>:0)
    Renamer.KerbalRenamer.LoadProfile (System.String profileName) (at <f4c47156481b432f88268b6f5159e724>:0)
    Renamer.KerbalRenamer.LoadProfile (System.String profileName) (at <f4c47156481b432f88268b6f5159e724>:0)
    Renamer.KerbalRenamer.LoadProfile (System.String profileName) (at <f4c47156481b432f88268b6f5159e724>:0)
    Renamer.KerbalRenamer.LoadProfile (System.String profileName) (at <f4c47156481b432f88268b6f5159e724>:0)
    Renamer.KerbalRenamer.LoadProfile (System.String profileName) (at <f4c47156481b432f88268b6f5159e724>:0)
    Renamer.KerbalRenamer.LoadProfile (System.String profileName) (at <f4c47156481b432f88268b6f5159e724>:0)
    Renamer.KerbalRenamer.LoadProfile (System.String profileName) (at <f4c47156481b432f88268b6f5159e724>:0)
    Renamer.KerbalRenamer.LoadProfile (System.String profileName) (at <f4c47156481b432f88268b6f5159e724>:0)
    Renamer.KerbalRenamer.LoadProfile (System.String profileName) (at <f4c47156481b432f88268b6f5159e724>:0)
    Renamer.KerbalRenamer.LoadProfile (System.String profileName) (at <f4c47156481b432f88268b6f5159e724>:0)
    Renamer.KerbalRenamer.LoadProfile (System.String profileName) (at <f4c47156481b432f88268b6f5159e724>:0)
    Renamer.KerbalRenamer.LoadProfile (System.String profileName) (at <f4c47156481b432f88268b6f5159e724>:0)
    Renamer.KerbalRenamer.LoadProfile (System.String profileName) (at <f4c47156481b432f88268b6f5159e724>:0)
    Renamer.KerbalRenamer.LoadProfile (System.String profileName) (at <f4c47156481b432f88268b6f5159e724>:0)
    Renamer.KerbalRenamer.LoadProfile (System.String profileName) (at <f4c47156481b432f88268b6f5159e724>:0)
    Renamer.KerbalRenamer.LoadProfile (System.String profileName) (at <f4c47156481b432f88268b6f5159e724>:0)
    Renamer.KerbalRenamer.LoadProfile (System.String profileName) (at <f4c47156481b432f88268b6f5159e724>:0)
    Renamer.KerbalRenamer.LoadProfile (System.String profileName) (at <f4c47156481b432f88268b6f5159e724>:0)
    Renamer.KerbalRenamer.LoadProfile (System.String profileName) (at <f4c47156481b432f88268b6f5159e724>:0)
    Renamer.KerbalRenamer.LoadProfile (System.String profileName) (at <f4c47156481b432f88268b6f5159e724>:0)
    Renamer.KerbalRenamer.LoadProfile (System.String profileName) (at <f4c47156481b432f88268b6f5159e724>:0)```
Gordon-Dry commented 2 years ago

This seems to be the fix: https://github.com/KSP-RO/KerbalRenamer/pull/15

ghost commented 2 years ago

I don't think #15 will fix this

siimav commented 2 years ago

I can totally see the code getting stuck in infinite recursion if both the user-chosen profile and "CUSTOM" do not exist. There should probably be a check that breaks the recursion if the fallback doesn't exist.