Skip to content

Medical Damage - Improve minimum damage thresholds to prevent divide by zero errors#11038

Closed
Cplhardcore wants to merge 8 commits intoacemod:masterfrom
Cplhardcore:master
Closed

Medical Damage - Improve minimum damage thresholds to prevent divide by zero errors#11038
Cplhardcore wants to merge 8 commits intoacemod:masterfrom
Cplhardcore:master

Conversation

@Cplhardcore
Copy link
Copy Markdown
Contributor

When merged this pull request will:

  • Make it no longer possible to move damage thresholds to 0, to prevent division by 0

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}.

@LinkIsGrim
Copy link
Copy Markdown
Member

Don't we have handling for this somewhere?

@PabstMirror
Copy link
Copy Markdown
Contributor

updateBodyImage does 0.01 max _damageThreshold
I couldn't reproduce a div0 with the setting at 0, what module does it happen in?

@Cplhardcore
Copy link
Copy Markdown
Contributor Author

updateBodyImage does 0.01 max _damageThreshold I couldn't reproduce a div0 with the setting at 0, what module does it happen in?

Update injury list with trauma sustained turned on

@Cplhardcore
Copy link
Copy Markdown
Contributor Author

updateBodyImage does 0.01 max _damageThreshold I couldn't reproduce a div0 with the setting at 0, what module does it happen in?

Update injury list with trauma sustained turned on

More specifically, line 192

@PabstMirror
Copy link
Copy Markdown
Contributor

https://github.com/acemod/ACE3/blob/master/addons/medical_gui/functions/fnc_updateInjuryList.sqf#L192
We could just change the line to _bodyPartDamage = (_bodyPartDamage / (_damageThreshold max 0.01)) min 1;

I feel like this might be safer as we are just touching medical_gui
and this should prevent any problems with invalidating old settings

@PabstMirror
Copy link
Copy Markdown
Contributor

fixed via #11065

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