-
Notifications
You must be signed in to change notification settings - Fork 737
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make use of getHitpointsDamage command to drastically speed up some f…
…unctions about hitpoints
- Loading branch information
Showing
4 changed files
with
37 additions
and
90 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
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
28 changes: 28 additions & 0 deletions
28
addons/common/functions/fnc_getSelectionsWithoutHitPoints.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,28 @@ | ||
/* | ||
* Author: commy2 | ||
* | ||
* Returns all damageable selections without hitpoints of any vehicle. | ||
* | ||
* Arguments: | ||
* 0: A vehicle, not the classname (Object) | ||
* | ||
* Return Value: | ||
* The selections without hitpoints, i.e. reflectors. (Array) | ||
*/ | ||
#include "script_component.hpp" | ||
|
||
params ["_vehicle"]; | ||
|
||
private ["_hitPointsFull", "_allSelectionsWithoutHitpoints"]; | ||
|
||
_hitPointsFull = getAllHitPointsDamage _vehicle; | ||
|
||
_allSelectionsWithoutHitpoints = []; | ||
|
||
{ | ||
if (_x == "") then { | ||
_allSelectionsWithoutHitpoints pushBack (_hitPointsFull select 1 select _forEachIndex); | ||
}; | ||
} forEach (_hitPointsFull select 0); | ||
|
||
_allSelectionsWithoutHitpoints |