Skip to content

Commit

Permalink
Update fnc_doCallout (#355)
Browse files Browse the repository at this point in the history
* Allow leading slash

Since Arma 3 v2.10, leading slashes are allowed for playSound3D, so no need to bother removing it.

* Make callouts come from units head

The callout is now played from the unit's eyePos instead of their position.
  • Loading branch information
rekterakathom authored Feb 18, 2024
1 parent 08e416d commit 8d573ae
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions addons/main/functions/fnc_doCallout.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,6 @@ if (isNil "_cachedSounds") then {
if (_sound select [0, 1] != "\") then {
_sound = (getArray (configFile >> "CfgVoice" >> _speaker >> "directories") select 0) + _sound;
};
if (_sound select [0, 1] == "\") then {
_sound = _sound select [1];
};
};
_cachedSounds set [_forEachIndex, _sound];
} forEach _cachedSounds;
Expand All @@ -107,7 +104,7 @@ if (_cachedSounds isEqualTo []) exitWith {
};

private _sound = selectRandom _cachedSounds;
playSound3D [_sound, _unit, isNull (objectParent _unit), getPosASL _unit, 5, pitch _unit, _distance];
playSound3D [_sound, _unit, isNull (objectParent _unit), eyePos _unit, 5, pitch _unit, _distance];
[_unit, true] remoteExecCall ["setRandomLip", 0];
[{
_this remoteExecCall ["setRandomLip", 0];
Expand Down

0 comments on commit 8d573ae

Please sign in to comment.