Skip to content
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

Cleanup medical PFHs #3462

Merged
merged 12 commits into from
May 14, 2016
Merged

Cleanup medical PFHs #3462

merged 12 commits into from
May 14, 2016

Conversation

nicolasbadano
Copy link
Contributor

My plan is to take a look at all the pfh loops in medical, comment them and clean them up. For those with long intervals, switch addPerFrameHandler for waitAndExecute.

I'll also try collapsing all the loops that handle the evolution of treatments into the vitalLoop, for better performance, clarity and locality handling.

  • addToInjuredCollection -> vitalLoop
  • treatmentTourniquetLocal -> vitalLoop
  • onMedicationUsage -> medicationEffectLoop
  • handleCreateLitter -> litterCleanupLoop
  • serverRemoveBody -> bodyCleanupLoop
  • setDead -> reviveStateLoop

unconsciousPFH

Changes:

  • Rename and add comments to the function that tracks the units vital loop. Make it use waitAndExecute instead of a pfh for better performance.
  • Move the tourniquet loop to handleUnitVitals. Makes the tourniquet pain compatible with swapping localities.
  • Fix pain not being able to decrease naturally when above 10
  • Move to a function and comments the code that tracks the effects of medications over time. Make it use waitAndExecute instead of a pfh for better performance.
  • Move to a function and comments the code that tracks units in revive state. Make it use waitAndExecute instead of a pfh for better performance.
  • Move to a function the code that cleans up litter. Make it use waitAndExecute instead of a pfh for better performance.
  • Move to a function the code that cleans up dead bodies. Make it use waitAndExecute instead of a pfh for better performance.

…oop. Use waitAndExecute instead of a pfh for better performance.
@nicolasbadano nicolasbadano added status/WIP kind/cleanup Release Notes: **CHANGED:** kind/optimization Release Notes: **IMPROVED:** labels Feb 28, 2016
@nicolasbadano nicolasbadano added this to the 3.5.1 milestone Feb 28, 2016
@nicolasbadano nicolasbadano changed the title Rename and add comments to the function that tracks the units vital l… Cleanup medical PFHs Mar 1, 2016
@nicolasbadano nicolasbadano modified the milestones: 3.6.0, 3.5.1 Mar 6, 2016
@thojkooi
Copy link
Contributor

thojkooi commented May 8, 2016

I am happy with this 👍

@thojkooi thojkooi merged commit 180a0f9 into master May 14, 2016
@thojkooi thojkooi deleted the medicalLoops branch May 14, 2016 07:39
@commy2
Copy link
Contributor

commy2 commented May 14, 2016

Now I get this when starting the game:

10:14:32 Error in expression <iveStateLoop.sqf"


params ["_unit"]



if (!local _unit) exitWith {};

private >
10:14:32   Error position: <if (!local _unit) exitWith {};

private >
10:14:32   Error Missing ;
10:14:32 File z\ace\addons\medical\functions\fnc_reviveStateLoop.sqf, line 9

@thojkooi thojkooi restored the medicalLoops branch May 14, 2016 08:35
@thojkooi thojkooi deleted the medicalLoops branch May 14, 2016 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/cleanup Release Notes: **CHANGED:** kind/optimization Release Notes: **IMPROVED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants