Skip to content

Commit

Permalink
update various
Browse files Browse the repository at this point in the history
  • Loading branch information
tbox1911 committed Feb 7, 2025
1 parent 8abe031 commit d527a11
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 17 deletions.
8 changes: 1 addition & 7 deletions core.liberation/init.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,19 @@ GRLIB_ACE_enabled = false;
//GRLIB_LRX_debug = true;

[] call compileFinal preprocessFileLineNumbers "whitelist.sqf";
sleep 1;
[] call compileFinal preprocessFileLineNumbers "scripts\shared\liberation_functions.sqf";
sleep 1;
[] call compileFinal preprocessFileLineNumbers "scripts\shared\fetch_params.sqf";
sleep 1;
[] call compileFinal preprocessFileLineNumbers "scripts\shared\classnames.sqf";
sleep 1;
[] call compileFinal preprocessFileLineNumbers "scripts\server\sector\init_sectors.sqf";
sleep 1;
[] call compileFinal preprocessFileLineNumbers "scripts\server\a3w\missions\setupMissionArrays.sqf";
sleep 1;
sleep 2;

if (!isDedicated && hasInterface) then {
[] spawn compileFinal preprocessFileLineNumbers "scripts\client\init_client.sqf";
};

if (!abort_loading) then {
[] call compileFinal preprocessFileLineNumbers "scripts\shared\init_shared.sqf";
sleep 1;
[] spawn compileFinal preprocessFileLineNumbers "addons\VAM\RPT_init.sqf";

if (GRLIB_ACE_enabled) then {
Expand Down
1 change: 1 addition & 0 deletions core.liberation/scripts/client/markers/hostile_groups.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ while { true } do {
_marker setMarkerPosLocal (_leader getPos [floor(random 50), floor(random 360)]);
_hostile_markers pushback _marker;
};
sleep 0.1;
} foreach (groups GRLIB_side_enemy);

sleep (30 + floor(random 60));
Expand Down
22 changes: 14 additions & 8 deletions core.liberation/scripts/server/a3w/scripts/F_checkSpawn.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,20 @@ private _list = [];
// sector in use
if (_sector in (active_sectors + A3W_sectors_in_use)) then { _keep_sector = false };

// sector too close from any FOB
if (_sector_pos distance2D ([_sector_pos] call F_getNearestFob) <= (GRLIB_sector_size * 1.25)) then { _keep_sector = false };

// sector too far from any blufor sectors
if (([GRLIB_spawn_min, _sector_pos, blufor_sectors] call F_getNearestSector) == "") then { _keep_sector = false };

// sector too close from any opfor sectors
if (([GRLIB_sector_size, _sector_pos, opfor_sectors] call F_getNearestSector) != "") then { _keep_sector = false };
if (_keep_sector) then {
// sector too close from any FOB
if (_sector_pos distance2D ([_sector_pos] call F_getNearestFob) <= (GRLIB_sector_size * 1.25)) then { _keep_sector = false };
};

if (_keep_sector) then {
// sector too far from any blufor sectors
if (([GRLIB_spawn_min, _sector_pos, blufor_sectors] call F_getNearestSector) == "") then { _keep_sector = false };
};

if (_keep_sector) then {
// sector too close from any opfor sectors
if (([GRLIB_sector_size, _sector_pos, opfor_sectors] call F_getNearestSector) != "") then { _keep_sector = false };
};

if (_keep_sector) then { _list pushBack _x };

Expand Down
5 changes: 5 additions & 0 deletions core.liberation/scripts/server/sector/manage_sectors.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ while { GRLIB_endgame == 0 && GRLIB_global_stop == 0 } do {
sleep 30;
};
};
sleep 0.1;
} foreach _countblufor;

_hc_missions = active_sectors_hc;
Expand All @@ -53,6 +54,10 @@ while { GRLIB_endgame == 0 && GRLIB_global_stop == 0 } do {
publicVariable "GRLIB_sector_spawning";
sleep 30;
};

if !(_nextsector in active_sectors) then {
active_sectors_hc = active_sectors_hc - [_x];
};
} forEach _hc_missions;

//diag_log format [ "Full sector scan at %1, active sectors: %2", time, active_sectors ];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
params ["_radius", ["_postosearch", getPosATL player], ["_sector_list", sectors_allSectors]];

private _sector_to_return = "";
private _close_sectors = _sector_list select { (markerPos _x) distance _postosearch < _radius };
private _close_sectors_sorted = [_close_sectors, [_postosearch] , { (markerPos _x) distance _input0 }, 'ASCEND'] call BIS_fnc_sortBy;
private _close_sectors = _sector_list select { (markerPos _x) distance2D _postosearch < _radius };
private _close_sectors_sorted = [_close_sectors, [_postosearch] , { (markerPos _x) distance2D _input0 }, 'ASCEND'] call BIS_fnc_sortBy;
if (count _close_sectors_sorted > 0) then { _sector_to_return = _close_sectors_sorted select 0; };

_sector_to_return;

0 comments on commit d527a11

Please sign in to comment.