Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CBA_fnc_canAddItem #1330

Merged
merged 9 commits into from
Oct 10, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions addons/common/fnc_canAddItem.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -100,27 +100,36 @@ if (
_checkUniform
&& {TYPE_UNIFORM in _allowedSlots}
&& {
// each time subtract whole number of items which can be put in container
_count = _count - floor (getContainerMaxLoad uniform _unit * (1 - loadUniform _unit) / _mass);
_count <= 0
_mass == 0
|| {
// each time subtract whole number of items which can be put in container
_count = _count - floor (getContainerMaxLoad uniform _unit * (1 - loadUniform _unit) / _mass);
_count <= 0
}
}
) exitWith {true};

if (
_checkVest
&& {TYPE_VEST in _allowedSlots}
&& {
_count = _count - floor (getContainerMaxLoad vest _unit * (1 - loadVest _unit) / _mass);
_count <= 0
_mass == 0
|| {
_count = _count - floor (getContainerMaxLoad vest _unit * (1 - loadVest _unit) / _mass);
_count <= 0
}
}
) exitWith {true};

if (
_checkBackpack
&& {TYPE_BACKPACK in _allowedSlots}
&& {
_count = _count - floor (getContainerMaxLoad backpack _unit * (1 - loadBackpack _unit) / _mass);
_count <= 0
_mass == 0
|| {
_count = _count - floor (getContainerMaxLoad backpack _unit * (1 - loadBackpack _unit) / _mass);
_count <= 0
}
commy2 marked this conversation as resolved.
Show resolved Hide resolved
}
) exitWith {true};

Expand Down