The hoopy translation into js shows a very interesting Oolite bug. The bug was reported before by Screet with 1.72 and I also had it once:
On docking you fly through the ship but the engine thinks you are docked. No key works but when pressing 1 you launch!
With the script it constantly happens on the second docking. So I dock, launch, stop, turn 180 degr and dock again. Just air around.
I tries it at least 10 times now (1.73 as well as trunk) It consistently happens on the second docking. When reverting to the plist script, there is no problem. When I disable part of the script the bug goes away but as yet I don't see what triggers it.
The conversion to JS is okay but it would be interesting if others have seen the same.
EDIT:
I have been away for an hour and now I can't reproduce the bug.
But something in Oolite reacts wrong sometimes.
EDIT2: Not being able to reproduce the bug was because I made a script error and he defaulted to the plist script. Fixed that the bug is back. Every odd time I dock correctly and every even time i'm not docked.
Now I tried docking at the main station after a success full dock at the casino. I flew right through the main station. So something happens while being docked that sets a condition any next dock will fail. This could well be triggered in a combination with one of my other oxp's.
EDIT3: I found the trigger. "mission.choice" was not reset when finished. This is a bug that prevents other missions from making their own offers. There are other oxps that detect this bug (e.g. ups, but also an other) and correct that. So that oxp bugs Oolite and it is not code in this script that triggers it.
In the mean time I changed small parts in the Hoopy script so it now interacts correct with other mission oxp's. And that works as I got a missionscreen from Vector.oxp while docking at the casino. They both worked correctly together on my docking.
EDIT4: Finally found the two others oxps responsible for this. ups needs a cleared mission.choice to be able to make save offers so it clears the variable on shipWillDockWithStation() giving maximum time to the oxp that forgot to clear it to do it himself.
Than the bug starts with vector that reacts on this clearing with:
Code: Select all
this.missionChoiceWasReset = function()
{
if(this.hasShown && missionVariables.offering == this.name) this.clearBlockade();
if(!player.ship.docked || this.hasShown) return;
//.... remainder deleted
}
For some reason it calls
this.clearBlockade(); before checking if the player is docked. When I comment that line out, the problem goes away. In this.clearBlockade() is also a line that clears the mission.choice thereby again triggering the missionChoiceWasReset handler. It ends in a loop, but for some reason Oolite does not crash but also does not manage to dock correctly.
FINAL EDIT. I now removed both ups and vector and added the following line in my test oxp:
Code: Select all
this.shipWillDockWithStation = function()
{
if(player.ship.docked) log(this.name, "Player is docked")
}
The result is false so nothing is logged. But only the fact I check for player.ship.docked during this handler triggers the bug and I am not visually docked.