From c643bc61e2db4e9aca135f33a9f22ee86f6a840d Mon Sep 17 00:00:00 2001
From: ElTata <eltata@firemail.cc>
Date: Fri, 10 Jul 2020 16:57:28 +0200
Subject: [PATCH] fix: real_gain for mystic results on proper value

---
 Irpg/Action.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Irpg/Action.pm b/Irpg/Action.pm
index 1a0757c..952e613 100644
--- a/Irpg/Action.pm
+++ b/Irpg/Action.pm
@@ -149,7 +149,7 @@ sub mystic_result {
         my $gain_p1 = int(($perc/100)*$rps->{$p1}{next});
         my $gain_p2 = int(($perc/100)*$rps->{$p2}{next});
         $gain_p1 = -$rps->{$p1}{class}->real_gain(-$gain_p1);
-        $gain_p2 = -$rps->{$p2}{class}->real_gain(-$gain_p2);
+        $gain_p2 = $rps->{$p2}{class}->real_gain($gain_p2);
         $rps->{$p1}{next} = $gain_p1 >= $rps->{$p1}{next} ?
                             0 : $rps->{$p1}{next} - $gain_p1;
         $rps->{$p2}{next} += $gain_p2;
@@ -178,7 +178,7 @@ sub mystic_result {
         my $gain_p1 = int(($perc/100)*$rps->{$p1}{next});
         my $gain_p2 = int(($perc/100)*$rps->{$p2}{next});
         $gain_p1 = $rps->{$p1}{class}->real_gain($gain_p1);
-        $gain_p2 = $rps->{$p2}{class}->real_gain($gain_p2);
+        $gain_p2 = -$rps->{$p2}{class}->real_gain(-$gain_p2);
         $rps->{$p1}{next} += $gain_p1;
         $rps->{$p2}{next} = $gain_p2 >= $rps->{$p2}{next} ?
                             0 : $rps->{$p2}{next} - $gain_p2;
-- 
GitLab