Skip to content

Commit

Permalink
Merge pull request #1701 from CBATeam/hemttLint
Browse files Browse the repository at this point in the history
Common - Use `objectParent` for vehicle detection (HEMTT L-S18)
  • Loading branch information
PabstMirror authored Nov 10, 2024
2 parents f592bff + b5d6c0b commit d2c0e07
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .hemtt/lints.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@
options.ignore = [
"addPublicVariableEventHandler", # Alt syntax is broken, we are using main syntax
]

[sqf.var_all_caps]
options.ignore = [
"SLX_*"
]
2 changes: 1 addition & 1 deletion addons/common/fnc_canUseWeapon.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ SCRIPT(canUseWeapon);

params [["_unit", objNull, [objNull]]];

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

private _config = configFile >> "CfgMovesMaleSdr" >> "States" >> animationState _unit;

Expand Down
2 changes: 1 addition & 1 deletion addons/common/fnc_deleteEntity.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ switch (typeName _entity) do {
} forEach _entity;
};
case "OBJECT" : {
if (vehicle _entity != _entity) then {
if (!isNull objectParent _entity) then {
unassignVehicle _entity;
_entity setPosASL [0,0,0];
} else {
Expand Down
2 changes: 1 addition & 1 deletion addons/common/fnc_getUnitAnim.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ private _anim = toArray(toLower(animationState _unit));
private _upos = "unknown";
private _umov = "stop";

if (vehicle _unit!= _unit) then {
if (!isNull objectParent _unit) then {
_upos = "vehicle";
} else {
if (count _anim < 12) exitWith {};
Expand Down
2 changes: 1 addition & 1 deletion addons/common/fnc_getUnitDeathAnim.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ private _deathAnim = "";
private _curAnim = (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState _unit));

if (isText (_curAnim >> "actions")) then {
if (vehicle _unit == _unit) then {
if (isNull objectParent _unit) then {
private _deathAnimCfg = (configFile >> "CfgMovesBasic" >> "Actions" >> (getText (_curAnim >> "actions")) >> "die");
if (isText _deathAnimCfg) then {
_deathAnim = getText _deathAnimCfg;
Expand Down

0 comments on commit d2c0e07

Please sign in to comment.