From b0403924ebb4c49ea2495eeb0c75f9d9524f8d7d Mon Sep 17 00:00:00 2001 From: Gnieark Date: Thu, 30 Jun 2016 14:57:08 +0200 Subject: [PATCH] php cant do that --- src/arenas/tron/act.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/arenas/tron/act.php b/src/arenas/tron/act.php index 2daeda9..c28cde9 100644 --- a/src/arenas/tron/act.php +++ b/src/arenas/tron/act.php @@ -19,7 +19,7 @@ switch ($_POST['act']){ //check if bots exists $botsArrayTemp = json_decode($_POST['bots']); - $_SESSION['bots'] = array(); + $bots = array(); $positions = array(); $botCount = 0; foreach($botsArrayTemp as $botId){ @@ -29,10 +29,10 @@ switch ($_POST['act']){ }while(in_array($x.",".$y,$positions)); $positions[] = $x.",".$y; - $_SESSION['bots'][$botCount] = new TronPlayer($bot['id'],500,10,'y+'); + $bots[$botCount] = new TronPlayer($bot['id'],500,10,'y+'); - if ($_SESSION['bots'][$botCount]->getStatus() === false){ - unset($_SESSION['bots'][$botCount]); + if ($bots[$botCount]->getStatus() === false){ + unset($bots[$botCount]); }else{ $botCount++; }