From b3a3db550e86e586c811eac98079946560af52b3 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 de262bdcfb5..d5c7925a6fa 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