From ac1e2eb5de75543f95481c89f6275a25b19fc12a Mon Sep 17 00:00:00 2001 From: Drofseh Date: Fri, 31 May 2024 09:14:05 -0700 Subject: [PATCH] Apply suggestions from code review Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --- addons/cargo/XEH_postInit.sqf | 2 +- addons/cargo/functions/fnc_handleDestroyed.sqf | 4 +--- addons/cargo/functions/fnc_unloadItem.sqf | 2 +- addons/cargo/stringtable.xml | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/addons/cargo/XEH_postInit.sqf b/addons/cargo/XEH_postInit.sqf index b58e967de5..21f4db3a12 100644 --- a/addons/cargo/XEH_postInit.sqf +++ b/addons/cargo/XEH_postInit.sqf @@ -39,7 +39,7 @@ [QGVAR(unloadedCargoOnKilled), { params ["_item", "_vehicle"]; private _velocity = velocity _vehicle apply {_x / CARGO_TUMBLE_VELOCITY_DIVISOR}; - private _torque = _vehicle vectorModelToWorld [random CARGO_TUMBLE_TORQUE,0,0]; + private _torque = _vehicle vectorModelToWorld [random CARGO_TUMBLE_TORQUE, 0, 0]; _item setVelocity _velocity; _item addTorque _torque; diff --git a/addons/cargo/functions/fnc_handleDestroyed.sqf b/addons/cargo/functions/fnc_handleDestroyed.sqf index 906e04a3a3..c93b461d2e 100644 --- a/addons/cargo/functions/fnc_handleDestroyed.sqf +++ b/addons/cargo/functions/fnc_handleDestroyed.sqf @@ -19,9 +19,7 @@ params ["_object"]; -private _killed = false; - -if (count _this > 1) then {_killed = true}; // The Killed event has 4 params. The Deleted event only has 1 param. +private _killed = count _this > 1; // The Killed event has 4 params. The Deleted event only has 1 param. private _loaded = _object getVariable [QGVAR(loaded), []]; diff --git a/addons/cargo/functions/fnc_unloadItem.sqf b/addons/cargo/functions/fnc_unloadItem.sqf index ac79b895ac..652560be0a 100644 --- a/addons/cargo/functions/fnc_unloadItem.sqf +++ b/addons/cargo/functions/fnc_unloadItem.sqf @@ -10,7 +10,7 @@ * 3: Deploy parameters (default: []) * - 0: Position AGL * - 1: Direction - * 4: Unload only if stable (default: true) (Applies only if arguemnt 3 is default) + * 4: Unload only if stable (default: true) (Applies only if argument 3 is []) * * Return Value: * Object unloaded diff --git a/addons/cargo/stringtable.xml b/addons/cargo/stringtable.xml index 1590a15c8c..1b05c8eb30 100644 --- a/addons/cargo/stringtable.xml +++ b/addons/cargo/stringtable.xml @@ -502,7 +502,7 @@ Unload Cargo On Killed - The chance for each cargo loaded into a vehicle to be unloaded if the vehicle is killed. [Only Objects] + The chance for each cargo loaded into a vehicle to be unloaded if the vehicle is killed.\nApplies to objects only. Load Time Coefficient