From a7cd9c8a0c38c663a6ea89fcb20ff095df0c4cda Mon Sep 17 00:00:00 2001 From: Martin Ambrus Date: Sat, 21 Oct 2017 22:57:08 +0200 Subject: [PATCH] fix: errors with empty post data in combat simulator --- GameEngine/Battle.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GameEngine/Battle.php b/GameEngine/Battle.php index c7af64ed..80556fa0 100755 --- a/GameEngine/Battle.php +++ b/GameEngine/Battle.php @@ -54,7 +54,7 @@ class Battle { if(isset($post['a1_1'])) { $sum = $sum2 = $post['walllevel'] = 0; for($i=1;$i<=10;$i++) { - $sum += $post['a1_'.$i]; + $sum += (!empty($post['a1_'.$i]) ? $post['a1_'.$i] : 0); } if($sum > 0) { $post['palast'] = intval($post['palast']);