@@ -236,9 +236,11 @@ |
||
236 | 236 | } |
237 | 237 | |
238 | 238 | // Если новая планета не найдена или было переключения - проверяем текущую выбранную планету |
239 | - if (!isset($planet_row['id'])) // || $planet_row['id'] != $user['current_planet'] |
|
239 | + if (!isset($planet_row['id'])) { |
|
240 | + // || $planet_row['id'] != $user['current_planet'] |
|
240 | 241 | { |
241 | 242 | $planet_row = DBStaticPlanet::db_planet_by_id_and_owner($user['current_planet'], $user['id'], false, 'id'); |
243 | + } |
|
242 | 244 | // Если текущей планеты не существует - выставляем Столицу |
243 | 245 | if (!isset($planet_row['id'])) { |
244 | 246 | $planet_row = DBStaticPlanet::db_planet_by_id_and_owner($user['id_planet'], $user['id'], false, 'id'); |
@@ -1,7 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -function art_use(&$user, &$planetrow, $unit_id) |
|
4 | -{ |
|
3 | +function art_use(&$user, &$planetrow, $unit_id) { |
|
5 | 4 | global $lang; |
6 | 5 | |
7 | 6 | if(!in_array($unit_id, sn_get_groups('artifacts'))) |
@@ -46,14 +45,12 @@ discard block |
||
46 | 45 | { |
47 | 46 | $new_moon_row = uni_create_moon($planetrow['galaxy'], $planetrow['system'], $planetrow['planet'], $user['id'], $moonSize); |
48 | 47 | $message = sprintf($lang['art_moon_create'][$unit_id], $new_moon_row['name'], uni_render_coordinates($planetrow), HelperString::numberFloorAndFormat($moonSize)); |
49 | - } |
|
50 | - else |
|
48 | + } else |
|
51 | 49 | { |
52 | 50 | $message = $lang['art_lhc_moon_fail']; |
53 | 51 | } |
54 | 52 | msg_send_simple_message($user['id'], 0, 0, MSG_TYPE_ADMIN, $lang['art_lhc_from'], $lang['art_lhc_subj'], $message); |
55 | - } |
|
56 | - else |
|
53 | + } else |
|
57 | 54 | { |
58 | 55 | $message = $lang['art_moon_exists']; |
59 | 56 | } |
@@ -81,8 +78,9 @@ discard block |
||
81 | 78 | $sectors_used = 0; |
82 | 79 | foreach($artifact_deploy as $deploy_unit_id => $deploy_unit_level) |
83 | 80 | { |
84 | - if(!($levels_deployed = max(0, $deploy_unit_level - mrc_get_level($user, $planetrow, $deploy_unit_id, true, true)))) |
|
85 | - continue; |
|
81 | + if(!($levels_deployed = max(0, $deploy_unit_level - mrc_get_level($user, $planetrow, $deploy_unit_id, true, true)))) { |
|
82 | + continue; |
|
83 | + } |
|
86 | 84 | $sectors_used += $levels_deployed; |
87 | 85 | $db_changeset['unit'][] = OldDbChangeSet::db_changeset_prepare_unit($deploy_unit_id, $levels_deployed, $user, $planetrow['id']); |
88 | 86 | } |
@@ -116,8 +114,7 @@ discard block |
||
116 | 114 | DBStaticQue::db_que_set_time_left_by_id($que_item['que_id'], $que_item['que_time_left']); |
117 | 115 | $message = sprintf($lang['art_heurestic_chip_ok'], $lang['tech'][$que_item['que_unit_id']], $que_item['que_unit_level'], sys_time_human($old_time - $que_item['que_time_left'])); |
118 | 116 | msg_send_simple_message($user['id'], 0, 0, MSG_TYPE_QUE, $lang['art_heurestic_chip_subj'], $lang['art_heurestic_chip_subj'], $message); |
119 | - } |
|
120 | - else |
|
117 | + } else |
|
121 | 118 | { |
122 | 119 | $message = $lang['art_heurestic_chip_no_research']; |
123 | 120 | } |
@@ -145,8 +142,7 @@ discard block |
||
145 | 142 | $lang['tech'][$que_item['que_unit_id']], $que_item['que_unit_level'], $planetrow['name'], uni_render_coordinates($planetrow), sys_time_human($old_time - $que_item['que_time_left']) |
146 | 143 | ); |
147 | 144 | msg_send_simple_message($user['id'], 0, 0, MSG_TYPE_QUE, $lang['art_nano_builder_subj'], $lang['art_nano_builder_subj'], $message); |
148 | - } |
|
149 | - else |
|
145 | + } else |
|
150 | 146 | { |
151 | 147 | $message = $lang['art_nano_builder_no_que']; |
152 | 148 | } |
@@ -158,8 +154,7 @@ discard block |
||
158 | 154 | $db_changeset['unit'][] = OldDbChangeSet::db_changeset_prepare_unit($unit_id, $unit_level - $artifact_level_old, $user); |
159 | 155 | OldDbChangeSet::db_changeset_apply($db_changeset); |
160 | 156 | } |
161 | - } |
|
162 | - else |
|
157 | + } else |
|
163 | 158 | { |
164 | 159 | $message = $lang['art_err_no_artifact']; |
165 | 160 | } |