-
Notifications
You must be signed in to change notification settings - Fork 739
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Interaction - Add action to drop distant units from group (#10228)
Co-authored-by: Dystopian <[email protected]> Co-authored-by: Grim <[email protected]>
- Loading branch information
1 parent
e798050
commit b4700ae
Showing
5 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
addons/interaction/functions/fnc_canGroupDropDistantUnits.sqf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#include "..\script_component.hpp" | ||
/* | ||
* Author: PabstMirror | ||
* Checks if the unit can drop distant units from their group | ||
* | ||
* Arguments: | ||
* 0: Unit <OBJECT> | ||
* | ||
* Return Value: | ||
* Unit can drop distant units <BOOL> | ||
* | ||
* Example: | ||
* [player] call ace_interaction_fnc_canGroupDropDistantUnits | ||
* | ||
* Public: No | ||
*/ | ||
|
||
params ["_unit"]; | ||
|
||
(_unit == leader _unit) && {missionNamespace getVariable [QGVAR(groupDropUnitDistance), 100] > 0} |
25 changes: 25 additions & 0 deletions
25
addons/interaction/functions/fnc_groupDropDistantUnits.sqf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#include "..\script_component.hpp" | ||
/* | ||
* Author: PabstMirror | ||
* Drops distant units from their group | ||
* | ||
* Arguments: | ||
* 0: Unit <OBJECT> | ||
* | ||
* Return Value: | ||
* None | ||
* | ||
* Example: | ||
* [player] call ace_interaction_fnc_groupDropDistantUnits | ||
* | ||
* Public: No | ||
*/ | ||
|
||
params ["_unit"]; | ||
|
||
{ | ||
if ((_x distance _unit) > (missionNamespace getVariable [QGVAR(groupDropUnitDistance), 100])) then { | ||
TRACE_1("drop",_x); | ||
[_x] joinSilent grpNull; | ||
}; | ||
} forEach (units group _unit); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters