MEDIUM severity: The `_killWoundedAgents` function in the Infiltration contract is vulnerable to a logic error. The f. The `_killWoundedAgents` function in the Infiltration contract is vulnerable to a logic error. The function only checks the current status of the agent, not when it was wounded. This means that agents who were wounded and then healed in a previous round can still be killed in the current round, even...

Vulnerable code:
```\nfunction _killWoundedAgents(\n    uint256 roundId,\n    uint256 currentRoundAgentsAlive\n) private returns (uint256 deadAgentsCount) {\n    for (uint256 i = 0; i < woundedAgentIdsCount; i++) {\n        uint256 woundedAgentId = woundedAgentIdsInRound[i + 1];\n\n        uint256 index = agentIndex(woundedAgentId);\n        if (agents[index].status == AgentStatus.Wounded) {\n            // rest of code\n        }\n    }\n\n    emit Killed(roundId, woundedAgentIds);\n}\n```\n```\nif (activeAgents > NUMBER_OF_SECONDARY_PRIZE_POOL_WINNERS) {\n    uint256 woundedAgents = _woundRequestFulfilled(\n        currentRoundId,\n        currentRoundAgentsAlive,\n        activeAgents,\n        currentRandomWord\n    );\n\n    uint256 deadAgentsFromKilling;\n    if (currentRoundId > ROUNDS_TO_BE_WOUNDED_BEFORE_DEAD) {\n        deadAgentsFromKilling = _killWoundedAgents({\n            roundId: currentRoundId.sub(ROUNDS_TO_BE_WOUNDED_BEFORE_DEAD),\n            currentRoundAgentsAlive: currentRoundAgentsAlive\n        });\n    }\n}\n```\n```\nfunction test_poc() public {\n\n    _startGameAndDrawOneRound();\n\n    uint256[] memory randomWords = _randomWords();\n    uint256[] memory woundedAgentIds;\n\n    for (uint256 roundId = 2; roundId <= ROUNDS_TO_BE_WOUNDED_BEFORE_DEAD + 1; roundId++) {\n        if (roundId == 2) {\n            (woundedAgentIds, ) = infiltration.getRoundInfo({roundId: 1});\n            assertEq(woundedAgentIds.length, 20);\n\n            _drawXRounds(1);\n\n            _heal({roundId: 3, woundedAgentIds: woundedAgentIds});\n\n            _startNewRound();\n\n            uint256 agentIdThatWasKilled = woundedAgentIds[0];\n\n            IInfiltration.HealResult[] memory healResults = new IInfiltration.HealResult[](20);\n            for (uint256 i = 0; i < 20; i++) {\n                healResults[i].agentId = woundedAgentIds[i];\n\n                if (woundedAgentIds[i] == agentIdThatWasKilled) {\n                    healResults[i].outcome = IInfiltration.HealOutcome.Killed;\n                } else {\n                    healResults[i].outcome = IInfiltration.HealOutcome.Healed;\n                }\n            }\n\n            expectEmitCheckAll();\n            emit HealRequestFulfilled(3, healResults);\n\n            expectEmitCheckAll();\n            emit RoundStarted(4);\n\n            randomWords[0] = (69 * 10_000_000_000) + 9_900_000_000; // survival rate 99%, first one gets killed\n\n            vm.prank(VRF_COORDINATOR);\n            VRFConsumerBaseV2(address(infiltration)).rawFulfillRandomWords(_computeVrfRequestId(3), randomWords);\n\n            for (uint256 i = 0; i < woundedAgentIds.length; i++) {\n                if (woundedAgentIds[i]!= agentIdThatWasKilled) {\n                    _assertHealedAgent(woundedAgentIds[i]);\n                }\n            }\n\n            roundId += 2; // round 2, 3 used for healing\n        }\n\n        _startNewRound();\n\n        randomWords[0] += roundId;\n\n        if (roundId == ROUNDS_TO_BE_WOUNDED_BEFORE_DEAD + 1) {\n            (uint256[] memory woundedAgentIdsFromRound, ) = infiltration.getRound\n```