From 2e09148bb78f1491ada0028ee478bf7fbc482004 Mon Sep 17 00:00:00 2001 From: Ferywir <65760459+Ferywir@users.noreply.github.com> Date: Mon, 15 Jun 2026 06:53:14 +0200 Subject: [PATCH] Fix(farmlist): raid bugs and PHP 8.3 warnings (#217) --- GameEngine/Database.php | 4 ++-- GameEngine/Units.php | 2 +- Templates/goldClub/farmlist.tpl | 2 +- Templates/goldClub/farmlist_editraid.tpl | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/GameEngine/Database.php b/GameEngine/Database.php index 45fae4fe..d02ae256 100755 --- a/GameEngine/Database.php +++ b/GameEngine/Database.php @@ -2744,7 +2744,7 @@ class MYSQLi_DB implements IDbConnection { return mysqli_query($this->dblink,$q); } - function getVillageType2($wref) { + function getVillageType2($wref, $use_cache = true) { // retirieve form cache return $this->getVillageByWorldID($wref, $use_cache)['oasistype']; } @@ -8003,7 +8003,7 @@ $q = "INSERT INTO ".TB_PREFIX."demolition VALUES ( $q = 'SELECT * FROM ' . TB_PREFIX . 'farmlist WHERE owner = '.$uid.' ORDER BY wref ASC LIMIT 1'; $result = mysqli_query($this->dblink,$q); $dbarray = mysqli_fetch_array($result); - return $dbarray['id'] > 0; + return ($dbarray['id'] ?? 0) > 0; } // no need to cache this method diff --git a/GameEngine/Units.php b/GameEngine/Units.php index ad4219c3..36f164c0 100755 --- a/GameEngine/Units.php +++ b/GameEngine/Units.php @@ -761,7 +761,7 @@ class Units { public function startRaidList($post){ global $database, $generator, $session; - $slots = $post['slot']; + $slots = $post['slot'] ?? []; if(empty($slots)){ header("Location: build.php?id=39&t=99"); exit(); diff --git a/Templates/goldClub/farmlist.tpl b/Templates/goldClub/farmlist.tpl index 49eeabfc..34ea2b1b 100644 --- a/Templates/goldClub/farmlist.tpl +++ b/Templates/goldClub/farmlist.tpl @@ -259,7 +259,7 @@ if (mysqli_num_rows($getnotice) > 0) { getVilFarmlist($session->uid)) { ?>