FirstPersonKSP/FreeIva

docking port seats eats kerbals

Closed this issue · 6 comments

eats as in makes them not appear in the vehicle whatsoever but they are at the complex and stated as still being inside the vehicle.

repro:

  1. move kerbal to docking port seat (this step might be interchanged with step 2 as I do not recall precisely)
  2. eva a kerbal
  3. board the kerbal
  4. kerbal in docking seat should be gone from the vehicle

github bugged out and wouldnt attach the log to the original post
KSP.log

EVAing and entering another kerbal fixes the bug. Reloading the scene (from the tracking station for example) did nothing.

Couldn't repro given the steps above. Interesting stuff in logs:

[LOG 13:00:30.971] Podrigh Kerman is entering seat Module InternalSeat in part mk2DockingPort (Part)
later...
[LOG 13:02:45.053] [EFX] OnCrewOnEva()
[LOG 13:02:45.053] [EFX] Contains()
[WRN 13:02:45.055] [EFX] EvaContainer.Load(kerbalEVA (Podrigh Kerman))
[WRN 13:02:45.055] [EFX] EvaSettings.LoadEva(kerbalEVA (Podrigh Kerman))
[LOG 13:02:45.082] Podrigh Kerman is entering seat Module InternalSeat in part mk2CrewCabin (Part)
[ERR 13:02:45.084] Exception handling event OnCameraChange in class KerbalIvaAddon:System.NullReferenceException: Object reference not set to an instance of an object
  at FreeIva.KerbalIvaAddon.MoveKerbalToSeat (ProtoCrewMember crewMember, InternalSeat newSeat) [0x00007] in <88830b129e814431a858f8694c208528>:0 
  at FreeIva.KerbalIvaAddon.BuckleInternal (System.Boolean resetCamera) [0x00092] in <88830b129e814431a858f8694c208528>:0 
  at FreeIva.KerbalIvaAddon.ReturnToSeatInternal (System.Boolean resetCamera) [0x0004c] in <88830b129e814431a858f8694c208528>:0 
  at FreeIva.KerbalIvaAddon.OnCameraChange (CameraManager+CameraMode cameraMode) [0x00107] in <88830b129e814431a858f8694c208528>:0 
  at EventData`1[T].Fire (T data) [0x000b0] in <4b449f2841f84227adfaad3149c8fdba>:0 

[EXC 13:02:45.086] NullReferenceException: Object reference not set to an instance of an object
    FreeIva.KerbalIvaAddon.MoveKerbalToSeat (ProtoCrewMember crewMember, InternalSeat newSeat) (at <88830b129e814431a858f8694c208528>:0)
    FreeIva.KerbalIvaAddon.BuckleInternal (System.Boolean resetCamera) (at <88830b129e814431a858f8694c208528>:0)
    FreeIva.KerbalIvaAddon.ReturnToSeatInternal (System.Boolean resetCamera) (at <88830b129e814431a858f8694c208528>:0)
    FreeIva.KerbalIvaAddon.OnCameraChange (CameraManager+CameraMode cameraMode) (at <88830b129e814431a858f8694c208528>:0)
    EventData`1[T].Fire (T data) (at <4b449f2841f84227adfaad3149c8fdba>:0)
    UnityEngine.DebugLogHandler:LogException(Exception, Object)
    ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
    UnityEngine.Debug:LogException(Exception)
    EventData`1:Fire(CameraMode)
    CameraManager:SetCameraFlight()
    FreeIva.<GoEVA_Coroutine>d__86:MoveNext()
    UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
    FreeIva.FreeIvaHatch:GoEVA()
    FreeIva.FreeIvaHatch:Open(Boolean, Boolean)
    FreeIva.FreeIvaHatch:SetOpened(Boolean, Boolean)
    FreeIva.<AnimationUpdate>d__76:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
[LOG 13:02:45.501] [FLIGHT GLOBALS]: Switching To Vessel Podrigh Kerman ---------------------- 
[LOG 13:02:45.544] Detected switch from [Vessel:mk3Cockpit.Shuttle (Minmus Expedition)] to [Vessel:kerbalEVA (Podrigh Kerman)]. Request camera stabilization.
[LOG 13:06:05.828] Detected switch from [Vessel:kerbalEVA (Podrigh Kerman)] to [Vessel:mk3Cockpit.Shuttle (Minmus Expedition)]. Request camera stabilization.
[LOG 13:06:25.359] Detected switch from [Vessel:mk3Cockpit.Shuttle (Minmus Expedition)] to [Vessel:kerbalEVA (Podrigh Kerman)]. Request camera stabilization.
[LOG 13:06:58.052] [HighLogic]: =========================== Scene Change : From FLIGHT to TRACKSTATION (Async) =====================
[LOG 13:07:31.006] [HighLogic]: =========================== Scene Change : From TRACKSTATION to FLIGHT (Async) =====================
[LOG 13:07:52.161] [FLIGHT GLOBALS]: Switching To Vessel Podrigh Kerman ---------------------- 
[LOG 13:08:13.376] Detected switch from [Vessel:kerbalEVA (Podrigh Kerman)] to [Vessel:mk3Cockpit.Shuttle (Minmus Expedition)]. Request camera stabilization.
[LOG 13:09:33.277] Detected switch from [Vessel:mk3Cockpit.Shuttle (Minmus Expedition)] to [Vessel:kerbalEVA (Podrigh Kerman)]. Request camera stabilization.
[LOG 13:10:09.884] [EFX] OnCrewBoardVessel()
[LOG 13:10:09.886] [EFX] Unload(kerbalEVA (Podrigh Kerman))
[LOG 13:10:09.887] Detected switch from [Vessel:kerbalEVA (Podrigh Kerman)] to [Vessel:mk3Cockpit.Shuttle (Minmus Expedition)]. Request camera stabilization.
[LOG 13:18:55.708] [HighLogic]: =========================== Scene Change : From FLIGHT to TRACKSTATION (Async) =====================
[WRN 13:19:25.975] [Protocrewmember]: Instance of crewmember Podrigh Kerman in part mk2CrewCabin on Minmus Expedition did not match instance of Joedrin Kerman on crew roster. (Stored index: Joedrin Kerman)
[WRN 13:19:25.975] [Protocrewmember]: Instance of crewmember Joedrin Kerman in part mk2CrewCabin on Minmus Expedition did not match instance of Podrigh Kerman on crew roster. (Stored index: Podrigh Kerman)


OK, got a solid repro:

vessel:
mk2 cockpit
mk2 crew cabin
mk2 docking port

3 kerbals - 2 in cockpit, 1 in crew cabin

  1. take one of the kerbals from the cockpit and move to docking port
  2. take the kerbal from the crew cabin and move to the cockpit
  3. EVA the kerbal from the docking port
  4. reboard the docking port
  5. enter the seat in the docking port (note: if you don't do this the bug does not occur)
  6. F5/F9

The crew cabin ends up with 2 crew members, but their seat indices seem to be set to the same number so only one of them spawns. Step 5 seems to be critical in changing the seat index; otherwise they would have been correctly placed in the crew cabin. The crew cabin might be an extra step; I wonder if you can do this with just the cockpit and docking port...

OK, simpler repro:

Vessel:
mk2 cockpit
mk2 docking port

2 kerbals - both in cockpit

  1. EVA the 2nd kerbal from the cockpit (they are seat index 1)
  2. Board the docking port
  3. Enter the seat
  4. F5/F9

OK even simpler repro:

Vessel:
mk2 cockpit
mk2 docking port

2 kerbals - both in cockpit

  1. Have the 2nd kerbal move to the docking port seat
  2. F5/F9