Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

General - Convert vehicle to objectParent #9801

Merged
merged 1 commit into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion addons/advanced_throwing/functions/fnc_canThrow.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ params ["_unit"];

if !(_unit getVariable [QGVAR(inHand), false]) exitWith {false};

if (vehicle _unit != _unit) exitWith {
if (!isNull objectParent _unit) exitWith {
private _startPos = eyePos _unit;
private _aimLinePos = AGLToASL (positionCameraToWorld [0, 0, 1]);
private _intersections = lineIntersectsSurfaces [_startPos, _aimLinePos, _unit, objNull, false];
Expand Down
2 changes: 1 addition & 1 deletion addons/advanced_throwing/functions/fnc_throw.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ if (!(_unit getVariable [QGVAR(primed), false])) then {
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
if (vehicle _unit != _unit) then {
if (!isNull objectParent _unit) then {
_newVelocity = _newVelocity vectorAdd (velocity (vehicle _unit));
};

Expand Down
2 changes: 1 addition & 1 deletion addons/captives/functions/fnc_handleOnUnconscious.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if (_isUnconc) then {
};
} else {
//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, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation);
};
Expand Down
2 changes: 1 addition & 1 deletion addons/common/functions/fnc_fixLoweredRifleAnimation.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@

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);
};
2 changes: 1 addition & 1 deletion addons/common/functions/fnc_getDeathAnim.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ private _unitActionsCfg = configFile >> "CfgMovesBasic" >> "Actions" >> getText

TRACE_2("Animation/Action",configName _unitAnimationCfg,configName _unitActionsCfg);

if (vehicle _unit != _unit) then {
if (!isNull objectParent _unit) then {
private _interpolateArray = getArray (_unitAnimationCfg >> "interpolateTo");

for "_index" from 0 to (count _interpolateArray - 1) step 2 do {
Expand Down
2 changes: 1 addition & 1 deletion addons/common/functions/fnc_goKneeling.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
params ["_unit"];

// 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,
Expand Down
2 changes: 1 addition & 1 deletion addons/dragging/functions/fnc_dropObject_carry.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ if (_tryLoad && {!(_target isKindOf "CAManBase")} && {["ace_cargo"] call EFUNC(c

// Fix anim when aborting carrying persons
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);
};

Expand Down
2 changes: 1 addition & 1 deletion addons/explosives/functions/fnc_canDefuse.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if (isNull _explosive) exitWith {
deleteVehicle _target;
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};

Expand Down
2 changes: 1 addition & 1 deletion addons/fastroping/functions/fnc_fastRopeLocalPFH.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ _arguments params ["_unit", "", "_rope", "", "_timeToPlayRopeSound"];
_rope params ["", "", "", "_dummy", "_hook"];

//Wait until the unit is actually outside of the helicopter
if (vehicle _unit != _unit) exitWith {};
if (!isNull objectParent _unit) exitWith {};

// dummy lost hook
if (isNull _hook) exitWith {
Expand Down
2 changes: 1 addition & 1 deletion addons/fastroping/functions/fnc_fastRopeServerPFH.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ _arguments params ["_unit", "_vehicle", "_rope", "_ropeIndex", "_hasBeenAttached
_rope params ["_attachmentPoint", "_ropeTop", "_ropeBottom", "_dummy", "_hook"];

//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
if (isNull _hook) exitWith {
Expand Down
2 changes: 1 addition & 1 deletion addons/goggles/functions/fnc_applyRainEffect.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ if (!alive _unit) exitWith {};
private _fnc_underCover = {
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
private _position = eyePos _unit;
Expand Down
2 changes: 1 addition & 1 deletion addons/goggles/functions/fnc_applyRotorWashEffect.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if (!alive _unit) exitWith {};
GVAR(FrameEvent) set [0, !(GVAR(FrameEvent) select 0)];

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];
};

Expand Down
2 changes: 1 addition & 1 deletion addons/medical_ai/functions/fnc_playTreatmentAnim.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
params ["_unit", "_actionName", "_isSelfTreatment"];
TRACE_3("playTreatmentAnim",_unit,_actionName,_isSelfTreatment);

if (vehicle _unit != _unit) exitWith {};
if (!isNull objectParent _unit) exitWith {};

private _configProperty = "animationMedic";
if (_isSelfTreatment) then {
Expand Down
2 changes: 1 addition & 1 deletion addons/medical_blood/functions/fnc_handleWoundReceived.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ if (_damageType in GVAR(noBloodDamageTypes)) exitWith {};
if (GVAR(enabledFor) == BLOOD_ONLY_PLAYERS && {!isPlayer _unit && {_unit != ACE_player}}) exitWith {};

// 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 {
random 360 // Cannot calculate the direction properly, pick a random direction
Expand Down
2 changes: 1 addition & 1 deletion addons/medical_blood/functions/fnc_onBleeding.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ params ["_unit"];
if !(_unit call FUNC(isBleeding)) exitWith {};

// 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 {
private _bloodLoss = (if (GVAR(useAceMedical)) then {GET_BLOOD_LOSS(_unit) * 2.5} else {getDammage _unit * 2}) min 6;
Expand Down
4 changes: 2 additions & 2 deletions addons/medical_engine/functions/fnc_setUnconsciousAnim.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ if (_isUnconscious) then {
};

// set animation inside vehicles
if (vehicle _unit != _unit) then {
if (!isNull objectParent _unit) then {
private _unconAnim = _unit call EFUNC(common,getDeathAnim);
TRACE_2("inVehicle - playing death anim",_unit,_unconAnim);
[_unit, _unconAnim] call EFUNC(common,doAnimation);
};
} else {
// reset animation inside vehicles
if (vehicle _unit != _unit) then {
if (!isNull objectParent _unit) then {
private _awakeAnim = _unit call EFUNC(common,getAwakeAnim);
TRACE_2("inVehicle - playing awake anim",_unit,_awakeAnim);
[_unit, _awakeAnim, 2] call EFUNC(common,doAnimation);
Expand Down
2 changes: 1 addition & 1 deletion addons/medical_feedback/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ GVAR(bloodTickCounter) = 0;

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
private _dummy = "#dynamicsound" createVehicleLocal [0, 0, 0];
_dummy attachTo [_unit, [0, 0, 0], "camera"];
Expand Down
2 changes: 1 addition & 1 deletion addons/nightvision/functions/fnc_onCameraViewChanged.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ TRACE_2("onCameraViewChanged",_unit,_cameraView);
call FUNC(refreshGoggleType);

if (GVAR(disableNVGsWithSights) && {(hmd _unit) != ""}) then {
if ((vehicle _unit == _unit)
if ((isNull objectParent _unit)
|| {isTurnedOut _unit}
|| {!([_unit] call EFUNC(common,hasHatch))
&& {[_unit] call EFUNC(common,getTurretIndex) in ([vehicle _unit] call EFUNC(common,getTurretsFFV))}
Expand Down
2 changes: 1 addition & 1 deletion addons/nightvision/functions/fnc_onVisionModeChanged.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ TRACE_2("onVisionModeChanged",_unit,_visionMode);

// Handle disableNVGsWithSights setting:
if (GVAR(disableNVGsWithSights) && {(hmd _unit) != ""}) then {
if ((vehicle _unit == _unit)
if ((isNull objectParent _unit)
|| {isTurnedOut _unit}
|| {!([_unit] call EFUNC(common,hasHatch))
&& {[_unit] call EFUNC(common,getTurretIndex) in ([vehicle _unit] call EFUNC(common,getTurretsFFV))}
Expand Down
2 changes: 1 addition & 1 deletion addons/scopes/functions/fnc_adjustZero.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

params ["_unit"];

if (vehicle _unit != _unit) exitWith {false};
if (!isNull objectParent _unit) exitWith {false};

private _weaponClass = currentWeapon _unit;
private _weaponIndex = [_unit, _weaponClass] call EFUNC(common,getWeaponIndex);
Expand Down
2 changes: 1 addition & 1 deletion addons/scopes/functions/fnc_canAdjustZero.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
params ["_unit"];

if (cameraView == "GUNNER") exitWith {false};
if (vehicle _unit != _unit) exitWith {false};
if (!isNull objectParent _unit) exitWith {false};
if (GVAR(simplifiedZeroing)) exitWith {false};
if (!(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false])) exitWith {false};

Expand Down
2 changes: 1 addition & 1 deletion addons/scopes/functions/fnc_canResetZero.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
params ["_unit"];

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};

private _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex);
Expand Down
2 changes: 1 addition & 1 deletion addons/scopes/functions/fnc_resetZero.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

params ["_unit"];

if (vehicle _unit != _unit) exitWith {false};
if (!isNull objectParent _unit) exitWith {false};

private _weaponClass = currentWeapon _unit;
private _weaponIndex = [_unit, _weaponClass] call EFUNC(common,getWeaponIndex);
Expand Down
2 changes: 1 addition & 1 deletion addons/switchunits/functions/fnc_isValidAi.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ params ["_unit"];

!([_unit] call EFUNC(common,isPlayer)
|| {_unit in playableUnits}
|| {vehicle _unit != _unit}
|| {!isNull objectParent _unit}
|| {_unit getVariable [QGVAR(IsPlayerUnit), false]}
|| {_unit getVariable [QGVAR(IsPlayerControlled), false]}) // return
2 changes: 1 addition & 1 deletion addons/volume/XEH_postInitClient.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if (!hasInterface) exitWith {};

if (!XGVAR(lowerInVehicles)) exitWith {};

if (vehicle _unit != _unit) then {
if (!isNull objectParent _unit) then {
call FUNC(lowerVolume);
} else {
call FUNC(restoreVolume);
Expand Down
2 changes: 1 addition & 1 deletion addons/zeus/functions/fnc_bi_moduleArsenal.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ if (_activated && local _logic) then {
case (isnull _unit): {_error = localize "str_a3_BIS_fnc_showCuratorFeedbackMessage_506";};
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 (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 {
Expand Down
Loading