fix: fix various PHP problems and a few bugs

This commit is contained in:
Emmanuel BENOîT 2024-12-31 11:24:12 +01:00
parent c91440af72
commit a4b45ddaa4
Signed by: Emmanuel BENOîT
SSH key fingerprint: SHA256:l7PFUUF5TCDsvYeQC9OnTNz08dFY7Fvf4Hv3neIqYpg
34 changed files with 27 additions and 66 deletions

View file

@ -37,19 +37,19 @@ function handleInput() {
for ($y = $minY; $y <= $maxY; $y ++) {
$str = array_shift($layout);
for ($x = $minX; $x <= $maxX; $x ++) {
$type = $str{0};
$type = $str[0];
$map->setSystemType($x, $y, $type);
if ($type != 'S') {
$str = substr($str, 1);
continue;
}
$alloc = (int) $str{1};
$alloc = (int) $str[1];
$map->setSystemAlloc($x, $y, $alloc);
if ($alloc == 0) {
$str = substr($str, 2);
continue;
}
$map->setSystemSpawn($x, $y, $str{2} == '1');
$map->setSystemSpawn($x, $y, $str[2] == '1');
$str = substr($str, 3);
}
}