diff --git a/Admin/Templates/search.tpl b/Admin/Templates/search.tpl
index 03bbddcc..5aaa8ce6 100644
--- a/Admin/Templates/search.tpl
+++ b/Admin/Templates/search.tpl
@@ -21,16 +21,16 @@
|
|
-
+
|
@@ -40,7 +40,7 @@
';
if($_GET['msg'] == 'ursdel')
diff --git a/GameEngine/Battle.php b/GameEngine/Battle.php
index 854462e3..4da4ee43 100755
--- a/GameEngine/Battle.php
+++ b/GameEngine/Battle.php
@@ -468,7 +468,7 @@ class Battle {
// Formula for calculating points attackers (Infantry & Cavalry)
if($AttackerWref != 0){
- $rap = ($ap+$cap)+(($ap+$cap)/100*$bid35[$this->getTypeLevel(35,$AttackerWref)]['attri']);
+ $rap = ($ap+$cap)+(($ap+$cap)/100*(isset($bid35[$this->getTypeLevel(35,$AttackerWref)]) ? $bid35[$this->getTypeLevel(35,$AttackerWref)]['attri'] : 0));
}else{
$rap = $ap+$cap;
}
diff --git a/GameEngine/Technology.php b/GameEngine/Technology.php
index cd67c7e7..3c2e32b4 100755
--- a/GameEngine/Technology.php
+++ b/GameEngine/Technology.php
@@ -285,7 +285,14 @@ class Technology {
$movement = $database->getVillageMovement($base);
if(!empty($movement)) {
for($i=1;$i<=50;$i++) {
- $ownunit['u'.$i] += $movement['u'.$i];
+ if (!isset($ownunit['u'.$i])) {
+ $ownunit['u'.$i] = 0;
+ }
+ $ownunit['u'.$i] += (isset($movement['u'.$i]) ? $movement['u'.$i] : 0);
+ }
+
+ if (!isset($ownunit['hero'])) {
+ $ownunit['hero'] = 0;
}
$ownunit['hero'] += $movement['hero'];
}
diff --git a/GameEngine/Units.php b/GameEngine/Units.php
index a834a7d3..4e01314f 100755
--- a/GameEngine/Units.php
+++ b/GameEngine/Units.php
@@ -129,7 +129,7 @@ class Units {
$form->addError("error","You need to mark min. one troop");
}
- if(!$post['dname'] && !$post['x'] && !$post['y']){
+ if(!empty($post['dname']) && !empty($post['x']) && !empty($post['y'])){
$form->addError("error","Insert name or coordinates");
}
@@ -174,7 +174,7 @@ class Units {
}
}
}
- if ($database->isVillageOases($id) == 0) {
+ if (isset($id) && $database->isVillageOases($id) == 0) {
if($database->hasBeginnerProtection($id)==1) {
$form->addError("error","Player is under beginners protection. You can't attack him");
}
@@ -220,8 +220,7 @@ class Units {
$_SESSION['valuearray'] = $_POST;
header("Location: a2b.php");
exit;
- }else{
-
+ } else if (isset($id)) {
$villageName = $database->getOasisField($id,"name");
$speed= 300;
$timetaken = $generator->procDistanceTime($coor,$village->coor,INCREASE_SPEED,1);
diff --git a/Templates/Build/16_walking.tpl b/Templates/Build/16_walking.tpl
index 77af10fe..d3d527f5 100644
--- a/Templates/Build/16_walking.tpl
+++ b/Templates/Build/16_walking.tpl
@@ -1,6 +1,7 @@
getMovement(3,$village->wid,0);
$total_for = count($units);
+$timer = 0;
for($y=0;$y<$total_for;$y++){
$timer += 1;
diff --git a/Templates/a2b/attack.tpl b/Templates/a2b/attack.tpl
index 8b2723ad..0fb319ac 100644
--- a/Templates/a2b/attack.tpl
+++ b/Templates/a2b/attack.tpl
@@ -72,7 +72,7 @@ $ckey= $generator->generateRandStr(6);
(!empty($process['t10']) ? $process['t10'] : 0) +
(!empty($process['t11']) ? $process['t11'] : 0);
}
- if ($scout==1 && $totalunits==0) {
+ if (isset($scout) && $scout==1 && isset($totalunits) && $totalunits==0) {
if ($process['c'] != 2){
$process['c'] = 1;
}
|