Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed DeepFreeze.zip
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"NAME":"DeepFreeze Continued...",
"URL":"http://ksp-avc.cybutek.net/version.php?id=183",
"DOWNLOAD":"https://kerbalstuff.com/mod/895/DeepFreeze%20Continued...",
"VERSION":{"MAJOR":0,"MINOR":20,"PATCH":2,"BUILD":0},
"VERSION":{"MAJOR":0,"MINOR":20,"PATCH":3,"BUILD":0},
"KSP_VERSION":{"MAJOR":1,"MINOR":0,"PATCH":5},
"KSP_VERSION_MIN":{"MAJOR":1,"MINOR":0,"PATCH":3},
"KSP_VERSION_MAX":{"MAJOR":1,"MINOR":0,"PATCH":5}
Expand Down
Binary file modified GameData/REPOSoftTech/DeepFreeze/Plugins/DeepFreeze.dll
Binary file not shown.
5 changes: 4 additions & 1 deletion Source/Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
V0.20.2.0 "Bug fixes"
V0.20.3.0 "bug Fixes"
Fixed bug when thawing some kerbals vessel where vessel reference transform was not set in some cases.
Modified debugging and error messages during thawing to assist easier bug hunting in the future.
V0.20.2.0 "Bug fixes"
Fixed null ref bug when vessels are destroyed.
Fixed null ref bug when KSP vessel list cannot be accessed.
Fixed null ref/NAN bug when revert to editor (from vessel with DeepFreeze part) and launch another vessel.
Expand Down
38 changes: 30 additions & 8 deletions Source/DeepFreezerPart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,8 @@ public void DeActivateAction(KSPActionParam param)
private Guid CrntVslID;
private uint CrntPartID;
private string CrntVslName;
private bool vesselisinIVA;
private bool vesselisinInternal;
private bool vesselisinIVA = false;
private bool vesselisinInternal = false;

private bool setGameSettings = false;

Expand Down Expand Up @@ -767,13 +767,19 @@ private void checkRPMPodTransparencySetting()

