@@ -14,34 +14,34 @@ discard block |
||
14 | 14 | use DBStatic\DBStaticUnit; |
15 | 15 | use DBStatic\DBStaticUser; |
16 | 16 | |
17 | -include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
17 | +include('common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
18 | 18 | |
19 | 19 | lng_include('fleet'); |
20 | 20 | |
21 | -if($TargetPlanet = sys_get_param_id('jmpto')) |
|
21 | +if ($TargetPlanet = sys_get_param_id('jmpto')) |
|
22 | 22 | { |
23 | 23 | sn_db_transaction_start(); |
24 | 24 | DBStaticUser::db_user_by_id($user['id'], true, 'id'); |
25 | 25 | $planetrow = DBStaticPlanet::db_planet_by_id($planetrow['id'], true); |
26 | - if(!($NextJumpTime = uni_get_time_to_jump($planetrow))) |
|
26 | + if (!($NextJumpTime = uni_get_time_to_jump($planetrow))) |
|
27 | 27 | { |
28 | 28 | $TargetGate = DBStaticPlanet::db_planet_by_id($TargetPlanet, true, '`id`, `last_jump_time`'); |
29 | - if(mrc_get_level($user, $TargetGate, STRUC_MOON_GATE) > 0) |
|
29 | + if (mrc_get_level($user, $TargetGate, STRUC_MOON_GATE) > 0) |
|
30 | 30 | { |
31 | - $NextDestTime = uni_get_time_to_jump ( $TargetGate ); |
|
32 | - if(!$NextDestTime) |
|
31 | + $NextDestTime = uni_get_time_to_jump($TargetGate); |
|
32 | + if (!$NextDestTime) |
|
33 | 33 | { |
34 | 34 | $ship_list = sys_get_param('ships'); |
35 | 35 | $jumpMade = false; |
36 | - foreach($ship_list as $ship_id => $ship_count) |
|
36 | + foreach ($ship_list as $ship_id => $ship_count) |
|
37 | 37 | { |
38 | - if(!in_array($ship_id, classSupernova::$gc->groupFleet)) |
|
38 | + if (!in_array($ship_id, classSupernova::$gc->groupFleet)) |
|
39 | 39 | { |
40 | 40 | continue; |
41 | 41 | } |
42 | 42 | |
43 | 43 | $ship_count = max(0, min(floor($ship_count), mrc_get_level($user, $planetrow, $ship_id))); |
44 | - if($ship_count) |
|
44 | + if ($ship_count) |
|
45 | 45 | { |
46 | 46 | $jumpMade = true; |
47 | 47 | DBStaticUnit::dbUpdateOrInsertUnit($ship_id, -$ship_count, $user, $planetrow['id']); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | } |
50 | 50 | } |
51 | 51 | |
52 | - if($jumpMade) |
|
52 | + if ($jumpMade) |
|
53 | 53 | { |
54 | 54 | DBStaticPlanet::db_planet_update_set_by_id( |
55 | 55 | $TargetGate['id'], |
@@ -71,31 +71,31 @@ discard block |
||
71 | 71 | ); |
72 | 72 | |
73 | 73 | $planetrow['last_jump_time'] = SN_TIME_NOW; |
74 | - $RetMessage = classLocale::$lang['gate_jump_done'] ." - ". pretty_time(uni_get_time_to_jump($planetrow)); |
|
74 | + $RetMessage = classLocale::$lang['gate_jump_done']." - ".pretty_time(uni_get_time_to_jump($planetrow)); |
|
75 | 75 | } else { |
76 | 76 | $RetMessage = classLocale::$lang['gate_wait_data']; |
77 | 77 | } |
78 | 78 | } else { |
79 | - $RetMessage = classLocale::$lang['gate_wait_dest'] ." - ". pretty_time($NextDestTime); |
|
79 | + $RetMessage = classLocale::$lang['gate_wait_dest']." - ".pretty_time($NextDestTime); |
|
80 | 80 | } |
81 | 81 | } else { |
82 | 82 | $RetMessage = classLocale::$lang['gate_no_dest_g']; |
83 | 83 | } |
84 | 84 | } else { |
85 | - $RetMessage = classLocale::$lang['gate_wait_star'] ." - ". pretty_time($NextJumpTime); |
|
85 | + $RetMessage = classLocale::$lang['gate_wait_star']." - ".pretty_time($NextJumpTime); |
|
86 | 86 | } |
87 | 87 | sn_db_transaction_commit(); |
88 | 88 | message($RetMessage, classLocale::$lang['tech'][STRUC_MOON_GATE], "jumpgate.php", 10); |
89 | 89 | } else { |
90 | 90 | $template = gettemplate('jumpgate', true); |
91 | - if(mrc_get_level($user, $planetrow, STRUC_MOON_GATE) > 0) |
|
91 | + if (mrc_get_level($user, $planetrow, STRUC_MOON_GATE) > 0) |
|
92 | 92 | { |
93 | 93 | $Combo = ''; |
94 | 94 | $MoonList = DBStaticPlanet::db_planet_list_moon_other($user['id'], $planetrow['id']); |
95 | 95 | // while($CurMoon = db_fetch($MoonList)) |
96 | - foreach($MoonList as $CurMoon) |
|
96 | + foreach ($MoonList as $CurMoon) |
|
97 | 97 | { |
98 | - if(mrc_get_level($user, $CurMoon, STRUC_MOON_GATE) >= 1) |
|
98 | + if (mrc_get_level($user, $CurMoon, STRUC_MOON_GATE) >= 1) |
|
99 | 99 | { |
100 | 100 | $NextJumpTime = uni_get_time_to_jump($CurMoon); |
101 | 101 | $template->assign_block_vars('moon', array( |
@@ -109,9 +109,9 @@ discard block |
||
109 | 109 | } |
110 | 110 | } |
111 | 111 | |
112 | - foreach(classSupernova::$gc->groupFleet as $Ship) |
|
112 | + foreach (classSupernova::$gc->groupFleet as $Ship) |
|
113 | 113 | { |
114 | - if(($ship_count = mrc_get_level($user, $planetrow, $Ship)) <= 0) |
|
114 | + if (($ship_count = mrc_get_level($user, $planetrow, $Ship)) <= 0) |
|
115 | 115 | { |
116 | 116 | continue; |
117 | 117 | } |