From 0ffb4b0427d77e1b845bb52ee4ce54cdaf43fdd8 Mon Sep 17 00:00:00 2001 From: Nelsonh Date: Fri, 10 Jan 2025 22:38:52 +0000 Subject: [PATCH 1/3] add fail safes to stop going over technical limit of ships --- .../scr_player_fleet_functions.gml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) 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 19e0ae781..ee5f8d81b 100644 --- a/scripts/scr_player_fleet_functions/scr_player_fleet_functions.gml +++ b/scripts/scr_player_fleet_functions/scr_player_fleet_functions.gml @@ -164,6 +164,7 @@ function find_and_move_ship_between_fleets(out_fleet, in_fleet, index){ function merge_player_fleets(main_fleet, merge_fleet){ var _merge_ships = fleet_full_ship_array(merge_fleet); for (var i=0;i Date: Fri, 10 Jan 2025 22:52:03 +0000 Subject: [PATCH 2/3] bundle or array issues with killing ships --- .../scr_ini_ship_cleanup.gml | 18 +++++++++++++----- .../scr_player_fleet_functions.gml | 5 +++-- 2 files changed, 16 insertions(+), 7 deletions(-) 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 c5a106207..d15fe0e5f 100644 --- a/scripts/scr_ini_ship_cleanup/scr_ini_ship_cleanup.gml +++ b/scripts/scr_ini_ship_cleanup/scr_ini_ship_cleanup.gml @@ -7,17 +7,25 @@ function scr_kill_ship(index){ for (var co=0;co<=companies;co++){ for (var i=0;i-1){ + if (_unit.ship_location == index){ + if (!irandom(_unit.luck)-3){ + scr_kill_unit(_unit.company, _unit.marine_number); + } else { + array_push(_units_on_ship, _unit); + } } else { - array_push(_units_on_ship, _unit); + if (_unit.ship_location>index){ + _unit.ship_location--; + } } } } - for (var i=0;iindex){ + veh_lid[co][i]--; } } } 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 ee5f8d81b..689e0bb0b 100644 --- a/scripts/scr_player_fleet_functions/scr_player_fleet_functions.gml +++ b/scripts/scr_player_fleet_functions/scr_player_fleet_functions.gml @@ -164,8 +164,9 @@ function find_and_move_ship_between_fleets(out_fleet, in_fleet, index){ function merge_player_fleets(main_fleet, merge_fleet){ var _merge_ships = fleet_full_ship_array(merge_fleet); for (var i=0;i Date: Fri, 10 Jan 2025 23:06:12 +0000 Subject: [PATCH 3/3] edit to luck check --- scripts/scr_ini_ship_cleanup/scr_ini_ship_cleanup.gml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 d15fe0e5f..898ae7766 100644 --- a/scripts/scr_ini_ship_cleanup/scr_ini_ship_cleanup.gml +++ b/scripts/scr_ini_ship_cleanup/scr_ini_ship_cleanup.gml @@ -9,7 +9,7 @@ function scr_kill_ship(index){ _unit = fetch_unit([co,i]); if (_unit.ship_location>-1){ if (_unit.ship_location == index){ - if (!irandom(_unit.luck)-3){ + if (!(irandom(_unit.luck)-3)){ scr_kill_unit(_unit.company, _unit.marine_number); } else { array_push(_units_on_ship, _unit);