@@ -33,8 +33,7 @@ discard block |
||
33 | 33 | if($quest_rewards_amount < 0) |
34 | 34 | { |
35 | 35 | throw new Exception($lang['qst_adm_err_reward_amount']); |
36 | - } |
|
37 | - elseif($quest_rewards_amount > 0) |
|
36 | + } elseif($quest_rewards_amount > 0) |
|
38 | 37 | { |
39 | 38 | $quest_rewards[] = "{$quest_rewards_id},{$quest_rewards_amount}"; |
40 | 39 | } |
@@ -75,8 +74,7 @@ discard block |
||
75 | 74 | `quest_rewards` = '{$quest_rewards}' |
76 | 75 | WHERE `quest_id` = {$quest_id} LIMIT 1;" |
77 | 76 | ); |
78 | - } |
|
79 | - else |
|
77 | + } else |
|
80 | 78 | { |
81 | 79 | sn_db_perform('{{quest}}', array( |
82 | 80 | 'quest_name' => $quest_name, |
@@ -94,8 +92,7 @@ discard block |
||
94 | 92 | msg_send_simple_message('*', 0, 0, MSG_TYPE_PLAYER, $lang['sys_administration'], $lang['news_title'], $text); |
95 | 93 | } |
96 | 94 | */ |
97 | - } |
|
98 | - catch (Exception $e) |
|
95 | + } catch (Exception $e) |
|
99 | 96 | { |
100 | 97 | message($e->getMessage(), $lang['sys_error']); |
101 | 98 | } |
@@ -119,8 +116,7 @@ discard block |
||
119 | 116 | } |
120 | 117 | $query = doquery("SELECT count(*) AS count FROM {{quest}};", '', true); |
121 | 118 | $config->db_saveItem('quest_total', $query['count']); |
122 | - } |
|
123 | - elseif(!$user_id) |
|
119 | + } elseif(!$user_id) |
|
124 | 120 | { |
125 | 121 | $user_id = $user['id']; |
126 | 122 | } |
@@ -137,8 +133,7 @@ discard block |
||
137 | 133 | if($quest) |
138 | 134 | { |
139 | 135 | $quest_templatized = qst_templatize(qst_quest_parse($quest, false)); |
140 | - } |
|
141 | - else |
|
136 | + } else |
|
142 | 137 | { |
143 | 138 | $quest_templatized['quest_rewards_list'] = array(); |
144 | 139 | } |
@@ -193,8 +188,7 @@ discard block |
||
193 | 188 | if($status == null) |
194 | 189 | { |
195 | 190 | $query_add_where .= "IS NULL"; |
196 | - } |
|
197 | - else |
|
191 | + } else |
|
198 | 192 | { |
199 | 193 | $query_add_where .= "= {$status}"; |
200 | 194 | } |
@@ -223,8 +217,7 @@ discard block |
||
223 | 217 | if($block_name) |
224 | 218 | { |
225 | 219 | $template->assign_block_vars($block_name, $quest_templatized); |
226 | - } |
|
227 | - else |
|
220 | + } else |
|
228 | 221 | { |
229 | 222 | $template->assign_vars($quest_templatized); |
230 | 223 | if(!empty($quest_templatized['quest_rewards_list'])) |
@@ -292,7 +285,9 @@ discard block |
||
292 | 285 | |
293 | 286 | function qst_reward(&$user, &$rewards, &$quest_list) |
294 | 287 | { |
295 | - if(empty($rewards)) return; |
|
288 | + if(empty($rewards)) { |
|
289 | + return; |
|
290 | + } |
|
296 | 291 | |
297 | 292 | global $lang; |
298 | 293 | |
@@ -300,11 +295,12 @@ discard block |
||
300 | 295 | $total_rewards = array(); |
301 | 296 | $comment_dm = ''; |
302 | 297 | |
303 | - foreach($rewards as $quest_id => $user_data) |
|
304 | - foreach($user_data as $user_id => $planet_data) |
|
298 | + foreach($rewards as $quest_id => $user_data) { |
|
299 | + foreach($user_data as $user_id => $planet_data) |
|
305 | 300 | foreach($planet_data as $planet_id => $reward_list) |
306 | 301 | { |
307 | 302 | $comment = sprintf($lang['qst_msg_complete_body'], $quest_list[$quest_id]['quest_name']); |
303 | + } |
|
308 | 304 | $comment_dm .= isset($reward_list[RES_DARK_MATTER]) ? $comment : ''; |
309 | 305 | |
310 | 306 | $comment_reward = array(); |
@@ -336,17 +332,17 @@ discard block |
||
336 | 332 | $local_changeset = array(); |
337 | 333 | foreach($unit_data as $unit_id => $unit_amount) |
338 | 334 | { |
339 | - if(!isset($quest_rewards_allowed[$unit_id])) continue; |
|
335 | + if(!isset($quest_rewards_allowed[$unit_id])) { |
|
336 | + continue; |
|
337 | + } |
|
340 | 338 | |
341 | 339 | if($unit_id == RES_DARK_MATTER) |
342 | 340 | { |
343 | 341 | rpg_points_change($user['id'], RPG_QUEST, $unit_amount, $comment_dm); |
344 | - } |
|
345 | - elseif(isset($group_resources[$unit_id])) |
|
342 | + } elseif(isset($group_resources[$unit_id])) |
|
346 | 343 | { |
347 | 344 | $local_changeset[pname_resource_name($unit_id)] = array('delta' => $unit_amount); |
348 | - } |
|
349 | - else // Проверим на юниты |
|
345 | + } else // Проверим на юниты |
|
350 | 346 | { |
351 | 347 | $db_changeset['unit'][] = sn_db_unit_changeset_prepare($unit_id, $unit_amount, $user_row, $planet_id); |
352 | 348 | } |
@@ -79,8 +79,7 @@ discard block |
||
79 | 79 | // TODO Добавить $sender - рассылка может быть и от кого-то |
80 | 80 | db_message_insert_all($message_type, $from, $subject, $text); |
81 | 81 | $owners = array(); |
82 | - } |
|
83 | - else |
|
82 | + } else |
|
84 | 83 | { |
85 | 84 | $insert_values = array(); |
86 | 85 | $insert_template = "('%u'," . str_replace('%', '%%', " '{$sender}', '{$timestamp}', '{$message_type}', '{$from}', '{$subject}', '{$text}')"); |
@@ -90,8 +89,7 @@ discard block |
||
90 | 89 | if($user['id'] != $owner) |
91 | 90 | { |
92 | 91 | $owner_row = db_user_by_id($owner); |
93 | - } |
|
94 | - else |
|
92 | + } else |
|
95 | 93 | { |
96 | 94 | $owner_row = $user; |
97 | 95 | } |
@@ -250,16 +250,17 @@ discard block |
||
250 | 250 | if(($selected_planet = sys_get_param_id('cp')) && $selected_planet != $user['current_planet']) |
251 | 251 | { |
252 | 252 | $planet_row = db_planet_by_id_and_owner($selected_planet, $user['id'], false, 'id'); |
253 | - } |
|
254 | - else |
|
253 | + } else |
|
255 | 254 | { |
256 | 255 | $planet_row = db_planet_by_id($planet_row['id']); |
257 | 256 | } |
258 | 257 | |
259 | 258 | // Если новая планета не найдена или было переключения - проверяем текущую выбранную планету |
260 | - if(!isset($planet_row['id'])) // || $planet_row['id'] != $user['current_planet'] |
|
259 | + if(!isset($planet_row['id'])) { |
|
260 | + // || $planet_row['id'] != $user['current_planet'] |
|
261 | 261 | { |
262 | 262 | $planet_row = db_planet_by_id_and_owner($user['current_planet'], $user['id'], false, 'id'); |
263 | + } |
|
263 | 264 | // Если текущей планеты не существует - выставляем Столицу |
264 | 265 | if(!isset($planet_row['id'])) |
265 | 266 | { |
@@ -301,8 +302,7 @@ discard block |
||
301 | 302 | if(!$from['id']) |
302 | 303 | { |
303 | 304 | $result = $lang['sys_planet_expedition']; |
304 | - } |
|
305 | - else |
|
305 | + } else |
|
306 | 306 | { |
307 | 307 | $from_planet_id = $include_id ? ( |
308 | 308 | 'ID {' . ($from['id'] ? $from['id'] : ($from[$prefix . 'planet_id'] ? $from[$prefix . 'planet_id'] : 0)) . '} ' |
@@ -38,8 +38,7 @@ discard block |
||
38 | 38 | if($user['user_as_ally']) |
39 | 39 | { |
40 | 40 | $lab_level = doquery("SELECT ally_members AS effective_level FROM {{alliance}} WHERE id = {$user['user_as_ally']} LIMIT 1", true); |
41 | - } |
|
42 | - else |
|
41 | + } else |
|
43 | 42 | { |
44 | 43 | $tech_intergalactic = mrc_get_level($user, false, TECH_RESEARCH) + 1; |
45 | 44 | $lab_level['effective_level'] = 0; |
@@ -238,8 +237,7 @@ discard block |
||
238 | 237 | //{ |
239 | 238 | // $result = true; |
240 | 239 | //} |
241 | - } |
|
242 | - elseif(($unit_id == UNIT_TECHNOLOGIES || in_array($unit_id, sn_get_groups('tech'))) && !$config->BuildLabWhileRun && $planet['que']) |
|
240 | + } elseif(($unit_id == UNIT_TECHNOLOGIES || in_array($unit_id, sn_get_groups('tech'))) && !$config->BuildLabWhileRun && $planet['que']) |
|
243 | 241 | { |
244 | 242 | $result = eco_is_builds_in_que($planet['que'], array(STRUC_LABORATORY, STRUC_LABORATORY_NANO)); |
245 | 243 | } |
@@ -41,12 +41,10 @@ |
||
41 | 41 | if(!$check_result) |
42 | 42 | { |
43 | 43 | $version_check = SNC_VER_ERROR_CONNECT; |
44 | -} |
|
45 | -elseif(($version_check = intval($check_result)) && $version_check == $check_result) |
|
44 | +} elseif(($version_check = intval($check_result)) && $version_check == $check_result) |
|
46 | 45 | { |
47 | 46 | $version_check = $check_result; |
48 | -} |
|
49 | -else |
|
47 | +} else |
|
50 | 48 | { |
51 | 49 | // JSON decode if string |
52 | 50 | $check_result = json_decode($check_result, true); |
@@ -115,8 +115,7 @@ |
||
115 | 115 | )); |
116 | 116 | |
117 | 117 | display($template, $lang['tech'][STRUC_MOON_GATE]); |
118 | - } |
|
119 | - else |
|
118 | + } else |
|
120 | 119 | { |
121 | 120 | message($lang['gate_no_src_ga'], $lang['tech'][STRUC_MOON_GATE], "overview.php", 10); |
122 | 121 | } |
@@ -21,8 +21,7 @@ discard block |
||
21 | 21 | |
22 | 22 | $sym_defender = $unpacked['D']; |
23 | 23 | $sym_attacker = $unpacked['A']; |
24 | -} |
|
25 | -else |
|
24 | +} else |
|
26 | 25 | { |
27 | 26 | $sym_defender = array(0 => $sym_defender); |
28 | 27 | $sym_attacker = array(1 => $sym_attacker); |
@@ -56,8 +55,7 @@ discard block |
||
56 | 55 | $template = gettemplate('ube_combat_report', true); |
57 | 56 | $template->assign_recursive($template_result); |
58 | 57 | display($template, '', false, '', false, false, true); |
59 | -} |
|
60 | -else |
|
58 | +} else |
|
61 | 59 | { |
62 | 60 | $template = gettemplate('simulator', true); |
63 | 61 | $techs_and_officers = array(TECH_WEAPON, TECH_SHIELD, TECH_ARMOR, MRC_ADMIRAL); |
@@ -24,7 +24,9 @@ |
||
24 | 24 | * DO NOT CHANGE |
25 | 25 | */ |
26 | 26 | |
27 | -if (!defined('INSIDE')) die(); |
|
27 | +if (!defined('INSIDE')) { |
|
28 | + die(); |
|
29 | +} |
|
28 | 30 | |
29 | 31 | |
30 | 32 | $a_lang_array = (array( |
@@ -24,7 +24,9 @@ |
||
24 | 24 | * DO NOT CHANGE |
25 | 25 | */ |
26 | 26 | |
27 | -if (!defined('INSIDE')) die(); |
|
27 | +if (!defined('INSIDE')) { |
|
28 | + die(); |
|
29 | +} |
|
28 | 30 | |
29 | 31 | |
30 | 32 | $a_lang_array = (array( |