Skip to content

Commit 9ce1a20

Browse files
authored
fix: resolve crash from cancelling garrisons (#937)
1 parent b037d01 commit 9ce1a20

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

scripts/scr_company_struct/scr_company_struct.gml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,12 +249,12 @@ function CompanyStruct(comp) constructor{
249249
}
250250

251251
static draw_squad_assignment_options = function(){
252+
var _squad_sys = squad_loc.system;
252253
if (current_squad.assignment == "none"){
253254

254255
draw_text_transformed(xx+bound_width[0]+5, yy+bound_height[0]+125, $"Squad has no current assignments",1,1,0);
255256

256257
var send_on_mission=false, mission_type;
257-
var _squad_sys = squad_loc.system;
258258
if (squad_loc.same_system) and (_squad_sys!="Warp" && _squad_sys!="Lost"){
259259
if (garrison_button.draw()){
260260
send_on_mission=true;
@@ -270,7 +270,7 @@ function CompanyStruct(comp) constructor{
270270
}
271271
}
272272
if (send_on_mission){
273-
send_squad_on_mission(mission_type,star_by_name(squad_loc.system));
273+
send_squad_on_mission(mission_type,star_by_name(_squad_sys));
274274
}
275275
bound_height[0] += 180;
276276
} else {
@@ -282,7 +282,7 @@ function CompanyStruct(comp) constructor{
282282
if(point_and_click(cancel_but) || keyboard_check_pressed(ord("C"))){
283283
var cancel_system=noone;
284284
with (obj_star){
285-
if (name == squad_loc.system){
285+
if (name == _squad_sys){
286286
cancel_system=self;
287287
}
288288
}

0 commit comments

Comments
 (0)