From 62102a25cc4af105fc438af7ae8077ec33e9ac39 Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Sun, 1 Mar 2026 23:50:25 +0300 Subject: [PATCH 1/2] style: Rename star_by_name > find_star_by_name --- objects/obj_en_fleet/Alarm_1.gml | 2 +- objects/obj_event_log/Draw_0.gml | 2 +- objects/obj_ncombat/Alarm_7.gml | 2 +- objects/obj_p_fleet/Draw_0.gml | 4 ++-- objects/obj_popup/Step_0.gml | 4 ++-- objects/obj_turn_end/Alarm_0.gml | 2 +- objects/obj_turn_end/Alarm_4.gml | 2 +- scripts/scr_ancient_ruins/scr_ancient_ruins.gml | 6 +++--- .../scr_company_struct/scr_company_struct.gml | 4 ++-- scripts/scr_dialogue/scr_dialogue.gml | 4 ++-- scripts/scr_event_code/scr_event_code.gml | 4 ++-- .../scr_fleet_functions/scr_fleet_functions.gml | 2 +- .../scr_ini_ship_cleanup.gml | 2 +- .../scr_inquisition_mission.gml | 10 +++++----- scripts/scr_marine_struct/scr_marine_struct.gml | 6 +++--- .../scr_player_fleet_functions.gml | 6 +++--- .../scr_post_battle_events.gml | 2 +- .../scr_system_search_helpers.gml | 16 +++++----------- .../scr_system_spawn_functions.gml | 16 ++++++++-------- scripts/scr_ui_manage/scr_ui_manage.gml | 2 +- .../scr_unit_quick_find_pane.gml | 10 +++++----- 21 files changed, 51 insertions(+), 57 deletions(-) diff --git a/objects/obj_en_fleet/Alarm_1.gml b/objects/obj_en_fleet/Alarm_1.gml index 8b2edd1abb..0f4b1bd904 100644 --- a/objects/obj_en_fleet/Alarm_1.gml +++ b/objects/obj_en_fleet/Alarm_1.gml @@ -461,7 +461,7 @@ try { } else if (action_eta == 0) { action = ""; if (array_length(complex_route) > 0) { - var target_loc = star_by_name(complex_route[0]); + var target_loc = find_star_by_name(complex_route[0]); if (target_loc != "none") { array_delete(complex_route, 0, 1); action_x = target_loc.x; diff --git a/objects/obj_event_log/Draw_0.gml b/objects/obj_event_log/Draw_0.gml index b4de77078c..f1d803db3b 100644 --- a/objects/obj_event_log/Draw_0.gml +++ b/objects/obj_event_log/Draw_0.gml @@ -40,7 +40,7 @@ if (__b__) { draw_text_ext(xx + 25, yy + 120 + (p * 26), $"{cur_event.date} (Turn {cur_event.turn}) - {cur_event.text}", -1, 1554); if (cur_event.event_target != "none") { if (point_and_click(draw_unit_buttons([xx + 1400, yy + 120 + (p * 26)], "View", [1, 1], c_green,, fnt_40k_14b, 1, true))) { - var view_star = star_by_name(cur_event.event_target); + var view_star = find_star_by_name(cur_event.event_target); if (view_star != "none") { main_map_defaults(); obj_controller.x = view_star.x; diff --git a/objects/obj_ncombat/Alarm_7.gml b/objects/obj_ncombat/Alarm_7.gml index 581c636855..5fb0566898 100644 --- a/objects/obj_ncombat/Alarm_7.gml +++ b/objects/obj_ncombat/Alarm_7.gml @@ -321,7 +321,7 @@ try { } if ((string_count("ruins", battle_special) > 0) && (defeat == 1)) { //TODO this logic is wrong assumes all player units died in ruins - var _combat_star = star_by_name(obj_ncombat.battle_loc); + var _combat_star = find_star_by_name(obj_ncombat.battle_loc); if (_combat_star != "none") { _combat_star.p_player[obj_ncombat.battle_id] -= obj_ncombat.world_size; } diff --git a/objects/obj_p_fleet/Draw_0.gml b/objects/obj_p_fleet/Draw_0.gml index aa5a4753f7..be21958777 100644 --- a/objects/obj_p_fleet/Draw_0.gml +++ b/objects/obj_p_fleet/Draw_0.gml @@ -107,11 +107,11 @@ if (action != "") { if (array_length(complex_route) > 0) { var next_loc = instance_nearest(action_x, action_y, obj_star); for (var i = 0; i < array_length(complex_route); i++) { - var target_loc = star_by_name(complex_route[i]); + var target_loc = find_star_by_name(complex_route[i]); draw_set_color(c_blue); draw_set_alpha(1); draw_line_dashed(next_loc.x, next_loc.y, target_loc.x, target_loc.y, 16, line_width); - next_loc = star_by_name(complex_route[i]); + next_loc = find_star_by_name(complex_route[i]); } } } diff --git a/objects/obj_popup/Step_0.gml b/objects/obj_popup/Step_0.gml index befd3b8719..20ef1d2214 100644 --- a/objects/obj_popup/Step_0.gml +++ b/objects/obj_popup/Step_0.gml @@ -227,7 +227,7 @@ try { var mission_star, onceh; onceh = 0; obj_controller.temp[200] = string(loc); - var mission_star = star_by_name(obj_controller.temp[200]); + var mission_star = find_star_by_name(obj_controller.temp[200]); if (add_new_problem(planet, "recon", estimate, mission_star)) { title = "Inquisition Mission Demand"; text = $"The Inquisition demands that your Chapter demonstrate its loyalty to the Imperium of Mankind and the Emperor. {global.chapter_name} are to land Astartes on {mission_star.name} {scr_roman(planet)} to investigate the planet within {estimate} months."; @@ -243,7 +243,7 @@ try { var mission_star, onceh; mission_star = 0; onceh = 0; - var mission_star = star_by_name(obj_controller.temp[200]); + var mission_star = find_star_by_name(obj_controller.temp[200]); var mission_is_go = false; if (mission_star != "none" && planet > 0) { var _estimate = estimate; diff --git a/objects/obj_turn_end/Alarm_0.gml b/objects/obj_turn_end/Alarm_0.gml index 8bc27cfde5..da67c1d696 100644 --- a/objects/obj_turn_end/Alarm_0.gml +++ b/objects/obj_turn_end/Alarm_0.gml @@ -47,7 +47,7 @@ try { ii = 0; good = 0; - var battle_star = star_by_name(battle_location[current_battle]); + var battle_star = find_star_by_name(battle_location[current_battle]); if (battle_star != "none") { // trying to find the star diff --git a/objects/obj_turn_end/Alarm_4.gml b/objects/obj_turn_end/Alarm_4.gml index 2a3509de5e..725d0b442a 100644 --- a/objects/obj_turn_end/Alarm_4.gml +++ b/objects/obj_turn_end/Alarm_4.gml @@ -7,7 +7,7 @@ instance_activate_object(obj_star); if ((battles > 0) && (current_battle <= battles)) { var ii = 0, good = 0; - var battle_star = star_by_name(battle_location[current_battle]); + var battle_star = find_star_by_name(battle_location[current_battle]); obj_controller.temp[1060] = battle_location[current_battle]; if (battle_star != "none") { diff --git a/scripts/scr_ancient_ruins/scr_ancient_ruins.gml b/scripts/scr_ancient_ruins/scr_ancient_ruins.gml index 8ec0d071dc..ec87f2873f 100644 --- a/scripts/scr_ancient_ruins/scr_ancient_ruins.gml +++ b/scripts/scr_ancient_ruins/scr_ancient_ruins.gml @@ -25,7 +25,7 @@ function scr_ruins_suprise_attack_player() { instance_activate_object(obj_star_select); instance_activate_object(obj_star); instance_activate_object(obj_ground_mission); - var _star = star_by_name(obj_ground_mission.loc); + var _star = find_star_by_name(obj_ground_mission.loc); var _planet = obj_ground_mission.num; var _units = obj_ground_mission.display_unit; @@ -360,7 +360,7 @@ function ruins_exploration_main_sequence() { } else { var obj = obj_ground_mission.obj; instance_activate_object(obj_star); - scr_ruins_reward(star_by_name(obj_ground_mission.battle_loc), obj_ground_mission.num, obj_ground_mission.explore_feature); + scr_ruins_reward(find_star_by_name(obj_ground_mission.battle_loc), obj_ground_mission.num, obj_ground_mission.explore_feature); instance_destroy(); exit; } @@ -394,7 +394,7 @@ function scr_ruins_combat_end() { var _star = 0; ruins_battle = choose(6, 7, 9, 10, 11, 12); - _star = star_by_name(obj_ground_mission.battle_loc); + _star = find_star_by_name(obj_ground_mission.battle_loc); var planet = obj_ground_mission.num; var _battle_threat = obj_ground_mission.battle_threat; if (obj_ground_mission.defeat == 0) { diff --git a/scripts/scr_company_struct/scr_company_struct.gml b/scripts/scr_company_struct/scr_company_struct.gml index 9c388b25bf..bb0a572180 100644 --- a/scripts/scr_company_struct/scr_company_struct.gml +++ b/scripts/scr_company_struct/scr_company_struct.gml @@ -253,7 +253,7 @@ function CompanyStruct(comp) constructor { } } if (send_on_mission) { - send_squad_on_mission(mission_type, star_by_name(_squad_sys)); + send_squad_on_mission(mission_type, find_star_by_name(_squad_sys)); } bound_height[0] += 180; } else { @@ -285,7 +285,7 @@ function CompanyStruct(comp) constructor { if (cur_assignment.type == "garrison") { var garrison_but = draw_unit_buttons([cancel_but[2] + 10, cancel_but[1]], "View Garrison", [1, 1], c_red,,,, true); if (point_and_click(garrison_but)) { - var garrrison_star = star_by_name(cur_assignment.location); + var garrrison_star = find_star_by_name(cur_assignment.location); obj_controller.view_squad = false; if (garrrison_star != "none") { scr_toggle_manage(); diff --git a/scripts/scr_dialogue/scr_dialogue.gml b/scripts/scr_dialogue/scr_dialogue.gml index 22cfda45c7..6db2d9247a 100644 --- a/scripts/scr_dialogue/scr_dialogue.gml +++ b/scripts/scr_dialogue/scr_dialogue.gml @@ -398,7 +398,7 @@ function scr_dialogue(diplo_keyphrase, data = {}) { if (!_found) { var _master = fetch_unit([0, 0]); if (_master.planet_location > 0) { - var _master_star = star_by_name(_master.location_string); + var _master_star = find_star_by_name(_master.location_string); if (_master_star != "none") { _found = true; _planet = _master.planet_location; @@ -2183,7 +2183,7 @@ function scr_dialogue(diplo_keyphrase, data = {}) { var _event = audience_data; var _system = _event.system; var _planet = _event.planet; - var _star_name = planet_numeral_name(_planet, star_by_name(_system)); + var _star_name = planet_numeral_name(_planet, find_star_by_name(_system)); diplo_text = $"My patience is wearing thin, Chapter Master. I have many more problems more urgent and, yet, you continue to force me away from the work assigned to me by He on Terra. Your serf on {_star_name} will be executed along with all the other puppets I ferret out. You are close to treason, Chapter Master. Choose your next words with exceptional care for they may be your last."; add_diplomacy_option({ diff --git a/scripts/scr_event_code/scr_event_code.gml b/scripts/scr_event_code/scr_event_code.gml index 11a514026f..0a36fd0795 100644 --- a/scripts/scr_event_code/scr_event_code.gml +++ b/scripts/scr_event_code/scr_event_code.gml @@ -49,7 +49,7 @@ function event_end_turn_action() { // Removes planetary governor installed by the chapter if (_event.e_id == "remove_surf") { var _star_name = _event.system; - var _event_star = star_by_name(_event.system); + var _event_star = find_star_by_name(_event.system); var _planet = _event.planet; if (_event_star != "none") { _event_star.dispo[_planet] = -10; // Resets @@ -356,7 +356,7 @@ function strange_build_event() { var marine_is_planetside = _unit.planet_location > 0; if (marine_is_planetside && heritical_item) { - var _system = star_by_name(_unit.location_string); + var _system = find_star_by_name(_unit.location_string); var _planet = _unit.planet_location; if (_system != "none") { with (_system) { diff --git a/scripts/scr_fleet_functions/scr_fleet_functions.gml b/scripts/scr_fleet_functions/scr_fleet_functions.gml index e4b9a8b910..8e019ac0bb 100644 --- a/scripts/scr_fleet_functions/scr_fleet_functions.gml +++ b/scripts/scr_fleet_functions/scr_fleet_functions.gml @@ -156,7 +156,7 @@ function set_fleet_movement(fastest_route = true, new_action = "move", minimum_e var star_travel = new FastestRouteAlgorithm(x, y, action_x, action_y, self.id, is_orbiting()); var path = star_travel.final_array_path(); if (array_length(path) > 1) { - var targ = star_by_name(path[1]); + var targ = find_star_by_name(path[1]); if (targ != "none") { array_delete(path, 0, 2); complex_route = path; diff --git a/scripts/scr_ini_ship_cleanup/scr_ini_ship_cleanup.gml b/scripts/scr_ini_ship_cleanup/scr_ini_ship_cleanup.gml index 1c50683417..3b51a29979 100644 --- a/scripts/scr_ini_ship_cleanup/scr_ini_ship_cleanup.gml +++ b/scripts/scr_ini_ship_cleanup/scr_ini_ship_cleanup.gml @@ -32,7 +32,7 @@ function scr_kill_ship(index) { var _available_ships = []; var _ship_fleet = find_ships_fleet(index); if (!in_warp) { - var _nearest_star = star_by_name(ship_location[index]); + var _nearest_star = find_star_by_name(ship_location[index]); } if (_ship_fleet != "none") { delete_ship_from_fleet(index, _ship_fleet); diff --git a/scripts/scr_inquisition_mission/scr_inquisition_mission.gml b/scripts/scr_inquisition_mission/scr_inquisition_mission.gml index bfcfa850bd..e2af91b3f5 100644 --- a/scripts/scr_inquisition_mission/scr_inquisition_mission.gml +++ b/scripts/scr_inquisition_mission/scr_inquisition_mission.gml @@ -241,7 +241,7 @@ function mission_inquisition_tomb_world(tomb_worlds) { /// @mixin function init_mission_inquisition_tomb_world() { - mission_star = star_by_name(pop_data.system); + mission_star = find_star_by_name(pop_data.system); if (mission_star == "none") { popup_default_close(); exit; @@ -349,7 +349,7 @@ function add_new_inquis_mission() { } function init_mission_hunt_inquisitor() { - mission_star = star_by_name(pop_data.system); + mission_star = find_star_by_name(pop_data.system); if (mission_star == "none") { popup_default_close(); exit; @@ -714,7 +714,7 @@ function setup_necron_tomb_raid(planet) { /// @mixin obj_popup function necron_tomb_mission_start() { - mission_star = star_by_name(pop_data.loc); + mission_star = find_star_by_name(pop_data.loc); planet = pop_data.planet; title = $"Necron Tunnels : {pop_data.mission_stage}"; @@ -771,7 +771,7 @@ function necron_tomb_mission_sequence() { alter_disposition(eFACTION.INQUISITION, obj_controller.demanding ? choose(0, 0, 1) : 1); - mission_star = star_by_name(pop_data.loc); + mission_star = find_star_by_name(pop_data.loc); remove_planet_problem(planet, "necron", mission_star); seal_tomb_world(mission_star.p_feature[planet]); // mission_star.p_feature[planet][search_planet_features(mission_star.p_feature[planet], eP_FEATURES.NECRON_TOMB)[0]].sealed = 1; @@ -829,7 +829,7 @@ function necron_tomb_mission_sequence() { } delete _roster; - mission_star = star_by_name(pop_data.loc); + mission_star = find_star_by_name(pop_data.loc); obj_ncombat.battle_object = mission_star; instance_deactivate_object(obj_star); diff --git a/scripts/scr_marine_struct/scr_marine_struct.gml b/scripts/scr_marine_struct/scr_marine_struct.gml index 44adf708fd..f70b55af82 100644 --- a/scripts/scr_marine_struct/scr_marine_struct.gml +++ b/scripts/scr_marine_struct/scr_marine_struct.gml @@ -1721,7 +1721,7 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data = {} obj_ini.ship_carrying[ship] += size; //update ship capacity if (star == "none") { - star = star_by_name(system); + star = find_star_by_name(system); } if (star != "none") { if (star.p_player[current_location[1]] > 0) { @@ -1779,9 +1779,9 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data = {} var homestar = "none"; var spawn_location_chosen = false; if (((type == "home") || (type == "default")) && (obj_ini.fleet_type == ePLAYER_BASE.HOME_WORLD)) { - var homestar = star_by_name(obj_ini.home_name); + var homestar = find_star_by_name(obj_ini.home_name); } else if (type != "ship") { - var homestar = star_by_name(type); + var homestar = find_star_by_name(type); } /* if (!spawn_location_chosen){ diff --git a/scripts/scr_player_fleet_functions/scr_player_fleet_functions.gml b/scripts/scr_player_fleet_functions/scr_player_fleet_functions.gml index d7150b1daf..f21f97d6f1 100644 --- a/scripts/scr_player_fleet_functions/scr_player_fleet_functions.gml +++ b/scripts/scr_player_fleet_functions/scr_player_fleet_functions.gml @@ -71,7 +71,7 @@ function cancel_fleet_movement() { function set_new_player_fleet_course(target_array) { if (array_length(target_array) > 0) { - var target_planet = star_by_name(target_array[0]); + var target_planet = find_star_by_name(target_array[0]); var nearest_planet = instance_nearest(x, y, obj_star); var from_star = point_distance(nearest_planet.x, nearest_planet.y, x, y) < 75; var valid = target_planet != "none"; @@ -80,7 +80,7 @@ function set_new_player_fleet_course(target_array) { } if (!valid) { if (array_length(target_array) > 1) { - target_planet = star_by_name(target_array[1]); + target_planet = find_star_by_name(target_array[1]); array_delete(target_array, 0, 2); } else { return "complex_route_finish"; @@ -282,7 +282,7 @@ function player_retreat_from_fleet_combat() { _roll_100 = roll_dice_chapter(1, 100, "low"); - var _loc_star = star_by_name(obj_turn_end.battle_location[obj_turn_end.current_battle]); + var _loc_star = find_star_by_name(obj_turn_end.battle_location[obj_turn_end.current_battle]); obj_controller.temp[2001] = real(_loc_star.id); obj_controller.temp[2002] = real(obj_turn_end.battle_opponent[obj_turn_end.current_battle]); diff --git a/scripts/scr_post_battle_events/scr_post_battle_events.gml b/scripts/scr_post_battle_events/scr_post_battle_events.gml index 066d5aa2ae..fb7b583475 100644 --- a/scripts/scr_post_battle_events/scr_post_battle_events.gml +++ b/scripts/scr_post_battle_events/scr_post_battle_events.gml @@ -29,7 +29,7 @@ function necron_tomb_raid_post_battle_sequence() { } } - var _star_obj = star_by_name(battle_loc); + var _star_obj = find_star_by_name(battle_loc); if (_star_obj != "none") { with (_star_obj) { var planet = obj_ncombat.battle_id; diff --git a/scripts/scr_system_search_helpers/scr_system_search_helpers.gml b/scripts/scr_system_search_helpers/scr_system_search_helpers.gml index c40a2fb052..e040ad153d 100644 --- a/scripts/scr_system_search_helpers/scr_system_search_helpers.gml +++ b/scripts/scr_system_search_helpers/scr_system_search_helpers.gml @@ -205,17 +205,11 @@ function planet_imperium_ground_total(planet_check) { return p_guardsmen[planet_check] + p_pdf[planet_check] + p_sisters[planet_check] + p_player[planet_check]; } -/// @function star_by_name(search_name) -/// @description -/// Searches all `obj_star` instances and returns the one with a matching name. -/// -/// @param {String} search_name -/// The name of the star to find. -/// -/// @returns {Instance | String} -/// Returns the `obj_star` instance that matches `search_name`, -/// or the string `"none"` if no matching star is found. -function star_by_name(search_name) { +/// @function find_star_by_name(search_name) +/// @description Searches all `obj_star` instances and returns the one with a matching name. +/// @param {String} search_name The name of the star to find. +/// @returns {Id.Instance.obj_star | String} Returns the `obj_star` instance that matches `search_name`, or the string `"none"` if no matching star is found. +function find_star_by_name(search_name) { if (!instance_exists(obj_star)) { assert_error_popup("Not a single instance of obj_star exists!"); return "none"; diff --git a/scripts/scr_system_spawn_functions/scr_system_spawn_functions.gml b/scripts/scr_system_spawn_functions/scr_system_spawn_functions.gml index ce658e619c..ca196b66b8 100644 --- a/scripts/scr_system_spawn_functions/scr_system_spawn_functions.gml +++ b/scripts/scr_system_spawn_functions/scr_system_spawn_functions.gml @@ -55,8 +55,8 @@ function find_player_spawn_star() { /*if (obj_ini.recruiting_name!="random"){ array_push(global.name_generator.star_used_names, obj_ini.recruiting_name); - if (star_by_name(obj_ini.recruiting_name) != "none" ){ - star_by_name(obj_ini.recruiting_name).name = global.name_generator.generate_star_name(); + if (find_star_by_name(obj_ini.recruiting_name) != "none" ){ + find_star_by_name(obj_ini.recruiting_name).name = global.name_generator.generate_star_name(); } name=obj_ini.recruiting_name; }*/ @@ -68,8 +68,8 @@ function player_home_star(home_planet) { if (obj_ini.home_name != "random") { array_push(global.name_generator.star_used_names, obj_ini.home_name); - if (star_by_name(obj_ini.home_name) != "none") { - star_by_name(obj_ini.home_name).name = global.name_generator.generate_star_name(); + if (find_star_by_name(obj_ini.home_name) != "none") { + find_star_by_name(obj_ini.home_name).name = global.name_generator.generate_star_name(); } name = obj_ini.home_name; } @@ -125,16 +125,16 @@ function set_player_recruit_planet(recruit_planet) { var recruit_name = obj_ini.recruiting_name; if (recruit_name != "random") { array_push(global.name_generator.star_used_names, recruit_name); - if (star_by_name(recruit_name) != "none") { - star_by_name(recruit_name).name = global.name_generator.generate_star_name(); + if (find_star_by_name(recruit_name) != "none") { + find_star_by_name(recruit_name).name = global.name_generator.generate_star_name(); } name = recruit_name; } } else { if (obj_ini.home_name != "random") { array_push(global.name_generator.star_used_names, obj_ini.home_name); - if (star_by_name(obj_ini.home_name) != "none") { - star_by_name(obj_ini.home_name).name = global.name_generator.generate_star_name(); + if (find_star_by_name(obj_ini.home_name) != "none") { + find_star_by_name(obj_ini.home_name).name = global.name_generator.generate_star_name(); } name = obj_ini.home_name; } diff --git a/scripts/scr_ui_manage/scr_ui_manage.gml b/scripts/scr_ui_manage/scr_ui_manage.gml index 5589c9a434..881a8fadc9 100644 --- a/scripts/scr_ui_manage/scr_ui_manage.gml +++ b/scripts/scr_ui_manage/scr_ui_manage.gml @@ -1,7 +1,7 @@ /// @mixin function load_marines_into_ship(system, ship, units, reload = false) { static _load_into_ship = function(system, ship, units, size, loop, reload) { - var load_from_star = star_by_name(system); + var load_from_star = find_star_by_name(system); if (is_struct(units[loop])) { units[loop].load_marine(sh_ide[ship], load_from_star); ma_loc[loop] = sh_loc[ship]; diff --git a/scripts/scr_unit_quick_find_pane/scr_unit_quick_find_pane.gml b/scripts/scr_unit_quick_find_pane/scr_unit_quick_find_pane.gml index 8c71185744..455bc33ccd 100644 --- a/scripts/scr_unit_quick_find_pane/scr_unit_quick_find_pane.gml +++ b/scripts/scr_unit_quick_find_pane/scr_unit_quick_find_pane.gml @@ -23,7 +23,7 @@ function UnitQuickFindPanel() constructor { var _names = struct_get_names(garrison_log); var _stars = []; for (var i = 0; i < array_length(_names); i++) { - var _star = star_by_name(_names[i]); + var _star = find_star_by_name(_names[i]); if (_star != "none") { array_push(_stars, _star); } @@ -326,7 +326,7 @@ function UnitQuickFindPanel() constructor { if (!hover_entered) { if (point_and_click([xx + 10, yy + 90 + (20 * i) - 2, xx + main_panel.width, yy + 90 + (20 * i) + 18])) { - var star = star_by_name(system_names[i]); + var star = find_star_by_name(system_names[i]); if (star != "none") { travel_target = [ star.x, @@ -358,7 +358,7 @@ function UnitQuickFindPanel() constructor { hover_item = "none"; } else if (hover_item != "none") { if (point_and_click(hover_item.draw(xx + 10, yy + 90 + (20 * hover_item.root_item), "Manage"))) { - group_selection(garrison_log[$ system_names[hover_item.root_item]].units, {purpose: $"{system_names[hover_item.root_item]} Management", purpose_code: "manage", number: 0, system: star_by_name(system_names[hover_item.root_item]).id, feature: "none", planet: 0, selections: []}); + group_selection(garrison_log[$ system_names[hover_item.root_item]].units, {purpose: $"{system_names[hover_item.root_item]} Management", purpose_code: "manage", number: 0, system: find_star_by_name(system_names[hover_item.root_item]).id, feature: "none", planet: 0, selections: []}); } } } else if (view_area == "missions") { @@ -391,7 +391,7 @@ function UnitQuickFindPanel() constructor { draw_text(xx + 310, yy + 90 + (20 * i), mission.time); } if (point_and_click([xx + 10, yy + 90 + (20 * i) - 2, xx + main_panel.width, yy + 90 + (20 * i) + 18])) { - var star = star_by_name(mission.system); + var star = find_star_by_name(mission.system); if (star != "none") { travel_target = [ star.x, @@ -620,7 +620,7 @@ function unload_selection() { if (man_size > 0 && obj_controller.selecting_ship >= 0 && !instance_exists(obj_star_select) && !location_out_of_player_control(selecting_location) && selecting_location != "Warp") { cooldown = 8000; var boba = 0; - var unload_star = star_by_name(selecting_location); + var unload_star = find_star_by_name(selecting_location); if (unload_star != "none") { if (unload_star.space_hulk != 1) { for (var t = 0; t < array_length(display_unit); t++) { From 6a9782177717a54eb60155f7950d9fd65a8aebaf Mon Sep 17 00:00:00 2001 From: EttyKitty <20323032+EttyKitty@users.noreply.github.com> Date: Sun, 1 Mar 2026 23:53:40 +0300 Subject: [PATCH 2/2] fix: Remove agressive error on `find_star_by_name` --- scripts/scr_system_search_helpers/scr_system_search_helpers.gml | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/scr_system_search_helpers/scr_system_search_helpers.gml b/scripts/scr_system_search_helpers/scr_system_search_helpers.gml index e040ad153d..f297ca38ba 100644 --- a/scripts/scr_system_search_helpers/scr_system_search_helpers.gml +++ b/scripts/scr_system_search_helpers/scr_system_search_helpers.gml @@ -221,8 +221,6 @@ function find_star_by_name(search_name) { } } - assert_error_popup($"Star {search_name} wasn't found!"); - return "none"; }