-
Notifications
You must be signed in to change notification settings - Fork 737
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 - Improve adjustment calcs / wound blood loss / medications #6910
Conversation
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.
If I understood this correctly, pain decreases over time no matter what. I tend to agree with: #5511
addons/medical_status/functions/fnc_addPainSuppressionAdjustment.sqf
Outdated
Show resolved
Hide resolved
@@ -53,7 +53,7 @@ if (_hemorrhage != GET_HEMORRHAGE(_unit)) then { | |||
|
|||
private _bloodLoss = GET_BLOOD_LOSS(_unit); | |||
if (_bloodLoss > 0) then { | |||
_unit setVariable [QGVAR(bloodloss), _bloodLoss, _syncValues]; | |||
_unit setVariable [QGVAR(bloodloss), _bloodLoss, _syncValues]; // ToDo: nothing uses this, remove? |
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.
Maybe it should be used to enter unconscious state due to blood loss?
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.
#define GET_BLOOD_LOSS(unit) ([unit] call EFUNC(medical_status,getBloodLoss))
that function has fairly complex calcs, and is called in 10 different places
so maybe we could swap it to use the setVar
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.
I remember this is something I noticed way back too. If I remember right, I determined that that function was probably intended for the vitals loop only and everywhere else was probably meant to be reading the variable.
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 7a87aad
We can calculate wound blood loss only on events that would change it
This PR now also reworks the medication system vars Array isn't modified unless a medication is added or falls off, so there should be less syncing overall Reimplents overdose ( |
Before: ace_medical_vitals_Vitals_counter: Average: 0.652908s / 2696 = 0.242177ms |
fix func descriptions Calc wound blood loss on events reorder includes so scritpmacroMed has global effect trivial optimization for getCardiacOutput Fix var Fix wounds not reopening (nil _category) Fix surgical kit inherting canBandage conditional debug hitpoints Update ACE_Medical_Treatment_Actions.hpp Use woundBleeding for IS_BLEEDING macro rework medication vars comments Reset var in init / fullHeal Update addons/medical_treatment/functions/fnc_onMedicationUsage.sqf Co-Authored-By: PabstMirror <pabstmirror@gmail.com>
Co-Authored-By: PabstMirror <pabstmirror@gmail.com>
…6910) * Improve adjustment calcs / wound blood loss / medications fix func descriptions Calc wound blood loss on events reorder includes so scritpmacroMed has global effect trivial optimization for getCardiacOutput Fix var Fix wounds not reopening (nil _category) Fix surgical kit inherting canBandage conditional debug hitpoints Update ACE_Medical_Treatment_Actions.hpp Use woundBleeding for IS_BLEEDING macro rework medication vars comments Reset var in init / fullHeal Update addons/medical_treatment/functions/fnc_onMedicationUsage.sqf Co-Authored-By: PabstMirror <pabstmirror@gmail.com> * Update addons/medical_treatment/functions/fnc_onMedicationUsage.sqf Co-Authored-By: PabstMirror <pabstmirror@gmail.com>
Fix pain not reducing over time (
_unit setVariable [QEGVAR(medical_status,pain)
)Add helper funcs for adding adjustments
lets us skip
if (_value != 0 && {_maxTimeInSystem > 0}) then {
checking each run, also skip amax
fix removal from arrays, as nil didn't work
Edit:
this PR also
Adds
GET_WOUND_BLEEDING
getVar,On any change in wound bleeding (openWound or tourniquite change), we update that var.
This improves the speed of
GET_BLOOD_LOSS
functionIt also prevents
isBleeding
from switching to false when entering cardiac arrest.ToDo: merge into medical_ai PR
moves
#include "\z\ace\addons\medical_engine\script_macros_medical.hpp"
up, so we can use debug macros in medical_engine instead of changing them in 11 different modules