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

Interaction - Add crew status check for some vehicle interactions #9637

Merged
merged 3 commits into from
Nov 11, 2023

Conversation

johnb432
Copy link
Contributor

When merged this pull request will:

  • If one or more passengers in a vehicle are conscious, not captive and hostile to the interacting unit, interactions such as ACE passenger and cargo actions will not appear.
  • Updated FUNC(addPassengerActions). Using objectParent instead of vehicle.
  • Addresses Interaction - Allow pulling bodies out of wrecks #9618 (comment).

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

  • If the contribution affects the documentation, please include your changes in this pull request so the documentation will appear on the website.
  • Development Guidelines are read, understood and applied.
  • Title of this PR uses our standard template Component - Add|Fix|Improve|Change|Make|Remove {changes}.

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.
@LinkIsGrim
Copy link
Contributor

Haven't tested yet. How does this work with empty vehicles?

@johnb432
Copy link
Contributor Author

Haven't tested yet. How does this work with empty vehicles?

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}
Copy link
Contributor

@LinkIsGrim LinkIsGrim Nov 11, 2023

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

Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed.

Copy link
Contributor

@LinkIsGrim LinkIsGrim left a 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.

@LinkIsGrim LinkIsGrim added the kind/enhancement Release Notes: **IMPROVED:** label Nov 11, 2023
@LinkIsGrim LinkIsGrim added this to the 3.16.2 milestone Nov 11, 2023
@LinkIsGrim LinkIsGrim merged commit cf8c847 into master Nov 11, 2023
5 checks passed
@jonpas jonpas deleted the unload-patient-fix branch November 11, 2023 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Release Notes: **IMPROVED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants