Skip to content

Commit

Permalink
fix: Fix a bunch of ship errors caused by location (Adeptus-Dominus#214)
Browse files Browse the repository at this point in the history
  • Loading branch information
OH296 authored Dec 16, 2024
1 parent 6faa693 commit ab72c41
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 18 deletions.
2 changes: 1 addition & 1 deletion objects/obj_controller/Alarm_5.gml
Original file line number Diff line number Diff line change
Expand Up @@ -1127,7 +1127,7 @@ for(var i=1; i<=99; i++){
last_artifact = scr_add_artifact("random_nodemon","",0,obj_ini.home_name,2);
} else {
if (obj_ini.fleet_type != ePlayerBase.home_world){
last_artifact = scr_add_artifact("random_nodemon","",0,obj_ini.ship_location[1],501);
last_artifact = scr_add_artifact("random_nodemon","",0,obj_ini.ship_location[0],501);
}
}

Expand Down
2 changes: 1 addition & 1 deletion objects/obj_controller/KeyPress_73.gml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ scr_dialogue("lol");
// loyalty=0;loyalty_hidden=0;


// show_message(string(obj_ini.ship[0])+" location: "+string(obj_ini.ship_location[1]));
// show_message(string(obj_ini.ship[0])+" location: "+string(obj_ini.ship_location[0]));

// alarm[8]=1;

Expand Down
2 changes: 1 addition & 1 deletion objects/obj_controller/Step_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ if (unload>0){
ma_wid[q]=unload;
}
else if (man[q]=="vehicle") and (ma_loc[q]==selecting_location) and (ma_wid[q]<1) and(man_sel[q]!=0){
if (b==0) then b=ma_lid[q];
if (b==-1) then b=ma_lid[q];
var unit_id = display_unit[q][1];
var company = display_unit[q][0]
obj_ini.veh_loc[company][unit_id]=obj_ini.ship_location[b];
Expand Down
2 changes: 1 addition & 1 deletion scripts/scr_destroy_planet/scr_destroy_planet.gml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function scr_destroy_planet(destruction_method) {
for (var ed=0;ed<array_length(obj_ini.role[cah]);ed++){
unit = fetch_unit([cah,ed])
if (obj_ini.loc[cah,ed]=you.name) and (unit.planet_location=baid){
if (obj_ini.role[cah,ed]="Chapter Master"){
if (unit.role()="Chapter Master"){
obj_controller.alarm[7]=15;
if (global.defeat<=1) then global.defeat=1;
}
Expand Down
4 changes: 3 additions & 1 deletion scripts/scr_dialogue/scr_dialogue.gml
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,9 @@ function scr_dialogue(diplo_keyphrase) {
if (instance_number(obj_ground_mission)==0){
with(obj_star){
if (string_count(name,scr_master_loc())>0){
repeat(obj_ini.TTRPG[0,1].planet_location){instance_create(x,y,obj_ground_mission);}
repeat(obj_ini.TTRPG[0,0].planet_location){
instance_create(x,y,obj_ground_mission);
}
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions scripts/scr_draw_management_unit/scr_draw_management_unit.gml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function scr_draw_management_unit(selected, yy=0, xx=0, draw=true){
assignment=unit.assignment();
if (assignment!="none"){
unit_location_string += $"({assignment})";
}else if (fest_planet==0) and (fest_sid>0) and (fest_repeats>0) and (ma_lid[selected]==fest_sid){
}else if (fest_planet==0) and (fest_sid>-1) and (fest_repeats>0) and (ma_lid[selected]==fest_sid){
unit_location_string="=Event=";
eventing=true;
}else if (fest_planet==1) and (fest_wid>0) and (fest_repeats>0) and (ma_wid[selected]==fest_wid) and (ma_loc[selected]==fest_star){
Expand Down Expand Up @@ -88,7 +88,7 @@ function scr_draw_management_unit(selected, yy=0, xx=0, draw=true){
if (ma_wid[selected]!=0){
//numeral for vehicle planet
unit_location_string += scr_roman(ma_wid[selected]);
} else if (ma_lid[selected]>0){
} else if (ma_lid[selected]>-1){
unit_location_string = obj_ini.ship[ma_lid[selected]]
}
health_string=string(round(ma_health[selected]))+"% HP";
Expand Down Expand Up @@ -267,8 +267,8 @@ function scr_draw_management_unit(selected, yy=0, xx=0, draw=true){
draw_sprite(spr_loc_icon,0,xx+427+8,yy+66);
}
}else{
if (ma_lid[selected]==0) and (ma_wid[selected]>0) then draw_sprite(spr_loc_icon,0,xx+427+8,yy+66);
if (ma_lid[selected]>0) and (ma_wid[selected]==0) then draw_sprite(spr_loc_icon,1,xx+427+8,yy+66);
if (ma_lid[selected]==-1) and (ma_wid[selected]>0) then draw_sprite(spr_loc_icon,0,xx+427+8,yy+66);
if (ma_lid[selected]>-1) and (ma_wid[selected]==0) then draw_sprite(spr_loc_icon,1,xx+427+8,yy+66);
}
}
//TODO handle recursively
Expand Down
2 changes: 1 addition & 1 deletion scripts/scr_enemy_ai_d/scr_enemy_ai_d.gml
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ function scr_enemy_ai_d() {
p_player[i]-=scr_unit_size(obj_ini.armour[com][ide],obj_ini.role[com][ide],true);
obj_ini.loc[com][ide]="Mechanicus Vessel";
unit.planet_location=0;
unit.ship_location=0;
unit.ship_location=-1;
techs_taken+=1;
}
if (unit.ship_location>-1){
Expand Down
2 changes: 1 addition & 1 deletion scripts/scr_roster/scr_roster.gml
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ function Roster() constructor{
}
if (obj_ini.veh_lid[co][i]>-1){
if (obj_ini.veh_lid[co][i]>= array_length(obj_ini.ship_location)){
obj_ini.veh_lid[co][i] = 0;
obj_ini.veh_lid[co][i] = -1;
}
if (obj_ini.ship_location[obj_ini.veh_lid[co][i]] == roster_location){
_allow=true;
Expand Down
2 changes: 1 addition & 1 deletion scripts/scr_special_view/scr_special_view.gml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function scr_special_view(command_group) {
for (var v = 0;v<array_length(obj_ini.TTRPG[0]);v++){
bad=0;
if (obj_ini.name[0][v]== ""){continue;}
if (obj_ini.TTRPG[0][v].ship_location>0){
if (obj_ini.TTRPG[0][v].ship_location>-1){
var ham=obj_ini.TTRPG[0][v].ship_location;
if (obj_ini.ship_location[ham]="Lost") then continue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ function SpecialistPointHandler() constructor{
var build_loc = array_random_element(obj_controller.player_forge_data.vehicle_hanger);
obj_ini.veh_loc[vehicle[0]][vehicle[1]] = build_loc[0];
obj_ini.veh_wid[vehicle[0]][vehicle[1]] = build_loc[1];
obj_ini.veh_lid[vehicle[0]][vehicle[1]] = 0;
obj_ini.veh_lid[vehicle[0]][vehicle[1]] = -1;
}
scr_popup("Forge Completed",$"{item.name} X{item.count} construction finished Vehicles Waiting at hanger on {build_loc[0]} {build_loc[1]}","","");
}
Expand Down
4 changes: 2 additions & 2 deletions scripts/scr_squads/scr_squads.gml
Original file line number Diff line number Diff line change
Expand Up @@ -735,10 +735,10 @@ function set_member_loc (loc_data){
system.p_player[member_location[1]]-=size;
system.p_player[wid]+=size;
planet_location = wid;
ship_location = 0;
ship_location = -1;
}
} else {
if (wid == 0 && lid>0){
if (wid == 0 && lid>-1){
load_marine(lid);
}
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/scr_ui_advisors/scr_ui_advisors.gml
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ function scr_ui_advisors() {

draw_text_ext(xx + 222, yy + 216, string_hash_to_newline(string(tot_ki)), -1, 396);
var unit = fetch_unit([0,1]);
if (unit.ship_location = 0) then draw_text(xx + 222, yy + 380, string_hash_to_newline("Current Location: " + string(obj_ini.loc[0, 1]) + " " + string(unit.planet_location) + "#Health: " + unit.hp() + "%"));
if (unit.ship_location == -1) then draw_text(xx + 222, yy + 380, string_hash_to_newline("Current Location: " + string(obj_ini.loc[0, 1]) + " " + string(unit.planet_location) + "#Health: " + unit.hp() + "%"));
if (unit.ship_location>-1) then draw_text(xx + 222, yy + 380, string_hash_to_newline($"Current Location: Onboard {obj_ini.ship[unit.ship_location]}#Health: {unit.hp()}%"));
draw_text(xx + 222.5, yy + 380.5, string_hash_to_newline("Current Location:#Health:"));

Expand Down
4 changes: 2 additions & 2 deletions scripts/scr_vehicle_order/scr_vehicle_order.gml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function reset_vehicle_variable_arrays(company_number,i){
veh_loc[company_number][i] = "";
veh_name[company_number][i] = "";
veh_role[company_number][i] = "";
veh_lid[company_number][i] = 0;
veh_lid[company_number][i] = -1;
veh_wid[company_number][i] = 0;
veh_wep1[company_number][i] = "";
veh_wep2[company_number][i] = "";
Expand All @@ -27,7 +27,7 @@ function scr_vehicle_order(company_number) {
temp_loc[company_number][i] = "";
temp_name[company_number][i] = "";
temp_role[company_number][i] = "";
temp_lid[company_number][i] = 0;
temp_lid[company_number][i] = -1;
temp_wid[company_number][i] = 0;
temp_wep1[company_number][i] = "";
temp_wep2[company_number][i] = "";
Expand Down

0 comments on commit ab72c41

Please sign in to comment.