-
Notifications
You must be signed in to change notification settings - Fork 109
Description
Coagulation does not work for players if the Allow clotting for AI setting is disabled.
How to reproduce:
- In the settings, disable Allow clotting for AI and disable Coagulation.
- Shoot a player — no wound starts clotting.
Code-based problem:
The coagulation event handler is removed even if the unit is a player.
When I added this trace to the code:
if (!(GVAR(coagulation_allowOnAI)) && ACE_Player != _unit) exitWith { TRACE_1("ClotWound: Stopping per frame handler for unit %1", _unit); [_idPFH] call CBA_fnc_removePerFrameHandler; };
This trace appeared in the RPT file:
1:18:01 [KAT] (pharma) TRACE: 7169 ClotWound: Stopping per frame handler for unit %1: _unit=B Alpha 1-1:1 (kolmipilot) x\kat\addons\pharma\functions\fnc_clotWound.sqf:111
Full RPT: https://pastebin.com/j6uWr017
Base file: https://github.com/KAT-Advanced-Medical/KAM/blob/dev-Tomcat/addons/pharma/functions/fnc_clotWound.sqf
With ChatGPT’s help, changing the statement to this fixed the issue:
(!(GVAR(coagulation_allowOnAI)) && {!isPlayer _unit})