| @@ -17,8 +17,7 @@ discard block | ||
| 17 | 17 | |
| 18 | 18 |  			if ($id_base === null) { | 
| 19 | 19 | $this->id_base = Bataille::getIdBase(); | 
| 20 | - } | |
| 21 | -			else { | |
| 20 | +			} else { | |
| 22 | 21 | $this->id_base = $id_base; | 
| 23 | 22 | } | 
| 24 | 23 | |
| @@ -154,13 +153,22 @@ discard block | ||
| 154 | 153 | $fuel = $this->getFuel()-$fuel; | 
| 155 | 154 | $nourriture = $this->getNourriture()-$nourriture; | 
| 156 | 155 | |
| 157 | - if ($eau < 0) $eau = 0; | |
| 158 | - if ($electricite < 0) $electricite = 0; | |
| 159 | - if ($fer < 0) $fer = 0; | |
| 160 | - if ($fuel < 0) $fuel = 0; | |
| 161 | - if ($nourriture < 0) $nourriture = 0; | |
| 162 | - } | |
| 163 | -			else { | |
| 156 | +				if ($eau < 0) { | |
| 157 | + $eau = 0; | |
| 158 | + } | |
| 159 | +				if ($electricite < 0) { | |
| 160 | + $electricite = 0; | |
| 161 | + } | |
| 162 | +				if ($fer < 0) { | |
| 163 | + $fer = 0; | |
| 164 | + } | |
| 165 | +				if ($fuel < 0) { | |
| 166 | + $fuel = 0; | |
| 167 | + } | |
| 168 | +				if ($nourriture < 0) { | |
| 169 | + $nourriture = 0; | |
| 170 | + } | |
| 171 | +			} else { | |
| 164 | 172 | $eau = $this->getEau()+$eau; | 
| 165 | 173 | $electricite = $this->getElectricite()+$electricite; | 
| 166 | 174 | $fer = $this->getFer()+$fer; | 
| @@ -169,11 +177,21 @@ discard block | ||
| 169 | 177 | |
| 170 | 178 | $stockage_max = Bataille::getBatiment()->getStockageEntrepot(); | 
| 171 | 179 | |
| 172 | - if ($eau > $stockage_max) $eau = $stockage_max; | |
| 173 | - if ($electricite > $stockage_max) $electricite = $stockage_max; | |
| 174 | - if ($fer > $stockage_max) $fer = $stockage_max; | |
| 175 | - if ($fuel > $stockage_max) $fuel = $stockage_max; | |
| 176 | - if ($nourriture > $stockage_max) $nourriture = $stockage_max; | |
| 180 | +				if ($eau > $stockage_max) { | |
| 181 | + $eau = $stockage_max; | |
| 182 | + } | |
| 183 | +				if ($electricite > $stockage_max) { | |
| 184 | + $electricite = $stockage_max; | |
| 185 | + } | |
| 186 | +				if ($fer > $stockage_max) { | |
| 187 | + $fer = $stockage_max; | |
| 188 | + } | |
| 189 | +				if ($fuel > $stockage_max) { | |
| 190 | + $fuel = $stockage_max; | |
| 191 | + } | |
| 192 | +				if ($nourriture > $stockage_max) { | |
| 193 | + $nourriture = $stockage_max; | |
| 194 | + } | |
| 177 | 195 | } | 
| 178 | 196 | |
| 179 | 197 | |