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

Fix combat mode errors #294

Merged
merged 2 commits into from
Nov 13, 2021
Merged

Fix combat mode errors #294

merged 2 commits into from
Nov 13, 2021

Conversation

nk3nny
Copy link
Owner

@nk3nny nk3nny commented Oct 25, 2021

Fixes units becoming stuck in combat mode
Fixes units being triggered to enter combat/contact mode due to friendly fire

Implementation

  1. Changes the share information feature to trigger a more directly hiding.
  2. Prevents all tactics level actions from setting behaviour
  3. Small fix brain.sqf to "FIRE" and other immediate actions to sort friendly units*

*For a small sake of performance I'm not sorting for all friendly sides-- Instead I am focused only on units which are the same side as the shooter. Especially as it seems like allied sides trigger combat behaviour regardless.

Changes
This change will mean that units will be somewhat less immediately responsive to enemy fire -- but on the positive side, they'll actually reset when the threat is dealt with(!).

I also suspect this will fix some issues with transported troops dismounting at early times from transport vehicles. (i.e., they were sharing information with their drivers-- which triggered combat mode-- which triggered the driver to give the transported units combat mode-- which triggered them jumping out...

Yeah.

Fixes units becoming stuck in combat mode
Fixes units being triggered to enter combat/contact mode due to friendly fire

1. Changes the share information feature to trigger a more directly hiding.
2. Prevents all tactics level actions from setting behaviour
3. Small fix brain.sqf to "FIRE" and other immediate actions to sort friendly units*

*For a small sake of performance I'm not sorting for all friendly sides-- Instead I am focused only on units which are the same _side_ as the shooter.  Especially as it seems like allied sides trigger combat behaviour regardless.
@@ -88,7 +88,7 @@ if (_dangerCause isEqualTo DANGER_ASSESS) exitWith {

// immediate actions
if (_dangerCause in [DANGER_HIT, DANGER_BULLETCLOSE, DANGER_EXPLOSION, DANGER_FIRE]) exitWith {
_return set [ACTION_IMMEDIATE, true];
_return set [ACTION_IMMEDIATE, (side _group) isNotEqualTo side (group _dangerCausedBy)];
Copy link
Owner Author

Choose a reason for hiding this comment

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

I guess if we were really worried we could do:

!([side _group, side group _dangerCausedBy] call BIS_fnc_sideIsFriendly)

Not sure what the overall cost would be.

@jokoho48 jokoho48 added this to the 2.5.3 milestone Oct 26, 2021
@nk3nny nk3nny merged commit e488bd5 into master Nov 13, 2021
@nk3nny nk3nny deleted the Fix-combat-mode-errors branch November 13, 2021 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants