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

Wire cutter - Allow use when unit has RHS Engineer UMBTS backpack #6462

Merged
merged 2 commits into from
Jul 27, 2018
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ if !(_unit call EFUNC(common,isSwimming)) then {

!isNull _fence
&& {damage _fence < 1}
&& {"ACE_wirecutter" in ([_player, false, true, true, true, false] call CBA_fnc_uniqueUnitItems)}
&& {HAS_WIRECUTTER(_player)}
},
["isNotSwimming"]
] call EFUNC(common,progressBar);
Expand Down
4 changes: 2 additions & 2 deletions addons/logistics_wirecutter/functions/fnc_interactEH.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ params ["_interactionType"];
if (
_interactionType != 0
|| {vehicle ACE_player != ACE_player}
|| {!("ACE_wirecutter" in ([ACE_player, false, true, true, true, false] call CBA_fnc_uniqueUnitItems))}
|| {!HAS_WIRECUTTER(ACE_player)}
) exitWith {};

TRACE_1("Starting wirecuter interact PFH",_interactionType);
Expand Down Expand Up @@ -53,7 +53,7 @@ TRACE_1("Starting wirecuter interact PFH",_interactionType);

!isNull _attachedFence
&& {damage _attachedFence < 1}
&& {"ACE_wirecutter" in ([_player, false, true, true, true, false] call CBA_fnc_uniqueUnitItems)}
&& {HAS_WIRECUTTER(_player)}
&& {[_player, _attachedFence, ["isNotSwimming"]] call EFUNC(common,canInteractWith)}
&& {
// Custom LOS check for fence
Expand Down
5 changes: 5 additions & 0 deletions addons/logistics_wirecutter/script_component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,8 @@
#define SOUND_CLIP_TIME_SPACING 1.5
#define CUT_TIME_DEFAULT 11
#define CUT_TIME_ENGINEER 7.5

#define HAS_WIRECUTTER(unit) (\
"ACE_wirecutter" in ([ARR_6(unit, false, true, true, true, false)] call CBA_fnc_uniqueUnitItems) \
|| {backpack unit isKindOf "rhs_assault_umbts_engineer"} \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Backpacks that inherit from this are not guaranteed to have a model with a wirecutter on it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather see something config based like
1 == getNumber (configFile >> "CfgVehicles" >> (backpack unit) >> QGVAR(hasWirecutter))
instead of hard coded classes

Copy link
Contributor Author

@Dystopian Dystopian Jul 22, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dedmen Yes. Right now there are 3 backpacks with this model. I decided not to check model in backpack config (which can also be changed in any RHS update) but just check inheritance. I think it is enough for now. If you insist I'll change the check.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PabstMirror I would implement it if there was at least very small probability for other such backpacks.

)