From 6852e240923bf8d0c60709aa45d0d9a0988c58d8 Mon Sep 17 00:00:00 2001
From: ElTata <eltata@firemail.cc>
Date: Tue, 13 Apr 2021 14:15:46 +0200
Subject: [PATCH] fix: empty keys in $rps are deleted

---
 Irpg/Main.pm | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/Irpg/Main.pm b/Irpg/Main.pm
index c18e08f..ef388f3 100644
--- a/Irpg/Main.pm
+++ b/Irpg/Main.pm
@@ -262,6 +262,15 @@ sub rpcheck { # check levels, update database
     # there's really nothing to do here if there are no online users
     return unless $online;
 
+    # Sometimes an empty key is added in $rps
+    # while the origin of this problem is not found,
+    # here is a workaround
+    if (grep { $_ eq '' } keys %$rps) {
+        debug("Error: empty key in \%\$rps. Deleting.");
+        #print(Irpg::Utils::ts()."Error: empty key in \%\$rps. Deleting.");
+        delete $rps->{''};
+    }
+
     ### MOVING PLAYERS ###
     moveplayers();
     
-- 
GitLab