diff --git a/GameEngine/Units.php b/GameEngine/Units.php index 25e01b1c..53f862d3 100755 --- a/GameEngine/Units.php +++ b/GameEngine/Units.php @@ -727,7 +727,17 @@ class Units { public function Settlers($post) { global $form, $database, $village, $session; - + //-- Prevent user from founding a new village if there are not enough settlers + //-- fix by AL-Kateb + $tempunits = $database->getUnit($village->coor['id']); + $settler_key = "u" . $session->userinfo['tribe'] . "0"; + $settlers = (int)$tempunits[$settler_key]; + if($settlers < 3){ + header("location: dorf1.php"); + exit; + } + //-- + if ( $session->access != BANNED ) { $mode = CP; $total = count( $database->getProfileVillages( $session->uid ) ); diff --git a/Templates/a2b/newdorf.tpl b/Templates/a2b/newdorf.tpl index 62841cd9..58ef30e6 100644 --- a/Templates/a2b/newdorf.tpl +++ b/Templates/a2b/newdorf.tpl @@ -32,6 +32,17 @@ $time = round($time); } } } +//-- Prevent user from founding a new village if there are not enough settlers +//-- fix by AL-Kateb +$tempunits = $database->getUnit($village->coor['id']); +$settler_key = "u" . $session->userinfo['tribe'] . "0"; +$settlers = (int)$tempunits[$settler_key]; +if($settlers < 3){ + header("location: dorf1.php"); + exit; +} +//-- + echo '
'; echo ''; ?> @@ -59,8 +70,14 @@ echo '';