Skip to content

Commit

Permalink
Merge pull request #38 from BadRyuner/FixReflection
Browse files Browse the repository at this point in the history
Updated dll, fixed reflection
  • Loading branch information
Nagord authored Feb 25, 2022
2 parents f3e2017 + 02fbff3 commit 6edcbde
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public override string GetStatLineLeft(PLShipComponent InComp)
public override string GetStatLineRight(PLShipComponent InComp)
{
PLExtractor me = InComp as PLExtractor;
return ((float)me.GetType().GetField("m_Stability", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(me) * 10f).ToString("0");
return ((float)me.m_Stability * 10f).ToString("0");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> inst
}
static int[] PatchMethod(PLFluffyOven instance)
{
PLFBRecipeModule module = (PLFBRecipeModule)instance.GetType().GetField("CurrentProducingModule", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(instance);
PLFBRecipeModule module = instance.CurrentProducingModule;
if (module.GetBiscuitTypeToProduce() == EFoodType.MAX)
{
int subtypeformodded = module.SubType - FBRecipeModuleModManager.Instance.VanillaFBRecipeModuleMaxType;
Expand Down
2 changes: 1 addition & 1 deletion PulsarModLoader/Content/Components/Reactors/ReactorMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public override string GetStatLineRight(PLShipComponent InComp)
" kP\n",
me.EmergencyCooldownTime.ToString("0.0"),
" sec\n",
((float)me.GetType().GetField("OriginalEnergyOutputMax", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(me) * me.LevelMultiplier(0.1f, 1f)).ToString("0"),
((float)me.OriginalEnergyOutputMax * me.LevelMultiplier(0.1f, 1f)).ToString("0"),
" MW"
});
}
Expand Down
2 changes: 1 addition & 1 deletion PulsarModLoader/Content/Components/Thruster/ThrusterMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public override string GetStatLineLeft(PLShipComponent InComp)
public override string GetStatLineRight(PLShipComponent InComp)
{
PLThruster me = InComp as PLThruster;
return ((float)me.GetType().GetField("MaxOutput", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(me) * me.LevelMultiplier(0.18f, 1f) * 100f).ToString("0") + "\n";
return ((float)me.m_MaxOutput * me.LevelMultiplier(0.18f, 1f) * 100f).ToString("0") + "\n";
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public override string GetStatLineLeft(PLShipComponent InComp)
public override string GetStatLineRight(PLShipComponent InComp)
{
PLInertiaThruster me = InComp as PLInertiaThruster;
return ((float)me.GetType().GetField("MaxOutput", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(me) * me.LevelMultiplier(0.18f, 1f) * 100f).ToString("0") + "\n";
return ((float)me.m_MaxOutput * me.LevelMultiplier(0.18f, 1f) * 100f).ToString("0") + "\n";
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public override string GetStatLineLeft(PLShipComponent InComp)
public override string GetStatLineRight(PLShipComponent InComp)
{
PLManeuverThruster me = InComp as PLManeuverThruster;
return ((float)me.GetType().GetField("MaxOutput", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(me) * me.LevelMultiplier(0.18f, 1f) * 100f).ToString("0") + "\n";
return ((float)me.m_MaxOutput * me.LevelMultiplier(0.18f, 1f) * 100f).ToString("0") + "\n";
}
}
}
Binary file modified lib/Assembly-CSharp.dll
Binary file not shown.

0 comments on commit 6edcbde

Please sign in to comment.