From 66309b34cc07ad52c7c62fe7611d800dec99a790 Mon Sep 17 00:00:00 2001
From: ElTata <eltata@firemail.cc>
Date: Fri, 10 Jul 2020 16:58:43 +0200
Subject: [PATCH] fix: proper time modification on goodness event

---
 Irpg/Event.pm | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/Irpg/Event.pm b/Irpg/Event.pm
index e04eed2..a781d8e 100644
--- a/Irpg/Event.pm
+++ b/Irpg/Event.pm
@@ -398,7 +398,7 @@ sub evilchase {
     return unless (@opps && rand(5) < 1);
     my $opp = $opps[int(rand(@opps))];
     Irpg::Irc::chanmsg(Irpg::Utils::clog(
-		"$player, full of hatred and disdain for ".
+        "$player, full of hatred and disdain for ".
         pronoun(2, $rps->{$player}{gender})." kind, has chased ".
         "after $opp who passed by."));
     collision_action($player, $opp);
@@ -417,8 +417,10 @@ sub goodness {
                 "evil men poison them. Together have they prayed to their ".
                 "God, and it is his light that now shines upon them. $gain\% ".
                 "of their time is removed from their clocks."));
-        $rps->{$players[0]}{next} += int($rps->{$players[0]}{class}->real_gain(-$gain/100));
-        $rps->{$players[1]}{next} += int($rps->{$players[1]}{class}->real_gain(-$gain/100));
+        $gain = int(($gain/100)*$rps->{$players[0]}{next});
+        $rps->{$players[0]}{next} += int($rps->{$players[0]}{class}->real_gain(-$gain));
+        $gain = int(($gain/100)*$rps->{$players[1]}{next});
+        $rps->{$players[1]}{next} += int($rps->{$players[1]}{class}->real_gain(-$gain));
         Irpg::Irc::chanmsg("$players[0] reaches next level in ".
                 duration($rps->{$players[0]}{next}).".");
         Irpg::Irc::chanmsg("$players[1] reaches next level in ".
-- 
GitLab