Commit aee78255 authored by Ryan Grupp's avatar Ryan Grupp
Browse files

Fix static_radio loopSoundGlobal

parent 9960545a
......@@ -769,6 +769,8 @@ Arguments:
* Duration of the sound, in seconds.
* __Volume__ <sub>_(integer) [optional]_</sub>
* Volume of the sound, with 1 being normal volume. _(Default: 1)_
* __Distance__ <sub>_(integer) [optional]_</sub>
* Distance in meters the sound can be heard, 0 for unlimited. _(Default: 0)_
```sqf
[
......
......@@ -3,6 +3,7 @@ params [
['_sound', '', ['']],
['_duration', 120, [0]],
['_volume', 1, [0]],
['_distance', 0, [0]],
['_looping', false, [true]]
];
......@@ -19,7 +20,7 @@ if (!_looping) exitWith
private _missionConfig = (missionConfigFile >> "CfgSounds" >> _sound);
_sound = switch true do {
case (isClass _config): { (getArray (_config >> "sound")) select 0 };
case (isClass _missionConfig): { (getArray (_missionConfig >> "sound")) select 0 };
case (isClass _missionConfig): { getMissionPath ((getArray (_missionConfig >> "sound")) select 0) };
default { _sound };
};
......@@ -31,7 +32,7 @@ if (!_looping) exitWith
_this set [1, _sound];
_this set [4, true];
_this set [5, true];
......@@ -42,7 +43,7 @@ if (!_looping) exitWith
private _location = if(_object isEqualType []) then {_object} else {getPosASL _object};
playSound3D [_sound, _object, false, _location, _volume];
playSound3D [_sound, _object, false, _location, _volume, 1, _distance];
[tsm_static_radio_fnc_loopSoundGlobal, _this, _duration] call CBA_fnc_waitAndExecute;
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment