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

Map - Use SlotItemChanged event #9961

Merged
merged 6 commits into from
Oct 15, 2024
Merged
Changes from all commits
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
21 changes: 14 additions & 7 deletions addons/map/XEH_postInitClient.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,22 @@ GVAR(flashlights) = createHashMap;
// hide clock on map if player has no watch
GVAR(hasWatch) = true;

["loadout", {
params ["_unit"];
if (isNull _unit) exitWith {
[QGVAR(slotItemChanged), "SlotItemChanged", {
params ["", "_item", "_slot", "_assign"];

if (_slot != TYPE_WATCH) exitWith {};

GVAR(hasWatch) = _assign && {_item isKindOf ["ItemWatch", configFile >> "CfgWeapons"]};
}] call CBA_fnc_addBISPlayerEventHandler;

["unit", {
params ["_newPlayer"];

if (isNull _newPlayer) exitWith {
johnb432 marked this conversation as resolved.
Show resolved Hide resolved
GVAR(hasWatch) = true;
};
GVAR(hasWatch) = false;
{
if (_x isKindOf ["ItemWatch", configFile >> "CfgWeapons"]) exitWith {GVAR(hasWatch) = true;};
} forEach (assignedItems _unit);

GVAR(hasWatch) = (_newPlayer getSlotItemName TYPE_WATCH) isKindOf ["ItemWatch", configFile >> "CfgWeapons"];
}, true] call CBA_fnc_addPlayerEventHandler;


Expand Down
Loading