Skip to content

Commit 8f832d3

Browse files
committed
Fix RTB behaviour
1 parent 0385553 commit 8f832d3

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

addons/sup_artillery/fnc_artillery.sqf

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,13 @@ switch (_operation) do {
208208
case "unpack": {
209209
private _group = _logic getVariable ["group", grpNull];
210210
private _fireMission = _logic getVariable ["fireMission", []];
211-
private _position = [_fireMission, "position"] call ALIVE_fnc_hashGet;
211+
private _position = [];
212+
213+
if (count _fireMission > 0) then {
214+
_position = [_fireMission, "position"] call ALIVE_fnc_hashGet;
215+
} else {
216+
_position = position _logic;
217+
};
212218

213219
private _handle = [_group, position (leader _group), _position] spawn ALIVE_fnc_unpackMortar;
214220

@@ -315,7 +321,16 @@ switch (_operation) do {
315321
} forEach _units;
316322

317323
_logic setVariable ["fireMission", []];
318-
[_logic, "move", [position _logic]] call MAINCLASS;
324+
325+
[_logic] spawn {
326+
private _logic = param [0, objNull, [objNull]];
327+
328+
[_logic, "pack"] call MAINCLASS;
329+
waitUntil { [_logic, "hasPacked"] call MAINCLASS };
330+
[_logic, "move", [position _logic]] call MAINCLASS;
331+
waitUntil { [_logic, "inPosition"] call MAINCLASS };
332+
[_logic, "unpack"] call MAINCLASS;
333+
};
319334
};
320335
};
321336

0 commit comments

Comments
 (0)