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

FIX: Lag on city activation due to addWaypoints #805

Merged
merged 1 commit into from
Jan 12, 2020
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/civ/addWP.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ params [
["_radius", 50, [0]]
];

[_group, _pos, 0, "MOVE", "SAFE", "NO CHANGE", "LIMITED"] call CBA_fnc_addWaypoint;
[_group, _pos, -1, "MOVE", "SAFE", "NO CHANGE", "LIMITED"] call CBA_fnc_addWaypoint;

private _houses = [_pos, _radius] call btc_fnc_getHouses;
if !(_houses isEqualTo []) then {
Expand All @@ -39,7 +39,7 @@ if !(_houses isEqualTo []) then {

for "_i" from 1 to 4 do {
private _wp_pos = [_pos, _radius] call btc_fnc_randomize_pos;
[_group, _wp_pos, 0, "MOVE"] call CBA_fnc_addWaypoint;
[_group, _wp_pos, -1, "MOVE"] call CBA_fnc_addWaypoint;
};

if !(_houses isEqualTo []) then {
Expand All @@ -48,4 +48,4 @@ if !(_houses isEqualTo []) then {
_houses = _houses - [_house];
};

[_group, _pos, 0, "CYCLE"] call CBA_fnc_addWaypoint;
[_group, _pos, -1, "CYCLE"] call CBA_fnc_addWaypoint;
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,5 @@ if (_units isEqualTo []) exitWith {};
(group _x) setVariable ["getWeapons", true];

(group _x) setBehaviour "AWARE";
[group _x, _pos, 10, "GUARD", "UNCHANGED", "RED"] call CBA_fnc_addWaypoint;
[group _x, _pos, -1, "GUARD", "UNCHANGED", "RED", nil, nil, nil, nil, 10] call CBA_fnc_addWaypoint;
} forEach [selectRandom _units];
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ if (_units isEqualTo []) then {
(group _x) setVariable ["getWeapons", true];

(group _x) setBehaviour "AWARE";
[group _x, getPos _x, 10, "GUARD", "UNCHANGED", "RED"] call CBA_fnc_addWaypoint;
[group _x, getPos _x, -1, "GUARD", "UNCHANGED", "RED", nil, nil, nil, nil, 10] call CBA_fnc_addWaypoint;
} forEach _units;
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ params [

private _allpositions = [_group, _house] call btc_fnc_house_addWP_loop;

private _wp = [_group, _allpositions select 0, 0.2, "CYCLE", "UNCHANGED", "NO CHANGE", "UNCHANGED", "NO CHANGE", "", [15, 20, 30]] call CBA_fnc_addWaypoint;
private _wp = [_group, [_allpositions select 0, 0.2] call CBA_fnc_randPos, -1, "CYCLE", "UNCHANGED", "NO CHANGE", "UNCHANGED", "NO CHANGE", "", [15, 20, 30]] call CBA_fnc_addWaypoint;
_wp waypointAttachObject _house;
_wp setWaypointHousePosition 0;
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ if (btc_debug_log) then {
[format ["count all pos %1 in %2 ", count _allpositions, _house], __FILE__, [false]] call btc_fnc_debug_message;
};
{
private _wp = [_group, _x, 0.2, "MOVE", "UNCHANGED", "NO CHANGE", "UNCHANGED", "NO CHANGE", "", [15, 20, 30]] call CBA_fnc_addWaypoint;
private _wp = [_group, [_x, 0.2] call CBA_fnc_randPos, -1, "MOVE", "UNCHANGED", "NO CHANGE", "UNCHANGED", "NO CHANGE", "", [15, 20, 30]] call CBA_fnc_addWaypoint;
_wp waypointAttachObject _house;
_wp setWaypointHousePosition _forEachIndex;
} forEach _allpositions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ units _group joinSilent _group;
if !(_side isEqualTo civilian && {vehicle leader _group isEqualTo leader _group}) then {
if (count (_array_wp select 1) > 1) then {
{
[_group, _x select 0, 0, _x select 1, _x select 5, _x select 4, _x select 2, _x select 3, "", [0, 0, 0], 20] call CBA_fnc_addWaypoint;
[_group, _x select 0, -1, _x select 1, _x select 5, _x select 4, _x select 2, _x select 3, "", [0, 0, 0], 20] call CBA_fnc_addWaypoint;
} forEach (_array_wp select 1);
_group setCurrentWaypoint [_group, _array_wp select 0];
};
Expand Down
2 changes: 1 addition & 1 deletion =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/addWP.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ switch (true) do {
[_group, _rpos, _area, 2 + floor (random 4), "MOVE", "AWARE", "RED", ["LIMITED", "NORMAL"] select ((vehicle leader _group) isKindOf "Air"), "STAG COLUMN", "", [5, 10, 20]] call CBA_fnc_taskPatrol;
};
case (_wp > _wp_sentry_probability) : {
[_group, _rpos, 0, "SENTRY", "AWARE", "RED", "UNCHANGED", "WEDGE", "(group this) spawn btc_fnc_data_add_group;", [18000, 36000, 54000]] call CBA_fnc_addWaypoint;
[_group, _rpos, -1, "SENTRY", "AWARE", "RED", "UNCHANGED", "WEDGE", "(group this) spawn btc_fnc_data_add_group;", [18000, 36000, 54000]] call CBA_fnc_addWaypoint;
};
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ switch (true) do {
};
case (_wp > _wp_sentry_probability) : {
[_group, _rpos, _n, _pos_iswater] call btc_fnc_mil_createUnits;
[_group, _rpos, 0, "SENTRY", "AWARE", "RED"] call CBA_fnc_addWaypoint;
[_group, _rpos, -1, "SENTRY", "AWARE", "RED"] call CBA_fnc_addWaypoint;
};
};

Expand Down
8 changes: 4 additions & 4 deletions =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/send.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ switch (_typeOf_patrol) do {
_group setVariable ["no_cache", true];
[_group] call CBA_fnc_clearWaypoints;

[_group, _dest, 60, "MOVE", "AWARE", "RED", "FULL", _infFormation, "(group this) call btc_fnc_data_add_group;"] call CBA_fnc_addWaypoint;
[_group, _dest, -1, "MOVE", "AWARE", "RED", "FULL", _infFormation, "(group this) call btc_fnc_data_add_group;", nil, 60] call CBA_fnc_addWaypoint;
};
case 1 : {
_group = createGroup [btc_enemy_side, true];
Expand All @@ -54,9 +54,9 @@ switch (_typeOf_patrol) do {

private _veh = [_group, _return_pos, _veh_type] call btc_fnc_mil_createVehicle;

[_group, _dest, 60, "MOVE", "AWARE", "RED", "NORMAL", "NO CHANGE", "(group this) call btc_fnc_data_add_group;"] call CBA_fnc_addWaypoint;
[_group, _dest, 60, "GETOUT"] call CBA_fnc_addWaypoint;
[_group, _dest, 60, "SENTRY"] call CBA_fnc_addWaypoint;
[_group, _dest, -1, "MOVE", "AWARE", "RED", "NORMAL", "NO CHANGE", "(group this) call btc_fnc_data_add_group;", nil, 60] call CBA_fnc_addWaypoint;
[_group, _dest, -1, "GETOUT", nil, nil, nil, nil, nil, nil, 60] call CBA_fnc_addWaypoint;
[_group, _dest, -1, "SENTRY", nil, nil, nil, nil, nil, nil, 60] call CBA_fnc_addWaypoint;

};
};
Expand Down
8 changes: 4 additions & 4 deletions =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/patrol/addWP.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ if (_vehicle isKindOf "Air" || _vehicle isKindOf "LandVehicle") then {
_group setBehaviour "SAFE";

if (_vehicle isKindOf "Air") then {
[_group, _pos, 0, "MOVE", "UNCHANGED", "RED", "LIMITED", "STAG COLUMN", _waypointStatements, [0, 0, 0], 20] call CBA_fnc_addWaypoint;
[_group, _pos, -1, "MOVE", "UNCHANGED", "RED", "LIMITED", "STAG COLUMN", _waypointStatements, [0, 0, 0], 20] call CBA_fnc_addWaypoint;

} else {
[_group, _pos, 0, "MOVE", "UNCHANGED", "RED", "LIMITED", "STAG COLUMN", "", [0, 0, 0], 20] call CBA_fnc_addWaypoint;
[_group, _pos, -1, "MOVE", "UNCHANGED", "RED", "LIMITED", "STAG COLUMN", "", [0, 0, 0], 20] call CBA_fnc_addWaypoint;
for "_i" from 0 to (2 + (floor (random 3))) do {
private _newPos = [_pos, 150] call CBA_fnc_randPos;
[_group, _newPos, 0, "MOVE", "UNCHANGED", "RED", "UNCHANGED", "NO CHANGE", "", [0, 0, 0], 20] call CBA_fnc_addWaypoint;
[_group, _newPos, -1, "MOVE", "UNCHANGED", "RED", "UNCHANGED", "NO CHANGE", "", [0, 0, 0], 20] call CBA_fnc_addWaypoint;
};
private _waypoint_WPCheck = [_group, _pos, 0, "MOVE", "UNCHANGED", "NO CHANGE", "UNCHANGED", "NO CHANGE", _waypointStatements, [0, 0, 0], 20] call CBA_fnc_addWaypoint;
private _waypoint_WPCheck = [_group, _pos, -1, "MOVE", "UNCHANGED", "NO CHANGE", "UNCHANGED", "NO CHANGE", _waypointStatements, [0, 0, 0], 20] call CBA_fnc_addWaypoint;
};

if (btc_debug) then {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,16 @@ if (btc_debug_log) then {
if ((random 1) > _ratio) then {
//MOT
private _group = [_start_pos, _pos, 1] call btc_fnc_mil_send;
[_group, _pos, 60, "UNLOAD"] call CBA_fnc_addWaypoint;
[_group, _pos, 60, "SAD"] call CBA_fnc_addWaypoint;
[_group, _pos, -1, "UNLOAD", nil, nil, nil, nil, nil, nil, 60] call CBA_fnc_addWaypoint;
[_group, _pos, -1, "SAD", nil, nil, nil, nil, nil, nil, 60] call CBA_fnc_addWaypoint;

if (btc_debug_log) then {
[format ["MOT %1/%2 POS %3", _group, typeOf _veh, _pos], __FILE__, [false]] call btc_fnc_debug_message;
};
} else {
//INF
private _group = [_start_pos, _pos, 0, "", "WEDGE"] call btc_fnc_mil_send;
[_group, _pos, 60, "SAD"] call CBA_fnc_addWaypoint;
[_group, _pos, -1, "SAD", nil, nil, nil, nil, nil, nil, 60] call CBA_fnc_addWaypoint;

if (btc_debug_log) then {
[format ["INF %1", _group], __FILE__, [false]] call btc_fnc_debug_message;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ private _surrender_taskID = _taskID + "su";
private _handcuff_taskID = _taskID + "hc";
private _back_taskID = _taskID + "bk";

[_group, _pos2, 0, "MOVE", "SAFE", "RED", "LIMITED", "COLUMN", format ["['%1', 'FAILED'] call BIS_fnc_taskSetState;", _taskID], [0, 0, 0], _radius_x / 1.5] call CBA_fnc_addWaypoint;
[_group, _pos2, -1, "MOVE", "SAFE", "RED", "LIMITED", "COLUMN", format ["['%1', 'FAILED'] call BIS_fnc_taskSetState;", _taskID], [0, 0, 0], _radius_x / 1.5] call CBA_fnc_addWaypoint;

//// Create trigger \\\\
private _trigger = createTrigger ["EmptyDetector", getPos _city1];
Expand Down
2 changes: 1 addition & 1 deletion =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/convoy.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ _agent addEventHandler ["PathCalculated", {
_agent removeEventHandler ["PathCalculated", _thisEventHandler];
}];

[_group, _pos2, 0, "MOVE", "SAFE", "RED", "LIMITED", "COLUMN", format ["['%1', 'FAILED'] call BIS_fnc_taskSetState;", _taskID], [0, 0, 0], _radius_x/2] call CBA_fnc_addWaypoint;
[_group, _pos2, -1, "MOVE", "SAFE", "RED", "LIMITED", "COLUMN", format ["['%1', 'FAILED'] call BIS_fnc_taskSetState;", _taskID], [0, 0, 0], _radius_x/2] call CBA_fnc_addWaypoint;

waitUntil {sleep 5; (_taskID call BIS_fnc_taskCompleted || (_vehs select {canMove _x} isEqualTo []) || (_group isEqualTo grpNull))};

Expand Down