From 69eed96be6b5c0e199b5d1d3c25de0c0d97c3c6d Mon Sep 17 00:00:00 2001 From: Joel Hillacre Date: Fri, 25 Oct 2024 23:11:46 -0600 Subject: [PATCH 1/2] fix: make sure siz is declared in obj_pnunt:Step --- objects/obj_pnunit/Step_0.gml | 12 +++++++++--- scripts/scr_hit/scr_hit.gml | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/objects/obj_pnunit/Step_0.gml b/objects/obj_pnunit/Step_0.gml index 066b247985..c97d5542bc 100644 --- a/objects/obj_pnunit/Step_0.gml +++ b/objects/obj_pnunit/Step_0.gml @@ -11,6 +11,11 @@ var pos=880; if (instance_exists(obj_centerline)){ diff=x-obj_centerline.x; } +if (instance_exists(obj_enunit)) { + siz=min(400,(men*0.5)+(medi)+(veh*2.5)+(dreads*2)); +} else { + siz = 0; +} if (siz>0){ if ((x_offset)>817) and ((x_offset)<1575){ if (scr_hit([x_offset,450-(siz/2),x_offset+10,450+(siz/2)])){ @@ -23,11 +28,12 @@ if (highlight2!=highlight){ highlight2=highlight; highlight3=""; - for (var i=0;i0) and (dudes_num[i+1]>0){ + if (dudes_num[i] > 0 and dudes_num[i+1] > 0) { highlight3+=$"{dudes_num[i]}X {dudes[i]}, " - }else if (dudes_num[i]>0) and (dudes_num[i+1]<=0){ + } else if (dudes_num[i] > 0 and dudes_num[i+1] <= 0) { highlight3+=$"{dudes_num[i]}X {dudes[i]}."; break; } diff --git a/scripts/scr_hit/scr_hit.gml b/scripts/scr_hit/scr_hit.gml index 81c8389d3e..fe12ab5aa0 100644 --- a/scripts/scr_hit/scr_hit.gml +++ b/scripts/scr_hit/scr_hit.gml @@ -27,7 +27,7 @@ function point_and_click(rect) { } if (controller_exist && obj_controller.cooldown > 0) { - show_debug_message("point_and_click: ignored click for cooldown, " + string(obj_controller.cooldown) + " steps remaining"); + // show_debug_message("point_and_click: ignored click for cooldown, " + string(obj_controller.cooldown) + " steps remaining"); return false; } From e9f0830da5459371a7072738eef91de7cbf7e5db Mon Sep 17 00:00:00 2001 From: Nelsonh Date: Sun, 27 Oct 2024 21:40:10 +0000 Subject: [PATCH 2/2] set variables in create of p_nunit to prevent crash --- CHANGELOG.md | 6 ++++++ objects/obj_pnunit/Create_0.gml | 2 ++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a16831181d..26f2a239aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,12 @@ All notable changes to this project will be documented in this file. - everything that a normal player doesn't need to know. ---------------------------------- +## [0.9.4.1] + +### Fixed: +- garrisons crashing and returning the game to map +- crash during enemy end turn with chaos fleets + ## [0.9.4.0] ### IMPORTANT: diff --git a/objects/obj_pnunit/Create_0.gml b/objects/obj_pnunit/Create_0.gml index a472c82ed5..cb9991e35e 100644 --- a/objects/obj_pnunit/Create_0.gml +++ b/objects/obj_pnunit/Create_0.gml @@ -13,6 +13,8 @@ defenses=0; highlight=0; highlight2=0; highlight3=""; +siz = 0; +x_offset = 0; // let="";let=string_delete(obj_ini.psy_powers,2,string_length(obj_ini.psy_powers)-1);let=string_upper(let); // LET might be different for each marine; need a way of determining this