From d22541903a8cd377787e7d986799450345406d07 Mon Sep 17 00:00:00 2001 From: Patrick Date: Thu, 9 Jun 2016 22:36:55 -0600 Subject: [PATCH] Various parameter/argument issues --- classes/Planet.php | 2 +- classes/Xenobe.php | 11 ----------- planet.php | 2 +- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/classes/Planet.php b/classes/Planet.php index 3811b7e35..f9ea8cc59 100644 --- a/classes/Planet.php +++ b/classes/Planet.php @@ -44,7 +44,7 @@ public function getOwner($pdo_db, $db = null, $planet_id = null, &$owner_info = return false; } - public static function planetBombing($pdo_db, $db, $lang, $langvars, \Tki\Reg $tkireg, $playerinfo, $ownerinfo, $planetinfo) + public static function planetBombing($pdo_db, $db, $lang, $langvars, \Tki\Reg $tkireg, $playerinfo, $ownerinfo, $planetinfo, $template) { if ($playerinfo['turns'] < 1) { diff --git a/classes/Xenobe.php b/classes/Xenobe.php index 2d70cc1f2..69120b63f 100644 --- a/classes/Xenobe.php +++ b/classes/Xenobe.php @@ -412,7 +412,6 @@ public static function xenobeToPlanet($pdo_db, $db, $planet_id, \Tki\Reg $tkireg { if ($targettorpdmg > $attackerarmor) // Target fired torpedoes greater than half of attacker armor { - $targettorpdmg = $targettorpdmg - $attackerarmor; // Target loses fired torpedoes equal to attacker armor $attackerarmor = 0; // Attacker loses all armor (Attacker destroyed) } else @@ -467,11 +466,6 @@ public static function xenobeToPlanet($pdo_db, $db, $planet_id, \Tki\Reg $tkireg $attackertorps = 0; } - if ($attackerbeams < 0) - { - $attackerbeams = 0; - } - if ($attackerarmor < 0) { $attackerarmor = 0; @@ -803,12 +797,10 @@ public static function xenobeToShip($pdo_db, $db, $ship_id, \Tki\Reg $tkireg, $p { // Target fires torps - continue combat - torps VS armor if ($targettorpdmg > $attackerarmor) { // Target fired torps GT half Attacker armor - $targettorpdmg = $targettorpdmg - $attackerarmor; // T loses fired torps EQ to A armor $attackerarmor = 0; // A loses all armor (A DESTROYED) } else { // Target fired torps LE half Attacker armor - $attackerarmor = $attackerarmor - $targettorpdmg; // A loses armor EQ to T torps fired $targettorpdmg = 0; // T loses all torps fired } } @@ -1143,7 +1135,6 @@ public static function xenobeToSecDef($pdo_db, $db, $langvars, $playerinfo, $tar $roll = 1; } - $totalmines = $totalmines - $roll; $playerminedeflect = $playerinfo['ship_fighters']; // Xenobe keep as many deflectors as fighters // Combat - Beams v fighters @@ -1153,7 +1144,6 @@ public static function xenobeToSecDef($pdo_db, $db, $langvars, $playerinfo, $tar { $temp = round($targetfighters / 2); $targetfighters = $temp; - $playerbeams = $playerbeams - $temp; } else { @@ -1171,7 +1161,6 @@ public static function xenobeToSecDef($pdo_db, $db, $langvars, $playerinfo, $tar } else { - $targetfighters = $targetfighters - $playertorpdmg; $playertorpdmg = 0; } } diff --git a/planet.php b/planet.php index 531f4dedf..a53895a60 100644 --- a/planet.php +++ b/planet.php @@ -626,7 +626,7 @@ } elseif ($command == "bomb" && $tkireg->allow_sofa) { - BadPlanet::planetBombing($pdo_db, $db, $lang, $langvars, $tkireg, $playerinfo, $ownerinfo, $planetinfo); + BadPlanet::planetBombing($pdo_db, $db, $lang, $langvars, $tkireg, $playerinfo, $ownerinfo, $planetinfo, $template); } elseif ($command == "scan") {