-
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.
Fire - Reset intensity on unit respawn (#10712)
Co-authored-by: johnb432 <[email protected]>
- Loading branch information
1 parent
9d70617
commit eb95025
Showing
4 changed files
with
46 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
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,33 @@ | ||
#include "..\script_component.hpp" | ||
/* | ||
* Author: LinkIsGrim | ||
* Initializes unit variables. | ||
* | ||
* Arguments: | ||
* 0: The Unit <OBJECT> | ||
* 1: Is Respawned <BOOL> | ||
* | ||
* Return Value: | ||
* None | ||
* | ||
* Example: | ||
* [bob, false] call ace_fire_fnc_initUnit | ||
* | ||
* Public: No | ||
*/ | ||
|
||
params ["_unit", ["_isRespawn", true]]; | ||
TRACE_2("initUnit",_unit,_isRespawn); | ||
|
||
if (!_isRespawn) then { // Always add respawn EH (same as CBA's onRespawn=1) | ||
_unit addEventHandler ["Respawn", {[(_this select 0), true] call FUNC(initUnit)}]; | ||
}; | ||
|
||
if (!local _unit) exitWith {}; | ||
|
||
if (_isRespawn) then { | ||
TRACE_1("resetting all vars on respawn",_isRespawn); | ||
|
||
_unit setVariable [QGVAR(intensity), nil, true]; | ||
_unit setVariable [QGVAR(stopDropRoll), nil, true]; | ||
}; |
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