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 modified 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":1,"BUILD":0},
"VERSION":{"MAJOR":0,"MINOR":20,"PATCH":2,"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.
6 changes: 5 additions & 1 deletion Source/Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
V0.20.1.0 "Bug fixes & Enhancements"
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.
V0.20.1.0 "Bug fixes & Enhancements"
Fixed sound glitch/issue with CRY-0300R when attaching more than one in symmetry mode in the editor.
For Other Modder/Mods API interface re-written providing API via reflection class (no hard dependancy) - of no relevance to users.
[B]V0.20.0.0 "External Radial Pods"[/B]
Expand Down
16 changes: 16 additions & 0 deletions Source/DFGameSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,5 +173,21 @@ internal void DmpKnownFznKerbals()
}
}
}

internal void DmpKnownVessels()
{
this.Log("Dump of KnownVessels");
if (knownVessels.Count() == 0)
{
this.Log("KnownVessels is EMPTY.");
}
else
{
foreach (KeyValuePair<Guid, VesselInfo> vessel in knownVessels)
{
this.Log("Vessel = " + vessel.Key + " Name = " + vessel.Value.vesselName + " crew = " + vessel.Value.numCrew + " frozencrew = " + vessel.Value.numFrznCrew);
}
}
}
}
}
29 changes: 28 additions & 1 deletion Source/DFIntMemory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,34 @@ private void CheckVslUpdate()
this.Log_Debug("knownvessels id = " + entry.Key + " Name = " + entry.Value.vesselName);
Guid vesselId = entry.Key;
VesselInfo vesselInfo = entry.Value;
Vessel vessel = allVessels.Find(v => v.id == vesselId);
Vessel vessel = null;
try
{
vessel = allVessels.Find(v => v.id == vesselId);
}
catch (Exception ex)
{
DeepFreeze.Instance.DFgameSettings.DmpKnownVessels();
if (allVessels.Count == 0 || allVessels == null)
{
this.Log("FlightGlobals.Vessels = 0 or null");
}
else
{
foreach(Vessel vsl in allVessels)
{
this.Log("Vessel " + vsl.id + " name = " + vsl.name);
}
}
this.Log("Exception: " + ex);
if (entry.Value.numFrznCrew == 0)
{
this.Log("Removing entry as vessel has no frozen crew");
vesselsToDelete.Add(vesselId);
partsToDelete.AddRange(DeepFreeze.Instance.DFgameSettings.knownFreezerParts.Where(e => e.Value.vesselID == vesselId).Select(e => e.Key).ToList());
continue;
}
}
if (vessel == null)
{
this.Log_Debug("Deleting vessel " + vesselInfo.vesselName + " - vessel does not exist anymore");
Expand Down
16 changes: 8 additions & 8 deletions Source/DeepFreezerPart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1288,7 +1288,7 @@ public override void OnStart(PartModule.StartState state)
externalDoorAnim = this.part.FindModelAnimators(animationName).FirstOrDefault();
if (externalDoorAnim == null)
{
this.Log_Debug("Part has external animation defined but cannot find the animation on the part");
Utilities.Log_Debug("Part has external animation defined but cannot find the animation on the part");
hasExternalDoor = false;
Events["eventOpenDoors"].active = false;
Events["eventCloseDoors"].active = false;
Expand All @@ -1297,10 +1297,10 @@ public override void OnStart(PartModule.StartState state)
}
else
{
this.Log_Debug("Part has external animation, check if RPM is installed and process");
Utilities.Log_Debug("Part has external animation, check if RPM is installed and process");
if (DFInstalledMods.IsRPMInstalled)
{
this.Log_Debug("RPM installed, set doorstate");
Utilities.Log_Debug("RPM installed, set doorstate");
hasExternalDoor = true;
if (_externaldoorstate == DoorState.OPEN)
{
Expand All @@ -1313,11 +1313,11 @@ public override void OnStart(PartModule.StartState state)
}
else //RPM is not installed, disable the doors.
{
this.Log_Debug("RPM NOT installed, set transparent transforms");
Utilities.Log_Debug("RPM NOT installed, set transparent transforms");
hasExternalDoor = false;
Events["eventOpenDoors"].active = false;
Events["eventCloseDoors"].active = false;
this.Log_Debug("door actions/events off");
Utilities.Log_Debug("door actions/events off");
if (transparentTransforms != string.Empty)
Utilities.setTransparentTransforms(this.part, transparentTransforms);
}
Expand Down Expand Up @@ -3239,18 +3239,18 @@ private void OnVesselChange(Vessel vessel)
// ie scene changes, exiting loading distance
private void onVesselDestroy(Vessel vessel)
{
this.Log_Debug("OnVesselDestroy");
Utilities.Log_Debug("OnVesselDestroy");
//Check a Freeze or Thaw is not in progress, if it is, we must abort.
if (IsThawActive)
{
ScreenMessages.PostScreenMessage("Vessel about to change, Aborting Thaw process", 5.0f, ScreenMessageStyle.UPPER_CENTER);
this.Log_Debug("Thawisactive - abort");
Utilities.Log_Debug("Thawisactive - abort");
ThawKerbalAbort(ToThawKerbal);
}
if (IsFreezeActive)
{
ScreenMessages.PostScreenMessage("Vessel about to change, Aborting Freeze process", 5.0f, ScreenMessageStyle.UPPER_CENTER);
this.Log_Debug("Freezeisactive - abort");
Utilities.Log_Debug("Freezeisactive - abort");
FreezeKerbalAbort(ActiveFrzKerbal);
}
}
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.1.0")]
[assembly: AssemblyFileVersion("0.20.1.0")]
[assembly: AssemblyVersion("0.20.2.0")]
[assembly: AssemblyFileVersion("0.20.2.0")]
[assembly: KSPAssembly("DeepFreeze", 0, 20)]
[assembly: KSPAssemblyDependency("DFInterface", 0, 4)]
48 changes: 40 additions & 8 deletions Source/utilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -822,30 +822,62 @@ internal static void Log(string context, string message)

internal static void Log_Debug(this UnityEngine.Object obj, string message)
{
DFSettings DFsettings = DeepFreeze.Instance.DFsettings;
if (DFsettings.debugging)
try
{
DFSettings DFsettings = DeepFreeze.Instance.DFsettings;
if (DFsettings.debugging)
Debug.Log(obj.GetType().FullName + "[" + obj.GetInstanceID().ToString("X") + "][" + Time.time.ToString("0.00") + "]: " + message);
}
catch
{
Debug.Log(obj.GetType().FullName + "[" + obj.GetInstanceID().ToString("X") + "][" + Time.time.ToString("0.00") + "]: " + message);
}

}

internal static void Log_Debug(this System.Object obj, string message)
{
DFSettings DFsettings = DeepFreeze.Instance.DFsettings;
if (DFsettings.debugging)
try
{
DFSettings DFsettings = DeepFreeze.Instance.DFsettings;
if (DFsettings.debugging)
Debug.Log(obj.GetType().FullName + "[" + obj.GetHashCode().ToString("X") + "][" + Time.time.ToString("0.00") + "]: " + message);
}
catch
{
Debug.Log(obj.GetType().FullName + "[" + obj.GetHashCode().ToString("X") + "][" + Time.time.ToString("0.00") + "]: " + message);
}

}

internal static void Log_Debug(string context, string message)
{
DFSettings DFsettings = DeepFreeze.Instance.DFsettings;
if (DFsettings.debugging)

try
{
DFSettings DFsettings = DeepFreeze.Instance.DFsettings;
if (DFsettings.debugging)
Debug.Log(context + "[][" + Time.time.ToString("0.00") + "]: " + message);
}
catch
{
Debug.Log(context + "[][" + Time.time.ToString("0.00") + "]: " + message);
}
}

internal static void Log_Debug(string message)
{
DFSettings DFsettings = DeepFreeze.Instance.DFsettings;
if (DFsettings.debugging)

try
{
DFSettings DFsettings = DeepFreeze.Instance.DFsettings;
if (DFsettings.debugging)
Debug.Log("[DeepFreeze][" + Time.time.ToString("0.00") + "]: " + message);
}
catch
{
Debug.Log("[DeepFreeze][" + Time.time.ToString("0.00") + "]: " + message);
}
}
}
}