mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Solve crashing caused by off map position and disableSimulation to stop underwater issues
This commit is contained in:
parent
ff4fce3950
commit
58b1c0f3a9
@ -28,6 +28,4 @@ PREP(unitSide);
|
|||||||
PREP(unitVar);
|
PREP(unitVar);
|
||||||
PREP(viewDistance);
|
PREP(viewDistance);
|
||||||
|
|
||||||
GVAR(penPos) = [-10e5,-10e5,0];
|
|
||||||
|
|
||||||
ADDON = true;
|
ADDON = true;
|
||||||
|
@ -27,13 +27,16 @@ if (_set isEqualTo (_unit getVariable [QGVAR(isSpectator), false])) exitWith {};
|
|||||||
// Spectators aren't physical entities (todo: this command has to be executed on the server)
|
// Spectators aren't physical entities (todo: this command has to be executed on the server)
|
||||||
_unit hideObjectGlobal _set;
|
_unit hideObjectGlobal _set;
|
||||||
|
|
||||||
if (isClass (configFile >> "CfgPatches" >> "ace_hearing")) then {EGVAR(hearing,disableVolumeUpdate) = _set};
|
// Prevent player falling into water
|
||||||
if (isClass (configFile >> "CfgPatches" >> "acre_sys_radio")) then {[_set] call acre_api_fnc_setSpectator};
|
_unit enableSimulation !_set;
|
||||||
if (isClass (configFile >> "CfgPatches" >> "task_force_radio")) then {[_unit, _set] call TFAR_fnc_forceSpectator};
|
|
||||||
|
|
||||||
if (_set) then {
|
if (_set) then {
|
||||||
// Move the player ASAP to avoid being seen
|
// Move the player ASAP to avoid being seen
|
||||||
_unit setPosATL GVAR(penPos);
|
_unit setPosASL (getMarkerPos QGVAR(respawn));
|
||||||
|
[_unit] joinSilent grpNull;
|
||||||
|
|
||||||
|
// Dead men can't talk
|
||||||
|
[_unit, "isSpectator"] call EFUNC(common,muteUnit);
|
||||||
|
|
||||||
if !(GVAR(modulePos)) then {
|
if !(GVAR(modulePos)) then {
|
||||||
if !(isNull _target) then {
|
if !(isNull _target) then {
|
||||||
@ -41,26 +44,22 @@ if (_set) then {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
// Spectators shouldn't show in group UI
|
|
||||||
[_unit] joinSilent grpNull;
|
|
||||||
|
|
||||||
// Prevent drowning and vision blur
|
|
||||||
if (surfaceisWater GVAR(penPos)) then {
|
|
||||||
_unit forceAddUniform "U_B_Wetsuit";
|
|
||||||
_unit addVest "V_RebreatherB";
|
|
||||||
};
|
|
||||||
|
|
||||||
// Dead men can't talk
|
|
||||||
[_unit, "isSpectator"] call EFUNC(common,muteUnit);
|
|
||||||
|
|
||||||
0 fadeSound 0;
|
0 fadeSound 0;
|
||||||
999999 cutText ["", "BLACK FADED", 0];
|
999999 cutText ["", "BLACK FADED", 0];
|
||||||
["Init", [true]] call FUNC(camera);
|
["Init", [true]] call FUNC(camera);
|
||||||
} else {
|
} else {
|
||||||
// Code to exit spectator and "respawn" player goes here (WIP)
|
// Code to exit spectator and "respawn" player goes here (WIP)
|
||||||
["Exit"] call FUNC(camera);
|
["Exit"] call FUNC(camera);
|
||||||
|
|
||||||
|
// Living men can talk
|
||||||
|
[_unit, "isSpectator"] call EFUNC(common,unmuteUnit);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Handle common addon audio
|
||||||
|
if (isClass (configFile >> "CfgPatches" >> "ace_hearing")) then {EGVAR(hearing,disableVolumeUpdate) = _set};
|
||||||
|
if (isClass (configFile >> "CfgPatches" >> "acre_sys_radio")) then {[_set] call acre_api_fnc_setSpectator};
|
||||||
|
if (isClass (configFile >> "CfgPatches" >> "task_force_radio")) then {[_unit, _set] call TFAR_fnc_forceSpectator};
|
||||||
|
|
||||||
// Spectators ignore damage (vanilla and ace_medical)
|
// Spectators ignore damage (vanilla and ace_medical)
|
||||||
_unit allowDamage !_set;
|
_unit allowDamage !_set;
|
||||||
_unit setVariable ["ace_medical_allowDamage", !_set];
|
_unit setVariable ["ace_medical_allowDamage", !_set];
|
||||||
|
Loading…
Reference in New Issue
Block a user