Skip to content

Commit

Permalink
Fire - Fix animals screaming like humans (#8625)
Browse files Browse the repository at this point in the history
* Fire - Only human screams

* Use fnc_burnReaction for screams

Co-authored-by: Filip Maciejewski <veteran29@users.noreply.github.com>
  • Loading branch information
Whigital and veteran29 authored Nov 9, 2021
1 parent 727ac12 commit d73f0f3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
4 changes: 1 addition & 3 deletions addons/fire/functions/fnc_burn.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,7 @@ if (_isBurning) exitWith {};
_unit setVariable [QGVAR(burnUIPFH), _burnIndicatorPFH];
};

private _soundID = floor (1 + random 15);
private _sound = format [QGVAR(scream_%1), _soundID];
[QGVAR(playScream), [_sound, _unit]] call CBA_fnc_globalEvent;
[_unit, false] call FUNC(burnReaction);
};

_lastIntensityUpdate = 0;
Expand Down
14 changes: 9 additions & 5 deletions addons/fire/functions/fnc_burnReaction.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,27 @@
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Should unit throw its current weapon <BOOL>
*
* Return Value:
* None
*
* Public: No
*/

params ["_unit"];
params ["_unit", ["_throwWeapon", true]];

if (
GVAR(dropWeapon) > 0
_throwWeapon
&& {GVAR(dropWeapon) > 0}
&& {_unit in _unit && { !(currentWeapon _unit isEqualTo "") }}
&& {!isPlayer _unit || GVAR(dropWeapon >= 2)}
) then {
[_unit] call EFUNC(hitreactions,throwWeapon);
};

private _soundID = floor (1 + random 15);
private _sound = format [QGVAR(scream_%1), _soundID];
[QGVAR(playScream), [_sound, _unit]] call CBA_fnc_globalEvent;
if (_unit isKindOf "CAManBase") then {
private _soundID = floor (1 + random 15);
private _sound = format [QGVAR(scream_%1), _soundID];
[QGVAR(playScream), [_sound, _unit]] call CBA_fnc_globalEvent;
};

0 comments on commit d73f0f3

Please sign in to comment.