From 89fbb507879d84547341bd9b16425406f4f81131 Mon Sep 17 00:00:00 2001
From: ElTata <eltata@firemail.cc>
Date: Wed, 3 Jun 2020 10:06:13 +0200
Subject: [PATCH] bugfix : sub real_gain() matches decimal numbers

---
 Irpg/Classes/Farmer.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Irpg/Classes/Farmer.pm b/Irpg/Classes/Farmer.pm
index 06c395b..a94408c 100644
--- a/Irpg/Classes/Farmer.pm
+++ b/Irpg/Classes/Farmer.pm
@@ -82,7 +82,7 @@ sub steal_def {
 sub real_gain {
 	# to apply on TTL modificators
 	my ($self, $time) = @_;
-	return unless ($time =~ m/^-?\d+$/);
+	return unless ($time =~ m/^-?\d+(?:\.\d+$)?/);
 	$time = $time >= 0 ?
 		$time*(1-($self->cha()-1)/20):	# add less time
 		$time*(1+($self->cha()-1)/20);	# remove more time
-- 
GitLab