We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -48,8 +48,9 @@ discard block |
||
48 | 48 | } |
49 | 49 | |
50 | 50 | public function setAllianceID($ID) { |
51 | - if ($this->allianceID == $ID) |
|
52 | - return; |
|
51 | + if ($this->allianceID == $ID) { |
|
52 | + return; |
|
53 | + } |
|
53 | 54 | $this->allianceID = $ID; |
54 | 55 | } |
55 | 56 | |
@@ -85,8 +86,7 @@ discard block |
||
85 | 86 | AND id = ' . $db->escapeString($name) . ' LIMIT 1'); |
86 | 87 | if ($db->nextRecord()) { |
87 | 88 | return $db->getObject('info'); |
88 | - } |
|
89 | - else { |
|
89 | + } else { |
|
90 | 90 | return new DummyPlayer(); |
91 | 91 | } |
92 | 92 | } |
@@ -12,10 +12,11 @@ discard block |
||
12 | 12 | $realAttackers = array(); |
13 | 13 | $attackers = array(); |
14 | 14 | $i = 1; |
15 | -if (isset($_POST['attackers'])) |
|
15 | +if (isset($_POST['attackers'])) { |
|
16 | 16 | foreach ($_POST['attackers'] as $attackerName) { |
17 | 17 | if ($attackerName == 'none') |
18 | 18 | continue; |
19 | +} |
|
19 | 20 | if (isset($usedNames[$attackerName])) { |
20 | 21 | $duplicates = true; |
21 | 22 | continue; |
@@ -27,17 +28,19 @@ discard block |
||
27 | 28 | ++$i; |
28 | 29 | } |
29 | 30 | |
30 | -for (;$i <= 10; ++$i) |
|
31 | +for (;$i <= 10; ++$i) { |
|
31 | 32 | $attackers[$i] = null; |
33 | +} |
|
32 | 34 | $template->assign('Attackers', $attackers); |
33 | 35 | |
34 | 36 | $i = 1; |
35 | 37 | $realDefenders = array(); |
36 | 38 | $defenders = array(); |
37 | -if (isset($_POST['defenders'])) |
|
39 | +if (isset($_POST['defenders'])) { |
|
38 | 40 | foreach ($_POST['defenders'] as $defenderName) { |
39 | 41 | if ($defenderName == 'none') |
40 | 42 | continue; |
43 | +} |
|
41 | 44 | if (isset($usedNames[$defenderName])) { |
42 | 45 | $duplicates = true; |
43 | 46 | continue; |
@@ -49,8 +52,9 @@ discard block |
||
49 | 52 | ++$i; |
50 | 53 | } |
51 | 54 | |
52 | -for (;$i <= 10; ++$i) |
|
55 | +for (;$i <= 10; ++$i) { |
|
53 | 56 | $defenders[$i] = null; |
57 | +} |
|
54 | 58 | $template->assign('Defenders', $defenders); |
55 | 59 | |
56 | 60 | $template->assign('Duplicates', $duplicates); |
@@ -65,12 +69,14 @@ discard block |
||
65 | 69 | while (count($realAttackers) > 0 && count($realDefenders) > 0) { |
66 | 70 | runAnAttack($realAttackers, $realDefenders); |
67 | 71 | foreach ($realAttackers as $key => &$teamPlayer) { |
68 | - if ($teamPlayer->isDead()) |
|
69 | - unset($realAttackers[$key]); |
|
72 | + if ($teamPlayer->isDead()) { |
|
73 | + unset($realAttackers[$key]); |
|
74 | + } |
|
70 | 75 | } unset($teamPlayer); |
71 | 76 | foreach ($realDefenders as $key => &$teamPlayer) { |
72 | - if ($teamPlayer->isDead()) |
|
73 | - unset($realDefenders[$key]); |
|
77 | + if ($teamPlayer->isDead()) { |
|
78 | + unset($realDefenders[$key]); |
|
79 | + } |
|
74 | 80 | } unset($teamPlayer); |
75 | 81 | } |
76 | 82 | } |