mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-06-28 00:24:23 +00:00
Cases 1 to 4 of the procUnits() switch had a byte-identical body (send troops when the rally-point form is submitted, otherwise load the unit form). Stack the four case labels and keep a single shared body via switch fall-through. Behaviour-preserving. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+1
-25
@@ -24,32 +24,8 @@ class Units {
|
||||
|
||||
switch($post['c']) {
|
||||
case 1:
|
||||
if (isset($post['a']) && $post['a'] == 533374 && empty($post['disabled'])) $this->sendTroops($post);
|
||||
else
|
||||
{
|
||||
$post = $this->loadUnits($post);
|
||||
return $post;
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
if (isset($post['a']) && $post['a'] == 533374 && empty($post['disabled'])) $this->sendTroops($post);
|
||||
else
|
||||
{
|
||||
$post = $this->loadUnits($post);
|
||||
return $post;
|
||||
}
|
||||
break;
|
||||
|
||||
case 3:
|
||||
if (isset($post['a']) && $post['a'] == 533374 && empty($post['disabled'])) $this->sendTroops($post);
|
||||
else
|
||||
{
|
||||
$post = $this->loadUnits($post);
|
||||
return $post;
|
||||
}
|
||||
break;
|
||||
|
||||
case 4:
|
||||
if (isset($post['a']) && $post['a'] == 533374 && empty($post['disabled'])) $this->sendTroops($post);
|
||||
else
|
||||
@@ -58,7 +34,7 @@ class Units {
|
||||
return $post;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case 5:
|
||||
if (isset($post['a']) && $post['a'] == "new") $this->Settlers($post);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user