Skip to content

Commit

Permalink
Merge pull request #1527 from Vdauphin/FIX-side_checkpoint
Browse files Browse the repository at this point in the history
FIX: Static not removed when side mission checkpoint cancelled
  • Loading branch information
Vdauphin authored Nov 1, 2023
2 parents 25552a8 + 7f6bc2d commit a647631
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ Parameters:
_city - City where the static is created. [Object]
Returns:
_static - Created static. [Object]
_group - Created group. [Object]
Examples:
(begin example)
_static = [getPosATL player] call btc_mil_fnc_create_static;
_group = [getPosATL player] call btc_mil_fnc_create_static;
(end)
Author:
Expand All @@ -44,3 +44,5 @@ _group setCombatMode "RED";
if (btc_debug_log) then {
[format ["POS %1", _pos], __FILE__, [false]] call btc_debug_fnc_message;
};

_group
11 changes: 8 additions & 3 deletions =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/checkpoint.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ private _radius = _city getVariable ["cachingRadius", 0];
private _boxes = [];
private _composition = [];
private _blacklist = [];
private _groups = [];
for "_i" from 1 to (2 + round random 2) do {
//// Choose a road \\\\
private _pos = [getPos _city, _radius/4] call btc_fnc_randomize_pos;
Expand Down Expand Up @@ -84,10 +85,12 @@ for "_i" from 1 to (2 + round random 2) do {
//// Create checkpoint with static at _pos \\\\
_pos params ["_x", "_y", "_z"];
private _posStatic = [_x -2.39185*cos(-_direction) - 2.33984*sin(-_direction), _y + 2.33984 *cos(-_direction) -2.39185*sin(-_direction), _z];
[_posStatic, _statics, _direction + 180, [], _city] call btc_mil_fnc_create_static;
private _group = [_posStatic, _statics, _direction + 180, [], _city] call btc_mil_fnc_create_static;
_groups pushBack _group;

private _posStatic = [_x + 2.72949*cos(-_direction) - -2.03857*sin(-_direction), _y -2.03857*cos(-_direction) +2.72949*sin(-_direction), _z];
[_posStatic, _statics, _direction, [], _city] call btc_mil_fnc_create_static;
private _group = [_posStatic, _statics, _direction, [], _city] call btc_mil_fnc_create_static;
_groups pushBack _group;

_composition append ([_pos, _direction, _composition_checkpoint] call btc_fnc_create_composition);

Expand Down Expand Up @@ -121,7 +124,9 @@ waitUntil {sleep 5;

[[], _boxes + _composition] call btc_fnc_delete;

if (_taskID call BIS_fnc_taskState isEqualTo "CANCELED") exitWith {};
if (_taskID call BIS_fnc_taskState isEqualTo "CANCELED") exitWith {
[[], _groups apply {vehicle leader _x}] call btc_fnc_delete;
};

80 call btc_rep_fnc_change;

Expand Down

0 comments on commit a647631

Please sign in to comment.