gold <= 2) { header("Location: build.php?id=".(int)$_GET['id']); exit; } $level = (int)$village->resarray['f'.$id]; // Defensive: a resource computed as NaN/INF (PHP float) would be echoed as // "NAN"/"INF" into org4/summe and lock the NPC distribution on "Rest: NaN" // (issue #211). Coerce every value the template/JS relies on to a valid, // non-negative integer before it reaches the page. $resSafe = static function ($v) { $v = (float) $v; return (is_finite($v) && $v > 0) ? (int) floor($v) : 0; }; $awood = $resSafe($village->awood); $aclay = $resSafe($village->aclay); $airon = $resSafe($village->airon); $acrop = $resSafe($village->acrop); $totalRes = $awood + $aclay + $airon + $acrop; $maxstore = max(0, (int)$village->maxstore); $maxcrop = max(0, (int)$village->maxcrop); // PREFILL VALUE FROM GET $r = []; for ($i = 1; $i <= 4; $i++) { $r[$i] = isset($_GET['r'.$i])? max(0, (int)$_GET['r'.$i]) : ''; } $newsum = ($r[1]!=='' && $r[2]!=='' && $r[3]!=='' && $r[4]!=='')? array_sum($r) : 0; $remain = $totalRes - $newsum; $wwvillage = $database->getResourceLevel($village->wid); $isWW = ($wwvillage['f99t'] == 40); $completed = isset($_GET['c']); ?>

. 3<?php echo GOLD;?>

$rd):?>
<?php echo $rd[3];?>

userinfo['gold'] >= 3):?> (: <?php echo GOLD;?>3) (: <?php echo GOLD;?>3)