-
Notifications
You must be signed in to change notification settings - Fork 736
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hearing - Reset earplugs on respawn, addItem setting
- Loading branch information
1 parent
845909f
commit 87b9ff9
Showing
8 changed files
with
76 additions
and
3 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
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,35 @@ | ||
/* | ||
* Author: PabstMirror | ||
* Reset earplugs on respawn, and then re-add if appropriate | ||
* | ||
* Arguments: | ||
* 0: Unit <OBJECT> | ||
* | ||
* Return Value: | ||
* Nothing | ||
* | ||
* Example: | ||
* [player] call ACE_hearing_fnc_handleRespawn; | ||
* | ||
* Public: No | ||
*/ | ||
#include "script_component.hpp" | ||
|
||
params ["_unit"]; | ||
TRACE_2("params",_unit,typeOf _unit); | ||
|
||
if (!local _unit) exitWith {}; //XEH should only be called on local units | ||
|
||
local _respawn = [0] call BIS_fnc_missionRespawnType; | ||
|
||
//if respawn is not Group or side: | ||
if (_respawn <= 3) then { | ||
//Remove earplugs if they have them: | ||
if (_unit getVariable ["ACE_hasEarPlugsin", false]) then { | ||
TRACE_1("had EarPlugs in - removing",_unit); | ||
_unit setVariable ["ACE_hasEarPlugsin", false, true]; | ||
}; | ||
}; | ||
|
||
//Re-add if they need them: | ||
[_unit] call FUNC(addEarPlugs); |
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