From 67d4f12cfeaf6f04dcc72e6aa3d5fa7c35a677af Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Thu, 18 Apr 2024 14:12:20 +0200 Subject: [PATCH] Loot/Errors * gracefully handle loot referencing nonexistent items --- includes/loot.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/includes/loot.class.php b/includes/loot.class.php index 80900b5a..2c4b9614 100644 --- a/includes/loot.class.php +++ b/includes/loot.class.php @@ -308,6 +308,12 @@ class Loot if (empty($loot['reference'])) // regular drop { + if (!isset($foo[$loot['content']])) + { + trigger_error('Item #'.$loot['content'].' referenced by loot does not exist!', E_USER_WARNING); + continue; + } + if (!User::isInGroup(U_GROUP_EMPLOYEE)) { if (!isset($this->results[$loot['content']]))