Nivekk / KOS

Fully programmable autopilot mod for KSP.
Other
80 stars 30 forks source link

The LOG command causes KSP to hang if it contains the word "to" in the string. #116

Closed Dunbaratu closed 11 years ago

Dunbaratu commented 11 years ago

This one really took me a long time to work out what was happening.

This makes KSP hang:

log "going to the mun" to someFile.

I suspect the error is in how the regular expression for the LOG command is implemented. It's looking for: LOG (something) TO (something). and the problem is it's seeing the "TO" inside the string "going to the mun" as the "TO" it was looking for, causing it to think like so: "I'm being told to log the value "going to the file called the mun" to someFile

In the meantime now that I know why it's broken I can work around it by storing the value in a string first and then logging that string variable.

This was hard to trace because it hangs PRIOR to executing the line. It parses ahead a ways and hangs when parsing this line , not when executing it, which made it look like it was hanging on an earlier line in my script until I downloaded the code and sprinkled it full of debug print statements. .

Dunbaratu commented 11 years ago

Hmm.. I uploaded this about 20 minutes before I saw that v0.8 was out. It looks like v0.8 no longer has this error. I'll play around with it a bit more to verify it but if it's true then I'll close it from the list.

Nivekk commented 11 years ago

It may be part of the log statement being upgraded to the new regex builder, I'll leave this open for now

Dunbaratu commented 11 years ago

I can verify that this went away in 0.8x. I still can't use 0.8x because of the other problems it has but at least I think this issue is closed so I'll close it.