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

fixed cf recognizing "Ground" as inventory #608

Merged
merged 2 commits into from
May 11, 2019
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
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
File: fn_cratefiller_getNearStorages.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2019-04-06
Last Update: 2019-05-04
Last Update: 2019-05-05
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Public: No

Expand All @@ -30,44 +30,40 @@ lbClear _ctrlStorage;
private _nearFOB = [] call KPLIB_fnc_common_getPlayerFob;
private _type = objNull;
private _config = "";
private _number= 0;
private _number = 0;
private _index = 0;
private _picture = "";
private _storages = [];
private _blacklist = [
KPLIB_preset_crateSupplyE,
KPLIB_preset_crateSupplyF,
KPLIB_preset_crateAmmoE,
KPLIB_preset_crateAmmoF,
KPLIB_preset_crateFuelE,
KPLIB_preset_crateFuelF,
KPLIB_logistic_building
KPLIB_logistic_building,
"GroundWeaponHolder",
"WeaponHolderSimulated",
"#slop",
"#track",
Dubjunk marked this conversation as resolved.
Show resolved Hide resolved
""
];

// Get near objects and check for storage capacity
{
_type = typeOf _x;
if (_type != "GroundWeaponHolder") then {
_config = [_type] call KPLIB_fnc_cratefiller_getConfigPath;
_number = getNumber (_config >> "maximumLoad");
if (_number > 0) then {
_storages pushBack _x;
_config = [_type] call KPLIB_fnc_cratefiller_getConfigPath;
_number = getNumber (_config >> "maximumLoad");
// If the object has an inventory add it to the list
if (_number > 0) then {
_index = _ctrlStorage lbAdd format ["%1m - %2", round ((getMarkerPos _nearFOB) distance2D _x), getText (_config >> "displayName")];
_ctrlStorage lbSetData [_index, netId _x];
_picture = getText (_config >> "picture");
if (_picture isEqualTo "pictureThing") then {
_ctrlStorage lbSetPicture [_index, "KPGUI\res\icon_help.paa"];
} else {
_ctrlStorage lbSetPicture [_index, _picture];
};
};
} forEach (((getMarkerPos _nearFOB) nearObjects KPLIB_param_fobRange) select {!(typeOf _x in _blacklist)});

// Fill the list
{
_type = typeOf _x;
_config = [_type] call KPLIB_fnc_cratefiller_getConfigPath;
_index = _ctrlStorage lbAdd format ["%1m - %2", round ((getMarkerPos _nearFOB) distance2D _x), getText (_config >> "displayName")];
_ctrlStorage lbSetData [_index, netId _x];
_picture = getText (_config >> "picture");
if (_picture isEqualTo "pictureThing") then {
_ctrlStorage lbSetPicture [_index, "KPGUI\res\icon_help.paa"];
} else {
_ctrlStorage lbSetPicture [_index, _picture];
};
} forEach _storages;

true