-
Notifications
You must be signed in to change notification settings - Fork 740
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
Interaction - Add crew status check for some vehicle interactions #9637
Conversation
If a one or more passenger in a vehicle are conscious, not captive and hostile to the interacting unit, the interactions (passenger, cargo) will not appear.
Haven't tested yet. How does this work with empty vehicles? |
addons/interaction/functions/fnc_canInteractWithVehicleCrew.sqf
Outdated
Show resolved
Hide resolved
It works as expected. |
|
||
((crew _vehicle) select {_x != _player && {!unitIsUAV _x}}) findIf { // ignore player and UAV units | ||
// Units must all be unconscious, captive or friendly (side group is used in case unit is captive/unconscious) for actions to show up | ||
!captive _x && {lifeState _x in ["HEALTHY", "INJURED"]} && {[_sidePlayer, side group _x] call BIS_fnc_sideIsEnemy} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not exactly related but we should update common FUNC(isAwake)
to do this lifeState check instead, methinks. These are getting bad for readability
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally speaking, I think we should change _unit getVariable ["ACE_isUnconscious", false]
to lifeState
(or EFUNC(common,isAwake)
, if we update it as per your suggestion) wherever possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See early exit comment, but it's good as is.
When merged this pull request will:
FUNC(addPassengerActions)
. UsingobjectParent
instead ofvehicle
.I opted not to go with adding a condition for interacting via
EFUNC(common,addCanInteractWithCondition)
, as I don't want to impose this for all vehicle interactions.IMPORTANT
Component - Add|Fix|Improve|Change|Make|Remove {changes}
.