Skip to content

Commit

Permalink
GH-131 Simplify code's indentation a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
mdziekon committed Nov 23, 2020
1 parent 8ec7676 commit 2758282
Showing 1 changed file with 22 additions and 32 deletions.
54 changes: 22 additions & 32 deletions includes/CombatEngineAres.php
Original file line number Diff line number Diff line change
Expand Up @@ -415,16 +415,14 @@ function Combat($Attacker, $Defender, $AttackerTech, $DefenderTech, $UseRapidFir
}
unset($DefShipsTypesOwners[$TShip][$TUser]);
$DefShipsTypes[$TShip] -= 1;
} else {
if($Destroyed > 0)
{
if(!isset($AlreadyDestroyedDef[$TKey]))
{
$AlreadyDestroyedDef[$TKey] = 0;
}
$AlreadyDestroyedDef[$TKey] += $Destroyed;
} else if ($Destroyed > 0) {
if (!isset($AlreadyDestroyedDef[$TKey])) {
$AlreadyDestroyedDef[$TKey] = 0;
}

$AlreadyDestroyedDef[$TKey] += $Destroyed;
}

$ACount_Copy -= $Shoots;
}

Expand Down Expand Up @@ -685,15 +683,12 @@ function Combat($Attacker, $Defender, $AttackerTech, $DefenderTech, $UseRapidFir
}
unset($DefShipsTypesOwners[$TShip][$TUser]);
$DefShipsTypes[$TShip] -= 1;
} else {
if($Destroyed > 0)
{
if(!isset($AlreadyDestroyedDef[$TKey]))
{
$AlreadyDestroyedDef[$TKey] = 0;
}
$AlreadyDestroyedDef[$TKey] += $Destroyed;
} else if ($Destroyed > 0) {
if (!isset($AlreadyDestroyedDef[$TKey])) {
$AlreadyDestroyedDef[$TKey] = 0;
}

$AlreadyDestroyedDef[$TKey] += $Destroyed;
}
}
}
Expand Down Expand Up @@ -888,16 +883,14 @@ function Combat($Attacker, $Defender, $AttackerTech, $DefenderTech, $UseRapidFir
}
unset($AtkShipsTypesOwners[$TShip][$TUser]);
$AtkShipsTypes[$TShip] -= 1;
} else {
if($Destroyed > 0)
{
if(!isset($AlreadyDestroyedAtk[$TKey]))
{
$AlreadyDestroyedAtk[$TKey] = 0;
}
$AlreadyDestroyedAtk[$TKey] += $Destroyed;
} else if ($Destroyed > 0) {
if (!isset($AlreadyDestroyedAtk[$TKey])) {
$AlreadyDestroyedAtk[$TKey] = 0;
}

$AlreadyDestroyedAtk[$TKey] += $Destroyed;
}

$ACount_Copy -= $Shoots;
}

Expand Down Expand Up @@ -1158,15 +1151,12 @@ function Combat($Attacker, $Defender, $AttackerTech, $DefenderTech, $UseRapidFir
}
unset($AtkShipsTypesOwners[$TShip][$TUser]);
$AtkShipsTypes[$TShip] -= 1;
} else {
if($Destroyed > 0)
{
if(!isset($AlreadyDestroyedAtk[$TKey]))
{
$AlreadyDestroyedAtk[$TKey] = 0;
}
$AlreadyDestroyedAtk[$TKey] += $Destroyed;
} else if ($Destroyed > 0) {
if (!isset($AlreadyDestroyedAtk[$TKey])) {
$AlreadyDestroyedAtk[$TKey] = 0;
}

$AlreadyDestroyedAtk[$TKey] += $Destroyed;
}
}
}
Expand Down

0 comments on commit 2758282

Please sign in to comment.