Skip to content

Commit

Permalink
fix non-reversed for
Browse files Browse the repository at this point in the history
  • Loading branch information
ajkroeg committed Mar 13, 2023
1 parent df4a0d4 commit d22b239
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions Patches/SaveAndStatePatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public static void Postfix(SimGameState __instance)
{
var dmg = PilotInjuryHolder.HolderInstance.pilotInjuriesMap[pKey].Count -
sim.Commander.StatCollection.GetValue<int>("Injuries");
for (int i = 0; i < dmg; i++)
for (int i = dmg - 1; i >= 0; i--)
{
PilotInjuryHolder.HolderInstance.pilotInjuriesMap[pKey].RemoveAt(i);
ModInit.modLog?.Info?.Write(
Expand Down Expand Up @@ -235,7 +235,7 @@ public static void Postfix(SimGameState __instance)
{
var dmg = PilotInjuryHolder.HolderInstance.pilotInjuriesMap[pKey].Count -
p.StatCollection.GetValue<int>("Injuries");
for (int i = 0; i < dmg; i++)
for (int i = dmg - 1; i >= 0; i--)
{
PilotInjuryHolder.HolderInstance.pilotInjuriesMap[pKey].RemoveAt(i);
ModInit.modLog?.Info?.Write(
Expand Down Expand Up @@ -310,7 +310,7 @@ public static void Postfix(SimGameState __instance, SimGameEventResult result, L
{
var dmg = PilotInjuryHolder.HolderInstance.pilotInjuriesMap[pKey].Count - p.StatCollection.GetValue<int>("Injuries");
ModInit.modLog?.Info?.Write($"{p.Callsign} has {dmg} extra injuries. Removing.");
for (int j = 0; j < dmg; j++)
for (int j = dmg - 1; j >= 0; j--)
{
PilotInjuryHolder.HolderInstance.pilotInjuriesMap[pKey].RemoveAt(j);
}
Expand Down Expand Up @@ -379,7 +379,7 @@ public static void Postfix(SimGameState __instance, SimGameEventResult result, L
{
var dmg = PilotInjuryHolder.HolderInstance.pilotInjuriesMap[pKey].Count - commander.StatCollection.GetValue<int>("Injuries");
ModInit.modLog?.Info?.Write($"{commander.Callsign} has {dmg} extra injuries. Removing.");
for (int j = 0; j < dmg; j++)
for (int j = dmg - 1; j >= 0; j--)
{
PilotInjuryHolder.HolderInstance.pilotInjuriesMap[pKey].RemoveAt(j);
}
Expand Down Expand Up @@ -633,7 +633,7 @@ public static void Prefix(Contract __instance, MissionResult result, bool isGood
ModInit.modLog?.Info?.Write(
$"Post-Mission Injuries ({p.StatCollection.GetValue<int>("Injuries")}) less than InjuryHolder count ({PilotInjuryHolder.HolderInstance.pilotInjuriesMap[pKey].Count})");
PilotInjuryHolder.HolderInstance.pilotInjuriesMap[pKey].Reverse();
for (int i = 0; i < diff; i++)
for (int i = diff - 1; i >= 0; i--)
{
ModInit.modLog?.Info?.Write(
$"Removing {PilotInjuryHolder.HolderInstance.pilotInjuriesMap[pKey][i]} from {p.Callsign}");
Expand Down
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
// 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("1.0.5.1")]
[assembly: AssemblyFileVersion("1.0.5.1")]
[assembly: AssemblyVersion("1.0.5.2")]
[assembly: AssemblyFileVersion("1.0.5.2")]
Binary file modified bin/Debug/TisButAScratch.dll
Binary file not shown.
Binary file modified bin/Debug/TisButAScratch.pdb
Binary file not shown.
Binary file modified obj/Debug/TisButAScratch.dll
Binary file not shown.
Binary file modified obj/Debug/TisButAScratch.pdb
Binary file not shown.

0 comments on commit d22b239

Please sign in to comment.