I just investigated a very interesting bug. On docking I was suddenly in the middle of the station seeing the sky. The docking was not noted correctly. The only key that worked was the launch key.
This bug must be there at least since Oolite 1.72 as Screet already reported it than playing cataclism.oxp. In that time I had it also one time. Yesterday I had it constantly. After successively removing all oxps I ended up with one very simple one:
[dataCache.rebuild.pathsChanged] ResourceManager.m:413: Cache is stale (search paths have changed). Rebuilding from scratch.
[shipData.load.begin] OOShipRegistry.m:278: Loading ship data...
[script.load.world.listAll] ResourceManager.m:893: Loaded 7 world scripts: "erics_JStest" 1.00, "oolite-cloaking-device" 1.74, "oolite-constrictor-hunt" 1.74, "oolite-nova" 1.74, "oolite-thargoid-plans" 1.74, "oolite-trumbles" 1.74, "ups_test" 1.00
[debugOXP.load.success] OODebugController.m:91: Debug OXP loaded successfully.
[cache.profile] OOCacheManager.m:469: Time to prepare cache data: 0.000388658 seconds.
[cache.profile] OOCacheManager.m:594: Time to serialize cache: 0.0209964 seconds. Time to write data: 0.0429662 seconds.
[general.error.inconsistentState] PlayerEntity.m:7186: ***** ERROR: status is STATUS_DOCKING, but dockedStation is nil; treating as not docked. This is an internal error, please report it.
[general.error.inconsistentState] PlayerEntity.m:7195: ***** ERROR: status is STATUS_IN_FLIGHT, not STATUS_DOCKED, but dockedStation is not nil; treating as docked. This is an internal error, please report it.
Test was with 1.74, but yesterday I had the identical problem with 1.73 and there were similar reports for 1.72 in the past.
[general.error.inconsistentState] PlayerEntity.m:7190: ***** ERROR: status is STATUS_DOCKING, but dockedStation is nil; treating as not docked. This is an internal error, please report it.
[erics_JStest] OOJSGlobal.m:197: Player is not docked
[general.error.inconsistentState] PlayerEntity.m:7199: ***** ERROR: status is STATUS_IN_FLIGHT, not STATUS_DOCKED, but dockedStation is not nil; treating as docked. This is an internal error, please report it.
Strange as according to the code then the handler triggers:
The problem is that dockedStation is set in -enterDock after the event shipWillDockWithStation has been executed. A possible fix could be to put the line
The problem is that dockedStation is set in -enterDock after the event shipWillDockWithStation has been executed. A possible fix could be to put the line
before setting STATUS_DOCKING, but I have not tested this and I am not sure if it breaks anything, but it could be an idea to get us started.
Just found that line also and also moved it to a point before calling the handler. At least the sanity check is not disturbing things now and I can dock. At first sight I see no problem with moving this forward.