Skip to content

Commit

Permalink
Various parameter/argument issues
Browse files Browse the repository at this point in the history
  • Loading branch information
thekabal committed Jun 10, 2016
1 parent 0447310 commit d225419
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 13 deletions.
2 changes: 1 addition & 1 deletion classes/Planet.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
11 changes: 0 additions & 11 deletions classes/Xenobe.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
}
}
Expand Down Expand Up @@ -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
Expand All @@ -1153,7 +1144,6 @@ public static function xenobeToSecDef($pdo_db, $db, $langvars, $playerinfo, $tar
{
$temp = round($targetfighters / 2);
$targetfighters = $temp;
$playerbeams = $playerbeams - $temp;
}
else
{
Expand All @@ -1171,7 +1161,6 @@ public static function xenobeToSecDef($pdo_db, $db, $langvars, $playerinfo, $tar
}
else
{
$targetfighters = $targetfighters - $playertorpdmg;
$playertorpdmg = 0;
}
}
Expand Down
2 changes: 1 addition & 1 deletion planet.php
Original file line number Diff line number Diff line change
Expand Up @@ -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")
{
Expand Down

0 comments on commit d225419

Please sign in to comment.