@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | //et compare la liste des batiments qu'il faut pour construire le batiment |
296 | 296 | //a ceux qui sont deja construit dans la base |
297 | 297 | //si tous les batments qu'il faut son batis on autorise la construction du batiment |
298 | - for ($i = 0 ; $i < $c_all_batiment ; $i++) { |
|
298 | + for ($i = 0; $i < $c_all_batiment; $i++) { |
|
299 | 299 | if (!in_array($all_batiment[$i], $batiment_construit)) { |
300 | 300 | $query = $dbc1->select("pour_construire") |
301 | 301 | ->select("temps_construction") |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | $ok_construction = false; |
337 | 337 | //test si tous les batiments sont construits et on le niveau nécéssaire |
338 | 338 | $count = count($pour_construire); |
339 | - for ($j = 0 ; $j < $count ; $j++) { |
|
339 | + for ($j = 0; $j < $count; $j++) { |
|
340 | 340 | if (in_array($pour_construire[$j][1], $batiment_construit)) { |
341 | 341 | if ($pour_construire[$j][2] <= $this->getNiveauBatiment($pour_construire[$j][1])) { |
342 | 342 | $ok_construction = true; |
@@ -421,8 +421,8 @@ discard block |
||
421 | 421 | $finx_batiment = $taille_batiment[0]+$posx_batiment; |
422 | 422 | $finy_batiment = $taille_batiment[1]+$posy_batiment; |
423 | 423 | |
424 | - for ($i = $posy ; $i < $finy ; $i++) { |
|
425 | - for ($j = $posx ; $j < $finx ; $j++) { |
|
424 | + for ($i = $posy; $i < $finy; $i++) { |
|
425 | + for ($j = $posx; $j < $finx; $j++) { |
|
426 | 426 | if ((($posx++ >= $posx_batiment) && ($posx++ <= $finx_batiment)) && (($posy++ >= $posy_batiment) && ($posy++ <= $finy_batiment))) { |
427 | 427 | FlashMessage::setFlash("Un batiment est déjà présent à cet emplacement, merci d'en choisir un autre"); |
428 | 428 | return false; |
@@ -552,7 +552,7 @@ discard block |
||
552 | 552 | ->where("ID_".$this->nom_batiment_sql, "=", $this->niveau_batiment+1) |
553 | 553 | ->get(); |
554 | 554 | |
555 | - if ((is_array($query)) && (count($query) > 0)){ |
|
555 | + if ((is_array($query)) && (count($query) > 0)) { |
|
556 | 556 | foreach ($query as $obj) { |
557 | 557 | $this->info_batiment_next = $xml->$nom_batiment_sql->phrase_suivant.$obj->$champ.$xml->$nom_batiment_sql->complement; |
558 | 558 | } |
@@ -609,7 +609,7 @@ discard block |
||
609 | 609 | } |
610 | 610 | |
611 | 611 | //si pas assez de ressource |
612 | - if (($ressource["eau"]["class"] || $ressource["electricite"]["class"] ||$ressource["fer"]["class"] || $ressource["fuel"]["class"]) == "rouge") { |
|
612 | + if (($ressource["eau"]["class"] || $ressource["electricite"]["class"] || $ressource["fer"]["class"] || $ressource["fuel"]["class"]) == "rouge") { |
|
613 | 613 | FlashMessage::setFlash("Pas assez de ressources pour construire ce batiment"); |
614 | 614 | return false; |
615 | 615 | } |