From 18ea360b1ea2403443da7f4cf00e55389cb0b34d Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Sat, 22 Jun 2024 17:18:28 +0200 Subject: [PATCH] Cargo - Add check for invoking `ace_cargoAdded` EH only if cargo was actually added (#10084) Only invoke cargoAdded EH if cargo was actually added --- addons/cargo/functions/fnc_addCargoItem.sqf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/cargo/functions/fnc_addCargoItem.sqf b/addons/cargo/functions/fnc_addCargoItem.sqf index de262bdcfb..d5c7925a6f 100644 --- a/addons/cargo/functions/fnc_addCargoItem.sqf +++ b/addons/cargo/functions/fnc_addCargoItem.sqf @@ -41,6 +41,8 @@ if (_item isEqualType "") then { TRACE_1("loaded",_loaded); // Invoke listenable event -["ace_cargoAdded", [_item, _vehicle, _loaded]] call CBA_fnc_globalEvent; +if (_loaded > 0) then { + ["ace_cargoAdded", [_item, _vehicle, _loaded]] call CBA_fnc_globalEvent; +}; _loaded // return