mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Refuel - Fix infinite recursion for getCapacity
on a non-CfgVehicle (#9622)
* Refuel - Fix infinite recursion for `getCapacity` checking a non-CfgVehicle Close #9620 * Update addons/refuel/functions/fnc_getCapacity.sqf
This commit is contained in:
parent
30ec1eda16
commit
2c5ef6a6ec
@ -29,6 +29,8 @@ if (isNil "_capacity") then {
|
||||
|
||||
// Set capacity even if this isn't a fuel source to save on config lookup time in the event this function is used in a loop
|
||||
_source setVariable [QGVAR(capacity), _capacity, true];
|
||||
// handle weird edge case when trying to run on "camera"/CfgNonAIVehicles which won't support setVariable and will inf-loop
|
||||
if (isNil {_source getVariable QGVAR(capacity)}) exitWith { WARNING_1("trying to getCapacity from non-CfgVehicle %1", _this); };
|
||||
[_source, _capacity] call FUNC(setFuel);
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user