From 6d6aac90be518b3be2643d7b222cb6a61b5857e5 Mon Sep 17 00:00:00 2001 From: Nigel Sheldon Date: Wed, 17 Feb 2021 20:39:55 +0100 Subject: [PATCH] Corrige le chantier terrestre --- onyx2/include/Class/planete.php | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/onyx2/include/Class/planete.php b/onyx2/include/Class/planete.php index 83775a0..42f7d8c 100644 --- a/onyx2/include/Class/planete.php +++ b/onyx2/include/Class/planete.php @@ -747,7 +747,11 @@ class Planete extends Surface global ${$calc.'VAR'}; } - $outNomChamps[] = ${$calc.'VAR'}[$modif[1]]; + if ($calc == "terrestre") { + $outNomChamps[] = ${$calc.'VAR'}[$this->race][$modif[1]]; + } else { + $outNomChamps[] = ${$calc.'VAR'}[$modif[1]]; + } $outValeurs[] = $this->{$modif[0]}[$modif[1]]; } elseif ($modif == "force") { continue; @@ -773,6 +777,11 @@ class Planete extends Surface } foreach ($this->{$modif} as $j => $value) { + if ($calc == "terrestre") { + $outNomChamps[] = ${$calc.'VAR'}[$this->race][$j]; + } else { + $outNomChamps[] = ${$calc.'VAR'}[$j]; + } $outNomChamps[] = ${$calc.'VAR'}[$j]; $outValeurs[] = $value; } @@ -799,7 +808,11 @@ class Planete extends Surface trigger_error('Impossible de trouver les données pour '.$modif[0], E_USER_ERROR); } - $out[] = ${$calc.'VAR'}[$modif[1]]." = ".$this->{$modif[0]}[$modif[1]]; + if ($calc == "terrestre") { + $out[] = ${$calc.'VAR'}[$this->race][$modif[1]]." = ".$this->{$modif[0]}[$modif[1]]; + } else { + $out[] = ${$calc.'VAR'}[$modif[1]]." = ".$this->{$modif[0]}[$modif[1]]; + } } elseif ($modif == "force") { $out[] = "timestamp = timestamp"; } elseif (!is_array($this->{$modif}) && !is_object($this->{$modif})) { @@ -822,7 +835,11 @@ class Planete extends Surface } foreach ($this->{$modif} as $j => $value) { - $out[] = ${$calc.'VAR'}[$j]." = ".$value; + if ($calc == "terrestre") { + $out[] = ${$calc.'VAR'}[$this->race][$j]." = ".$value; + } else { + $out[] = ${$calc.'VAR'}[$j]." = ".$value; + } } } } -- 2.45.2