From 56aa916f82c80fc6eb62967524880bdc194b1d85 Mon Sep 17 00:00:00 2001 From: Martin Ambrus Date: Fri, 24 Nov 2017 18:04:22 +0100 Subject: [PATCH] fix: undefined indexes --- GameEngine/Database.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GameEngine/Database.php b/GameEngine/Database.php index 02e659f5..2aeb92de 100755 --- a/GameEngine/Database.php +++ b/GameEngine/Database.php @@ -6428,7 +6428,7 @@ References: User ID/Message ID, Mode $vtribe = $this->getUserField($vinfo['owner'], "tribe", 0); $movingunits = array(); $outgoingarray = $this->getMovement(3, $id, 0); - if(!empty($outgoingarray)) { + if(!empty($outgoingarray) && count($outgoingarray)) { foreach($outgoingarray as $out) { for($i = 1; $i <= 10; $i++) { if (!isset($movingunits['u' . (($vtribe - 1) * 10 + $i)])) { @@ -6454,7 +6454,7 @@ References: User ID/Message ID, Mode } } $returningarray = $this->getMovement(4, $id, 1); - if(!empty($returningarray)) { + if(!empty($returningarray) && count($returningarray)) { foreach($returningarray as $ret) { if($ret['attack_type'] != 1) { for($i = 1; $i <= 10; $i++) {