mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
General - Convert vehicle to objectParent (#9801)
Convert vehicle to objectParent
This commit is contained in:
parent
a8ed533004
commit
cee187adac
@ -19,7 +19,7 @@ params ["_unit"];
|
|||||||
|
|
||||||
if !(_unit getVariable [QGVAR(inHand), false]) exitWith {false};
|
if !(_unit getVariable [QGVAR(inHand), false]) exitWith {false};
|
||||||
|
|
||||||
if (vehicle _unit != _unit) exitWith {
|
if (!isNull objectParent _unit) exitWith {
|
||||||
private _startPos = eyePos _unit;
|
private _startPos = eyePos _unit;
|
||||||
private _aimLinePos = AGLToASL (positionCameraToWorld [0, 0, 1]);
|
private _aimLinePos = AGLToASL (positionCameraToWorld [0, 0, 1]);
|
||||||
private _intersections = lineIntersectsSurfaces [_startPos, _aimLinePos, _unit, objNull, false];
|
private _intersections = lineIntersectsSurfaces [_startPos, _aimLinePos, _unit, objNull, false];
|
||||||
|
@ -45,7 +45,7 @@ if (!(_unit getVariable [QGVAR(primed), false])) then {
|
|||||||
private _newVelocity = (_p1 vectorFromTo _p2) vectorMultiply _velocity;
|
private _newVelocity = (_p1 vectorFromTo _p2) vectorMultiply _velocity;
|
||||||
|
|
||||||
// Adjust for throwing from inside vehicles, where we have a vehicle-based velocity that can't be compensated for by a human
|
// Adjust for throwing from inside vehicles, where we have a vehicle-based velocity that can't be compensated for by a human
|
||||||
if (vehicle _unit != _unit) then {
|
if (!isNull objectParent _unit) then {
|
||||||
_newVelocity = _newVelocity vectorAdd (velocity (vehicle _unit));
|
_newVelocity = _newVelocity vectorAdd (velocity (vehicle _unit));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ if (_isUnconc) then {
|
|||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
//Woke up: if handcuffed, goto animation
|
//Woke up: if handcuffed, goto animation
|
||||||
if (_unit getVariable [QGVAR(isHandcuffed), false] && {vehicle _unit == _unit}) then {
|
if (_unit getVariable [QGVAR(isHandcuffed), false] && {isNull objectParent _unit}) then {
|
||||||
[_unit] call EFUNC(common,fixLoweredRifleAnimation);
|
[_unit] call EFUNC(common,fixLoweredRifleAnimation);
|
||||||
[_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation);
|
[_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation);
|
||||||
};
|
};
|
||||||
|
@ -17,6 +17,6 @@
|
|||||||
|
|
||||||
params ["_unit"];
|
params ["_unit"];
|
||||||
|
|
||||||
if (currentWeapon _unit != "" && {currentWeapon _unit == primaryWeapon _unit} && {weaponLowered _unit} && {stance _unit == "STAND"} && {vehicle _unit == _unit}) then {
|
if (currentWeapon _unit != "" && {currentWeapon _unit == primaryWeapon _unit} && {weaponLowered _unit} && {stance _unit == "STAND"} && {isNull objectParent _unit}) then {
|
||||||
[_unit, "amovpercmstpsraswrfldnon", 0] call FUNC(doAnimation);
|
[_unit, "amovpercmstpsraswrfldnon", 0] call FUNC(doAnimation);
|
||||||
};
|
};
|
||||||
|
@ -29,7 +29,7 @@ private _unitActionsCfg = configFile >> "CfgMovesBasic" >> "Actions" >> getText
|
|||||||
|
|
||||||
TRACE_2("Animation/Action",configName _unitAnimationCfg,configName _unitActionsCfg);
|
TRACE_2("Animation/Action",configName _unitAnimationCfg,configName _unitActionsCfg);
|
||||||
|
|
||||||
if (vehicle _unit != _unit) then {
|
if (!isNull objectParent _unit) then {
|
||||||
private _interpolateArray = getArray (_unitAnimationCfg >> "interpolateTo");
|
private _interpolateArray = getArray (_unitAnimationCfg >> "interpolateTo");
|
||||||
|
|
||||||
for "_index" from 0 to (count _interpolateArray - 1) step 2 do {
|
for "_index" from 0 to (count _interpolateArray - 1) step 2 do {
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
params ["_unit"];
|
params ["_unit"];
|
||||||
|
|
||||||
// Animation changes even inside vehicle post-1.60
|
// Animation changes even inside vehicle post-1.60
|
||||||
if (stance _unit == "PRONE" || {vehicle _unit != _unit} || {_unit call EFUNC(common,isSwimming)}) exitWith {};
|
if (stance _unit == "PRONE" || {!isNull objectParent _unit} || {_unit call EFUNC(common,isSwimming)}) exitWith {};
|
||||||
|
|
||||||
[
|
[
|
||||||
_unit,
|
_unit,
|
||||||
|
@ -44,7 +44,7 @@ if (_tryLoad && {!(_target isKindOf "CAManBase")} && {["ace_cargo"] call EFUNC(c
|
|||||||
|
|
||||||
// Fix anim when aborting carrying persons
|
// Fix anim when aborting carrying persons
|
||||||
if (_target isKindOf "CAManBase" || {animationState _unit in CARRY_ANIMATIONS}) then {
|
if (_target isKindOf "CAManBase" || {animationState _unit in CARRY_ANIMATIONS}) then {
|
||||||
if (vehicle _unit == _unit && {!(_unit getVariable ["ACE_isUnconscious", false])}) then {
|
if (isNull objectParent _unit && {!(_unit getVariable ["ACE_isUnconscious", false])}) then {
|
||||||
[_unit, "", 2] call EFUNC(common,doAnimation);
|
[_unit, "", 2] call EFUNC(common,doAnimation);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ if (isNull _explosive) exitWith {
|
|||||||
deleteVehicle _target;
|
deleteVehicle _target;
|
||||||
false
|
false
|
||||||
};
|
};
|
||||||
if (vehicle _unit != _unit || {(_unit call EFUNC(common,uniqueItems)) findAny GVAR(defusalKits) == -1}) exitWith {false};
|
if (!isNull objectParent _unit || {(_unit call EFUNC(common,uniqueItems)) findAny GVAR(defusalKits) == -1}) exitWith {false};
|
||||||
|
|
||||||
if (GVAR(RequireSpecialist) && {!([_unit] call EFUNC(Common,isEOD))}) exitWith {false};
|
if (GVAR(RequireSpecialist) && {!([_unit] call EFUNC(Common,isEOD))}) exitWith {false};
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ _arguments params ["_unit", "", "_rope", "", "_timeToPlayRopeSound"];
|
|||||||
_rope params ["", "", "", "_dummy", "_hook"];
|
_rope params ["", "", "", "_dummy", "_hook"];
|
||||||
|
|
||||||
//Wait until the unit is actually outside of the helicopter
|
//Wait until the unit is actually outside of the helicopter
|
||||||
if (vehicle _unit != _unit) exitWith {};
|
if (!isNull objectParent _unit) exitWith {};
|
||||||
|
|
||||||
// dummy lost hook
|
// dummy lost hook
|
||||||
if (isNull _hook) exitWith {
|
if (isNull _hook) exitWith {
|
||||||
|
@ -20,7 +20,7 @@ _arguments params ["_unit", "_vehicle", "_rope", "_ropeIndex", "_hasBeenAttached
|
|||||||
_rope params ["_attachmentPoint", "_ropeTop", "_ropeBottom", "_dummy", "_hook"];
|
_rope params ["_attachmentPoint", "_ropeTop", "_ropeBottom", "_dummy", "_hook"];
|
||||||
|
|
||||||
//Wait until the unit is actually outside of the helicopter
|
//Wait until the unit is actually outside of the helicopter
|
||||||
if (vehicle _unit != _unit) exitWith {};
|
if (!isNull objectParent _unit) exitWith {};
|
||||||
|
|
||||||
//Prevent teleport if hook has been deleted due to rope cut
|
//Prevent teleport if hook has been deleted due to rope cut
|
||||||
if (isNull _hook) exitWith {
|
if (isNull _hook) exitWith {
|
||||||
|
@ -22,7 +22,7 @@ if (!alive _unit) exitWith {};
|
|||||||
private _fnc_underCover = {
|
private _fnc_underCover = {
|
||||||
params ["_unit"];
|
params ["_unit"];
|
||||||
|
|
||||||
if (vehicle _unit != _unit && {!isTurnedOut _unit}) exitWith {true};
|
if (!isNull objectParent _unit && {!isTurnedOut _unit}) exitWith {true};
|
||||||
|
|
||||||
// looking up and no roof over head
|
// looking up and no roof over head
|
||||||
private _position = eyePos _unit;
|
private _position = eyePos _unit;
|
||||||
|
@ -23,7 +23,7 @@ if (!alive _unit) exitWith {};
|
|||||||
GVAR(FrameEvent) set [0, !(GVAR(FrameEvent) select 0)];
|
GVAR(FrameEvent) set [0, !(GVAR(FrameEvent) select 0)];
|
||||||
|
|
||||||
if (GVAR(FrameEvent) select 0) exitWith {
|
if (GVAR(FrameEvent) select 0) exitWith {
|
||||||
if (vehicle _unit != _unit && {!isTurnedOut _unit}) exitWith {
|
if (!isNull objectParent _unit && {!isTurnedOut _unit}) exitWith {
|
||||||
(GVAR(FrameEvent) select 1) set [0, false];
|
(GVAR(FrameEvent) select 1) set [0, false];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
params ["_unit", "_actionName", "_isSelfTreatment"];
|
params ["_unit", "_actionName", "_isSelfTreatment"];
|
||||||
TRACE_3("playTreatmentAnim",_unit,_actionName,_isSelfTreatment);
|
TRACE_3("playTreatmentAnim",_unit,_actionName,_isSelfTreatment);
|
||||||
|
|
||||||
if (vehicle _unit != _unit) exitWith {};
|
if (!isNull objectParent _unit) exitWith {};
|
||||||
|
|
||||||
private _configProperty = "animationMedic";
|
private _configProperty = "animationMedic";
|
||||||
if (_isSelfTreatment) then {
|
if (_isSelfTreatment) then {
|
||||||
|
@ -28,7 +28,7 @@ if (_damageType in GVAR(noBloodDamageTypes)) exitWith {};
|
|||||||
if (GVAR(enabledFor) == BLOOD_ONLY_PLAYERS && {!isPlayer _unit && {_unit != ACE_player}}) exitWith {};
|
if (GVAR(enabledFor) == BLOOD_ONLY_PLAYERS && {!isPlayer _unit && {_unit != ACE_player}}) exitWith {};
|
||||||
|
|
||||||
// Don't bleed on the ground if in a vehicle
|
// Don't bleed on the ground if in a vehicle
|
||||||
if (vehicle _unit != _unit && {!(vehicle _unit isKindOf "StaticWeapon")}) exitWith {};
|
if (!isNull objectParent _unit && {!(vehicle _unit isKindOf "StaticWeapon")}) exitWith {};
|
||||||
|
|
||||||
private _bulletDir = if (isNull _shooter) then {
|
private _bulletDir = if (isNull _shooter) then {
|
||||||
random 360 // Cannot calculate the direction properly, pick a random direction
|
random 360 // Cannot calculate the direction properly, pick a random direction
|
||||||
|
@ -22,7 +22,7 @@ params ["_unit"];
|
|||||||
if !(_unit call FUNC(isBleeding)) exitWith {};
|
if !(_unit call FUNC(isBleeding)) exitWith {};
|
||||||
|
|
||||||
// Don't bleed on the ground if in a vehicle
|
// Don't bleed on the ground if in a vehicle
|
||||||
if (vehicle _unit != _unit && {!(vehicle _unit isKindOf "StaticWeapon")}) exitWith {};
|
if (!isNull objectParent _unit && {!(vehicle _unit isKindOf "StaticWeapon")}) exitWith {};
|
||||||
|
|
||||||
if (CBA_missionTime > (_unit getVariable [QGVAR(nextTime), -10])) then {
|
if (CBA_missionTime > (_unit getVariable [QGVAR(nextTime), -10])) then {
|
||||||
private _bloodLoss = (if (GVAR(useAceMedical)) then {GET_BLOOD_LOSS(_unit) * 2.5} else {getDammage _unit * 2}) min 6;
|
private _bloodLoss = (if (GVAR(useAceMedical)) then {GET_BLOOD_LOSS(_unit) * 2.5} else {getDammage _unit * 2}) min 6;
|
||||||
|
@ -33,14 +33,14 @@ if (_isUnconscious) then {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// set animation inside vehicles
|
// set animation inside vehicles
|
||||||
if (vehicle _unit != _unit) then {
|
if (!isNull objectParent _unit) then {
|
||||||
private _unconAnim = _unit call EFUNC(common,getDeathAnim);
|
private _unconAnim = _unit call EFUNC(common,getDeathAnim);
|
||||||
TRACE_2("inVehicle - playing death anim",_unit,_unconAnim);
|
TRACE_2("inVehicle - playing death anim",_unit,_unconAnim);
|
||||||
[_unit, _unconAnim] call EFUNC(common,doAnimation);
|
[_unit, _unconAnim] call EFUNC(common,doAnimation);
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
// reset animation inside vehicles
|
// reset animation inside vehicles
|
||||||
if (vehicle _unit != _unit) then {
|
if (!isNull objectParent _unit) then {
|
||||||
private _awakeAnim = _unit call EFUNC(common,getAwakeAnim);
|
private _awakeAnim = _unit call EFUNC(common,getAwakeAnim);
|
||||||
TRACE_2("inVehicle - playing awake anim",_unit,_awakeAnim);
|
TRACE_2("inVehicle - playing awake anim",_unit,_awakeAnim);
|
||||||
[_unit, _awakeAnim, 2] call EFUNC(common,doAnimation);
|
[_unit, _awakeAnim, 2] call EFUNC(common,doAnimation);
|
||||||
|
@ -104,7 +104,7 @@ GVAR(bloodTickCounter) = 0;
|
|||||||
|
|
||||||
if (ACE_player distance _unit > _distance) exitWith {};
|
if (ACE_player distance _unit > _distance) exitWith {};
|
||||||
|
|
||||||
if (vehicle _unit == _unit) then {
|
if (isNull objectParent _unit) then {
|
||||||
// say3D waits for the previous sound to finish, so use a dummy instead
|
// say3D waits for the previous sound to finish, so use a dummy instead
|
||||||
private _dummy = "#dynamicsound" createVehicleLocal [0, 0, 0];
|
private _dummy = "#dynamicsound" createVehicleLocal [0, 0, 0];
|
||||||
_dummy attachTo [_unit, [0, 0, 0], "camera"];
|
_dummy attachTo [_unit, [0, 0, 0], "camera"];
|
||||||
|
@ -23,7 +23,7 @@ TRACE_2("onCameraViewChanged",_unit,_cameraView);
|
|||||||
call FUNC(refreshGoggleType);
|
call FUNC(refreshGoggleType);
|
||||||
|
|
||||||
if (GVAR(disableNVGsWithSights) && {(hmd _unit) != ""}) then {
|
if (GVAR(disableNVGsWithSights) && {(hmd _unit) != ""}) then {
|
||||||
if ((vehicle _unit == _unit)
|
if ((isNull objectParent _unit)
|
||||||
|| {isTurnedOut _unit}
|
|| {isTurnedOut _unit}
|
||||||
|| {!([_unit] call EFUNC(common,hasHatch))
|
|| {!([_unit] call EFUNC(common,hasHatch))
|
||||||
&& {[_unit] call EFUNC(common,getTurretIndex) in ([vehicle _unit] call EFUNC(common,getTurretsFFV))}
|
&& {[_unit] call EFUNC(common,getTurretIndex) in ([vehicle _unit] call EFUNC(common,getTurretsFFV))}
|
||||||
|
@ -21,7 +21,7 @@ TRACE_2("onVisionModeChanged",_unit,_visionMode);
|
|||||||
|
|
||||||
// Handle disableNVGsWithSights setting:
|
// Handle disableNVGsWithSights setting:
|
||||||
if (GVAR(disableNVGsWithSights) && {(hmd _unit) != ""}) then {
|
if (GVAR(disableNVGsWithSights) && {(hmd _unit) != ""}) then {
|
||||||
if ((vehicle _unit == _unit)
|
if ((isNull objectParent _unit)
|
||||||
|| {isTurnedOut _unit}
|
|| {isTurnedOut _unit}
|
||||||
|| {!([_unit] call EFUNC(common,hasHatch))
|
|| {!([_unit] call EFUNC(common,hasHatch))
|
||||||
&& {[_unit] call EFUNC(common,getTurretIndex) in ([vehicle _unit] call EFUNC(common,getTurretsFFV))}
|
&& {[_unit] call EFUNC(common,getTurretIndex) in ([vehicle _unit] call EFUNC(common,getTurretsFFV))}
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
params ["_unit"];
|
params ["_unit"];
|
||||||
|
|
||||||
if (vehicle _unit != _unit) exitWith {false};
|
if (!isNull objectParent _unit) exitWith {false};
|
||||||
|
|
||||||
private _weaponClass = currentWeapon _unit;
|
private _weaponClass = currentWeapon _unit;
|
||||||
private _weaponIndex = [_unit, _weaponClass] call EFUNC(common,getWeaponIndex);
|
private _weaponIndex = [_unit, _weaponClass] call EFUNC(common,getWeaponIndex);
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
params ["_unit"];
|
params ["_unit"];
|
||||||
|
|
||||||
if (cameraView == "GUNNER") exitWith {false};
|
if (cameraView == "GUNNER") exitWith {false};
|
||||||
if (vehicle _unit != _unit) exitWith {false};
|
if (!isNull objectParent _unit) exitWith {false};
|
||||||
if (GVAR(simplifiedZeroing)) exitWith {false};
|
if (GVAR(simplifiedZeroing)) exitWith {false};
|
||||||
if (!(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false])) exitWith {false};
|
if (!(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false])) exitWith {false};
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
params ["_unit"];
|
params ["_unit"];
|
||||||
|
|
||||||
if (cameraView == "GUNNER") exitWith {false};
|
if (cameraView == "GUNNER") exitWith {false};
|
||||||
if (vehicle _unit != _unit) exitWith {false};
|
if (!isNull objectParent _unit) exitWith {false};
|
||||||
if (!(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false])) exitWith {false};
|
if (!(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false])) exitWith {false};
|
||||||
|
|
||||||
private _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex);
|
private _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex);
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
params ["_unit"];
|
params ["_unit"];
|
||||||
|
|
||||||
if (vehicle _unit != _unit) exitWith {false};
|
if (!isNull objectParent _unit) exitWith {false};
|
||||||
|
|
||||||
private _weaponClass = currentWeapon _unit;
|
private _weaponClass = currentWeapon _unit;
|
||||||
private _weaponIndex = [_unit, _weaponClass] call EFUNC(common,getWeaponIndex);
|
private _weaponIndex = [_unit, _weaponClass] call EFUNC(common,getWeaponIndex);
|
||||||
|
@ -19,6 +19,6 @@ params ["_unit"];
|
|||||||
|
|
||||||
!([_unit] call EFUNC(common,isPlayer)
|
!([_unit] call EFUNC(common,isPlayer)
|
||||||
|| {_unit in playableUnits}
|
|| {_unit in playableUnits}
|
||||||
|| {vehicle _unit != _unit}
|
|| {!isNull objectParent _unit}
|
||||||
|| {_unit getVariable [QGVAR(IsPlayerUnit), false]}
|
|| {_unit getVariable [QGVAR(IsPlayerUnit), false]}
|
||||||
|| {_unit getVariable [QGVAR(IsPlayerControlled), false]}) // return
|
|| {_unit getVariable [QGVAR(IsPlayerControlled), false]}) // return
|
||||||
|
@ -23,7 +23,7 @@ if (!hasInterface) exitWith {};
|
|||||||
|
|
||||||
if (!XGVAR(lowerInVehicles)) exitWith {};
|
if (!XGVAR(lowerInVehicles)) exitWith {};
|
||||||
|
|
||||||
if (vehicle _unit != _unit) then {
|
if (!isNull objectParent _unit) then {
|
||||||
call FUNC(lowerVolume);
|
call FUNC(lowerVolume);
|
||||||
} else {
|
} else {
|
||||||
call FUNC(restoreVolume);
|
call FUNC(restoreVolume);
|
||||||
|
@ -29,7 +29,7 @@ if (_activated && local _logic) then {
|
|||||||
case (isnull _unit): {_error = localize "str_a3_BIS_fnc_showCuratorFeedbackMessage_506";};
|
case (isnull _unit): {_error = localize "str_a3_BIS_fnc_showCuratorFeedbackMessage_506";};
|
||||||
case !(alive _unit): {_error = localize "str_a3_BIS_fnc_moduleArsenal_errorDead";};
|
case !(alive _unit): {_error = localize "str_a3_BIS_fnc_moduleArsenal_errorDead";};
|
||||||
case (isnull group _unit || !(side group _unit in [east,west,resistance,civilian])): {_error = localize "str_a3_BIS_fnc_moduleArsenal_errorBrain";};
|
case (isnull group _unit || !(side group _unit in [east,west,resistance,civilian])): {_error = localize "str_a3_BIS_fnc_moduleArsenal_errorBrain";};
|
||||||
case (vehicle _unit != _unit || effectivecommander _unit != _unit): {_error = localize "str_a3_BIS_fnc_moduleArsenal_errorVehicle";};
|
case (!isNull objectParent _unit || effectivecommander _unit != _unit): {_error = localize "str_a3_BIS_fnc_moduleArsenal_errorVehicle";};
|
||||||
};
|
};
|
||||||
|
|
||||||
if (_error == "") then {
|
if (_error == "") then {
|
||||||
|
Loading…
Reference in New Issue
Block a user