private void onceoffSetup()
{
Utilities.Log_Debug("DeepFreezer", "OnUpdate SetGameSettings");
Utilities.Log_Debug("DeepFreezer", "OnUpdate onceoffSetup");
_StoredCrewList.Clear();
CrntVslID = this.vessel.id;
CrntVslName = this.vessel.vesselName;
CrntPartID = this.part.flightID;
lastUpdate = Time.time;
lastRemove = Time.time;
if (DeepFreeze.Instance == null)
{
Utilities.Log("DeepFreezer", "Onceoffsetup - waiting for DeepFreeze settings instance");
setGameSettings = false;
return;
}
// Master settings values override the part values for EC required and Glykerol required
if (DeepFreeze.Instance.DFsettings.ECReqdToFreezeThaw != ChargeRequired)
{
Expand Down Expand Up @@ -2166,8 +2172,9 @@ private void ThawKerbalStep0(string frozenkerbal)
// we check the internal seat has our Crewmember in it. Not some other kerbal.
if (crew.name == frozenkerbal)
{
int codestep = 0;
try
{
{
//seat is taken and it is by themselves. Expected condition.
//Check the KerbalRef isn't null. If it is we need to respawn them. (this shouldn't occur).
if (kerbal.KerbalRef == null)
Expand All @@ -2178,13 +2185,15 @@ private void ThawKerbalStep0(string frozenkerbal)
kerbal.Spawn();
this.Log_Debug("Kerbal kerbalref = " + kerbal.KerbalRef.GetInstanceID());
}
codestep = 1;
if (kerbal.KerbalRef != null)
{
Utilities.subdueIVAKerbalAnimations(kerbal.KerbalRef);
}
Utilities.setFrznKerbalLayer(kerbal, true, false); //Set the Kerbal renderer layers on so they are visible again.
kerbal.KerbalRef.InPart = this.part; //Put their kerbalref back in the part.
kerbal.KerbalRef.rosterStatus = ProtoCrewMember.RosterStatus.Assigned;
codestep = 2;
try
{
if (DFInstalledMods.IsTexReplacerInstalled)
Expand All @@ -2198,6 +2207,7 @@ private void ThawKerbalStep0(string frozenkerbal)
Debug.Log("Err: " + ex);
}

codestep = 3;
KerbalGUIManager.AddActiveCrew(kerbal.KerbalRef); //Add them to the portrait cams.
this.Log_Debug("Just thawing crew and added to GUIManager");
KerbalGUIManager.PrintActiveCrew();
Expand All @@ -2207,6 +2217,7 @@ private void ThawKerbalStep0(string frozenkerbal)
if (vesselisinIVA || vesselisinInternal)
setIVAFrzrCam(tmpcrew.SeatIdx);

codestep = 4;
if (hasExternalDoor)
{
//now set the helmet state depending on the external door state.
Expand All @@ -2219,11 +2230,13 @@ private void ThawKerbalStep0(string frozenkerbal)
Utilities.setHelmetshaders(kerbal.KerbalRef, true);
}
}
this.Log_Debug("Reference part after add=" + this.vessel.GetReferenceTransformPart().name + ",flightid=" + this.vessel.GetReferenceTransformPart().flightID);
this.Log_Debug("Finishing ThawKerbalStep0");
//this.Log_Debug("Reference part after add=" + this.vessel.GetReferenceTransformPart().name + ",flightid=" + this.vessel.GetReferenceTransformPart().flightID);
}
catch (Exception ex)
{
Debug.Log("Exception attempting to add to seat for " + frozenkerbal);
Debug.Log("Part has Internals, and Frozen Kerbal was found codestep = " + codestep);
Debug.Log("Err: " + ex);
ScreenMessages.PostScreenMessage("Code Error: Cannot thaw kerbal at this time, Check Log", 5.0f, ScreenMessageStyle.UPPER_CENTER);
ThawKerbalAbort(frozenkerbal);
Expand All @@ -2245,6 +2258,7 @@ private void ThawKerbalStep0(string frozenkerbal)
{
this.Log_Debug("Seat Crew KerbalRef is NULL re-add them at seatidx=" + tmpcrew.SeatIdx);
//this.part.internalModel.seats[tmpcrew.SeatIdx].taken = false; // Set their seat to NotTaken before we assign them back to their seat, not sure we really need this.
int codestep = 0;
try
{
this.part.internalModel.SitKerbalAt(kerbal, this.part.internalModel.seats[tmpcrew.SeatIdx]);
Expand All @@ -2253,6 +2267,7 @@ private void ThawKerbalStep0(string frozenkerbal)
//set the seat to allow helmet, this will cause the helmet to appear
kerbal.seat.allowCrewHelmet = true;
}
codestep = 1;
kerbal.seat.SpawnCrew();
setseatstaticoverlay(this.part.internalModel.seats[tmpcrew.SeatIdx]);
// Think this will get rid of the static that appears on the portrait camera
Expand All @@ -2263,6 +2278,7 @@ private void ThawKerbalStep0(string frozenkerbal)
Utilities.setFrznKerbalLayer(kerbal, true, false); //Set the Kerbal renderer layers on so they are visible again.
kerbal.KerbalRef.InPart = this.part; //Put their kerbalref back in the part.
kerbal.KerbalRef.rosterStatus = ProtoCrewMember.RosterStatus.Assigned;
codestep = 2;
try
{
if (DFInstalledMods.IsTexReplacerInstalled)
Expand All @@ -2276,11 +2292,14 @@ private void ThawKerbalStep0(string frozenkerbal)
Debug.Log("Err: " + ex);
}

codestep = 3;
KerbalGUIManager.AddActiveCrew(kerbal.KerbalRef); //Add them to the portrait cams.
this.Log_Debug("Just thawing crew and added to GUIManager");
KerbalGUIManager.PrintActiveCrew();
codestep = 4;
if (vesselisinIVA || vesselisinInternal)
setIVAFrzrCam(tmpcrew.SeatIdx);
codestep = 5;
if (hasExternalDoor)
{
//now set the helmet state depending on the external door state.
Expand All @@ -2293,10 +2312,12 @@ private void ThawKerbalStep0(string frozenkerbal)
Utilities.setHelmetshaders(kerbal.KerbalRef, true);
}
}
this.Log_Debug("Finishing ThawKerbalStep0");
}
catch (Exception ex)
{
Debug.Log("Exception attempting to add to seat for " + frozenkerbal);
Debug.Log("Seat Crew KerbalRef is NULL re-add them at seatidx=" + tmpcrew.SeatIdx + " codestep = " + codestep);
Debug.Log("Err: " + ex);
ScreenMessages.PostScreenMessage("Code Error: Cannot thaw kerbal at this time, Check Log", 5.0f, ScreenMessageStyle.UPPER_CENTER);
ThawKerbalAbort(frozenkerbal);
Expand All @@ -2316,6 +2337,7 @@ private void ThawKerbalStep0(string frozenkerbal)
catch (Exception ex)
{
Debug.Log("Exception attempting to add to seat for " + frozenkerbal);
Debug.Log("Where DeepFreezer Module is attached to internal-LESS part");
Debug.Log("Err: " + ex);
ScreenMessages.PostScreenMessage("Code Error: Cannot thaw kerbal at this time, Check Log", 5.0f, ScreenMessageStyle.UPPER_CENTER);
ThawKerbalAbort(frozenkerbal);
Expand Down Expand Up @@ -2505,7 +2527,7 @@ private bool RemoveKerbal(ProtoCrewMember kerbal, int SeatIndx)
}
else
{
this.Log("Found Kerbal in the stored frozen crew list for this part, critical error. Report this on the forum.");
this.Log("Found Kerbal in the stored frozen crew list for this part.");
this.Log("Crewmember:" + tmpcrew.CrewName + " Seat:" + tmpcrew.SeatIdx);
}
// Update the saved frozen kerbals dictionary
Expand Down Expand Up @@ -3892,8 +3914,7 @@ private void stopStripLightFlash(int seatIndx)
//This method sets the internal camera to the Freezer view prior to thawing or freezing a kerbal so we can see the nice animations.
private void setIVAFrzrCam(int seatIndx)
{
string camname = "FrzCam" + (seatIndx + 1).ToString();
//this.Log_Debug("Setting FrzrCam " + camname);
string camname = "FrzCam" + (seatIndx + 1).ToString();
Camera cam = this.part.internalModel.FindModelComponent<Camera>(camname);
if (cam != null) //Found Freezer Camera so switch to it.
{
Expand All @@ -3908,6 +3929,7 @@ private void setIVAFrzrCam(int seatIndx)
{
CameraManager.Instance.SetCameraMode(CameraManager.CameraMode.Flight);
}
this.Log_Debug("Finished Setting FrzrCam " + camname);
}

private void setseatstaticoverlay(InternalSeat seat)
Expand Down
4 changes: 2 additions & 2 deletions Source/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.20.2.0")]
[assembly: AssemblyFileVersion("0.20.2.0")]
[assembly: AssemblyVersion("0.20.3.0")]
[assembly: AssemblyFileVersion("0.20.3.0")]
[assembly: KSPAssembly("DeepFreeze", 0, 20)]
[assembly: KSPAssemblyDependency("DFInterface", 0, 4)]