Skip to content

Pharmacy - Coagulation bug #801

Description

@kolmipilot

Coagulation does not work for players if the Allow clotting for AI setting is disabled.

How to reproduce:

  1. In the settings, disable Allow clotting for AI and disable Coagulation.
  2. 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})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions