Skip to content

Commit

Permalink
Fix for issue #7
Browse files Browse the repository at this point in the history
  • Loading branch information
RealityMachina committed Jun 18, 2018
1 parent a9a5647 commit 6f87bfd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion PunchinOut/BasicPanic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public static bool ShouldPanic(Mech mech, AttackDirector.AttackSequence attackSe

totalArmor = GetCurrentMechArmour(mech, totalArmor);

if((totalArmor / maxArmor * 100 ) + (BasicPanic.Settings.MinimumArmourDamagePercentageRequired / maxArmor * 100 ) >= 100) //basically if this equals to 100%, mech didn't lose enough armour
if((totalArmor / maxArmor * 100 ) + ((BasicPanic.Settings.MinimumArmourDamagePercentageRequired * maxArmor / 100) / maxArmor * 100 ) >= 100) //basically if this equals to 100%, mech didn't lose enough armour
{
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion mod.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"Name": "BasicPanicSystem",

"Version": "0.5.1",
"Version": "1.0.0",
"Description": "Adds basic panic system, based on mpstark's Punchin' Out.",
"Author": "RealityMachina, forked from mpstark's work",
"Website": "https://github.com/RealityMachina/PunchinOut",
Expand Down

1 comment on commit 6f87bfd

@RCrockford
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fast fix! :)

Simpler fix would be to just do:
if((totalArmor / maxArmor * 100 ) + BasicPanic.Settings.MinimumArmourDamagePercentageRequired >= 100)

Please sign in to comment.