|
@@ -305,7 +305,7 @@ discard block |
|
|
block discarded – undo |
|
305
|
305
|
//et compare la liste des batiments qu'il faut pour construire le batiment |
|
306
|
306
|
//a ceux qui sont deja construit dans la base |
|
307
|
307
|
//si tous les batments qu'il faut son batis on autorise la construction du batiment |
|
308
|
|
- for ($i = 0 ; $i < $c_all_batiment ; $i++) { |
|
|
308
|
+ for ($i = 0; $i < $c_all_batiment; $i++) { |
|
309
|
309
|
if (!in_array($all_batiment[$i], $batiment_construit)) { |
|
310
|
310
|
$query = $dbc1->select("pour_construire") |
|
311
|
311
|
->select("temps_construction") |
|
@@ -347,7 +347,7 @@ discard block |
|
|
block discarded – undo |
|
347
|
347
|
else if (count($pour_construire) > 1) { |
|
348
|
348
|
$ok_construction = false; |
|
349
|
349
|
//test si tous les batiments sont construits et on le niveau nécéssaire |
|
350
|
|
- for ($j = 0 ; $j < count($pour_construire) ; $j++) { |
|
|
350
|
+ for ($j = 0; $j < count($pour_construire); $j++) { |
|
351
|
351
|
if (in_array($pour_construire[$j][1], $batiment_construit)) { |
|
352
|
352
|
if ($pour_construire[$j][2] <= $this->getNiveauBatiment($pour_construire[$j][1])) { |
|
353
|
353
|
$ok_construction = true; |
|
@@ -434,8 +434,8 @@ discard block |
|
|
block discarded – undo |
|
434
|
434
|
$finx_batiment = $taille_batiment[0]+$posx_batiment; |
|
435
|
435
|
$finy_batiment = $taille_batiment[1]+$posy_batiment; |
|
436
|
436
|
|
|
437
|
|
- for ($i = $posy ; $i < $finy ; $i++) { |
|
438
|
|
- for ($j = $posx ; $j < $finx ; $j++) { |
|
|
437
|
+ for ($i = $posy; $i < $finy; $i++) { |
|
|
438
|
+ for ($j = $posx; $j < $finx; $j++) { |
|
439
|
439
|
if ((($posx++ >= $posx_batiment) && ($posx++ <= $finx_batiment)) && (($posy++ >= $posy_batiment) && ($posy++ <= $finy_batiment))) { |
|
440
|
440
|
FlashMessage::setFlash("Un batiment est déjà présent à cet emplacement, merci d'en choisir un autre"); |
|
441
|
441
|
return false; |
|
@@ -565,7 +565,7 @@ discard block |
|
|
block discarded – undo |
|
565
|
565
|
->where("ID_".$this->nom_batiment_sql, "=", $this->niveau_batiment+1) |
|
566
|
566
|
->get(); |
|
567
|
567
|
|
|
568
|
|
- if ((is_array($query)) && (count($query) > 0)){ |
|
|
568
|
+ if ((is_array($query)) && (count($query) > 0)) { |
|
569
|
569
|
foreach ($query as $obj) { |
|
570
|
570
|
$this->info_batiment_next = $xml->$nom_batiment_sql->phrase_suivant.$obj->$champ.$xml->$nom_batiment_sql->complement; |
|
571
|
571
|
} |
|
@@ -617,7 +617,7 @@ discard block |
|
|
block discarded – undo |
|
617
|
617
|
} |
|
618
|
618
|
|
|
619
|
619
|
//si pas assez de ressource |
|
620
|
|
- if (($ressource["eau"]["class"] || $ressource["electricite"]["class"] ||$ressource["fer"]["class"] || $ressource["fuel"]["class"]) == "rouge") { |
|
|
620
|
+ if (($ressource["eau"]["class"] || $ressource["electricite"]["class"] || $ressource["fer"]["class"] || $ressource["fuel"]["class"]) == "rouge") { |
|
621
|
621
|
FlashMessage::setFlash("Pas assez de ressources pour construire ce batiment"); |
|
622
|
622
|
return false; |
|
623
|
623
|
} |