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

Medical Engine - Ignore Reflector Hitpoints #9131

Merged
merged 1 commit into from
Jun 27, 2023
Merged

Medical Engine - Ignore Reflector Hitpoints #9131

merged 1 commit into from
Jun 27, 2023

Conversation

PabstMirror
Copy link
Contributor

Issue:

class class CAManBase: Man {
  class Reflectors {
      class CustomLight_1 {
          hitpoint         = "Light";

will cause

getAllHitPointsDamage player param [0, []]; ->
[..."hitrightleg","ace_hdbracket","#light"]

and break medical completely, this pr should at least allow medical to add the EH and the results seem normal
But I'm not really sure if this is a good fix, I don't have much experience working with class Reflectors

@PabstMirror
Copy link
Contributor Author

@commy2 - any thoughts on this?
adding to class reflectiors and it will still pass the \dev\test_hitpointConfigs.sqf test because hd_bracket is the last class hitpoint but just not the last entry in getAllHitPointsDamage

humans don't have lights built into them so I don't really get why this is being done...
but I think this PR will allow ace to be compatible
without this fix the handleDamage never gets added and it breaks completely

@PabstMirror PabstMirror added this to the 3.16.0 milestone Jan 28, 2023
@PabstMirror PabstMirror added the kind/bug-fix Release Notes: **FIXED:** label Jan 28, 2023
@commy2
Copy link
Contributor

commy2 commented Mar 17, 2023

Why not use ARR select CODE instead of while deleteAt?

@@ -13,6 +13,7 @@
// Check if last hit point is our dummy.
private _allHitPoints = getAllHitPointsDamage _unit param [0, []];
reverse _allHitPoints;
while {(_allHitPoints param [0, ""]) select [0,1] == "#"} do { WARNING_1("Ignoring Reflector hitpoint %1", _allHitPoints deleteAt 0); };
Copy link
Contributor

Choose a reason for hiding this comment

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

Only downside to using select is not logging directly, but this isn't performance critical.

@LinkIsGrim LinkIsGrim merged commit 4f0577c into master Jun 27, 2023
@jonpas jonpas deleted the idunno branch June 27, 2023 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug-fix Release Notes: **FIXED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants