Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Allow land speeders on raids #386

Open
wants to merge 1 commit into
base: release/0.10.0.0
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 35 additions & 27 deletions scripts/scr_roster/scr_roster.gml
Original file line number Diff line number Diff line change
Expand Up @@ -283,35 +283,43 @@ function Roster() constructor{
}
}
}
if (obj_drop_select.attack){
for (var i=0;i<array_length(obj_ini.veh_race[co]);i++){
var _allow = false;
if (obj_ini.veh_race[co][i] == 0) then continue;
if (obj_ini.veh_loc[co][i] == roster_location){
if (obj_ini.veh_wid[co][i]>0){
if (obj_ini.veh_wid[co][i] ==roster_planet){
_allow=true;
}
}
}
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] = -1;
}
if (obj_ini.ship_location[obj_ini.veh_lid[co][i]] == roster_location){
_allow=true;
}
}
if (_allow){
_company_present = true;
array_push(full_roster_units, [co, i]);
if (!array_contains(_vehicles, obj_ini.veh_role[co][i])){
array_push(_vehicles, obj_ini.veh_role[co][i]);
new_vehicle_button(obj_ini.veh_role[co][i],obj_ini.veh_role[co][i]);
}
}

var _raid_allowable = ["Land Speeder"];
for (var i=0;i<array_length(obj_ini.veh_race[co]);i++){
var _allow = false;
if (obj_ini.veh_race[co][i] == 0) then continue;
var _v_role = obj_ini.veh_role[co][i];
if (obj_ini.veh_loc[co][i] == roster_location){
if (obj_ini.veh_wid[co][i]>0){
if (obj_ini.veh_wid[co][i] ==roster_planet){
_allow=true;
}
}
}
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] = -1;
}
if (obj_ini.ship_location[obj_ini.veh_lid[co][i]] == roster_location){
_allow=true;
}
}
if (_allow){
if (!obj_drop_select.attack){

_allow = array_contains(_raid_allowable, _v_role);
}
}
if (_allow){
Comment on lines +307 to +313
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may be wrong, but shouldn't the check at line 307 be if (!_allow)?

Copy link
Collaborator Author

@OH296 OH296 Jan 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's if _allow as there is no point checking if it's the correct vehicle type if it's already been determined it's in the wrong location which is what the previous checks do

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, it's a second level check, sorry.
Just got confused by the two if (_allow).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

damn missing the cats now

_company_present = true;
array_push(full_roster_units, [co, i]);
if (!array_contains(_vehicles, obj_ini.veh_role[co][i])){
array_push(_vehicles, obj_ini.veh_role[co][i]);
new_vehicle_button(obj_ini.veh_role[co][i],obj_ini.veh_role[co][i]);
}
}
}

var _button = new ToggleButton();
var _col = _company_present ? CM_GREEN_COLOR : c_red;
var _display = co ? scr_roman_numerals()[co-1] : "HQ";
Expand Down
Loading