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

Make state change status updates consistent #6538

Merged
merged 1 commit into from
Aug 25, 2018

Conversation

kymckay
Copy link
Member

@kymckay kymckay commented Aug 17, 2018

State transitions now call their respective status update functions in the status component where unit variables and status are actually handled.

We don't actually need to use events here since the statemachine component depends on the status component. For public consumption we already raise an ace_unconscious and ace_cardiacArrest event within the status update functions (the latter I changed to make consistent with existing unconscious event so it fires for both entry and exit).

This PR also fixes an additional behaviour where on death a unit would become bloodied even if they weren't before (untested, but going by the setStructuralDamage function header that's what it's for).

I've also taken the chance to rename the setUnconsciousStatemachine function to simply setUnconscious since it resides in the status component and thus has the prefix to differentiate it from the public ace_medical_fnc_setUnconscious.

Closes #6531

State transitions call respective functions in the status component
where unit variables and status are actually handled.
@kymckay kymckay added kind/cleanup Release Notes: **CHANGED:** kind/bug-fix Release Notes: **FIXED:** labels Aug 17, 2018
@kymckay kymckay added this to the Medical Rewrite milestone Aug 17, 2018
@kymckay kymckay requested a review from thojkooi August 17, 2018 19:19
@@ -1,7 +1,8 @@
#include "script_component.hpp"
/*
* Author: BaerMitUmlaut
* Handles a unit entering cardiac arrest.
* Author: RedBery
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Author: BaerMitUmlaut, RedBery

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Baer's name was only here because the enteredStateCardiacArrest file was copied over and edited so the header was for that function.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok. I got confused :)

Copy link
Contributor

@thojkooi thojkooi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@kymckay kymckay merged commit 24846e6 into medical-rewrite Aug 25, 2018
@kymckay kymckay deleted the rw-status-updates branch August 25, 2018 15:40
BaerMitUmlaut pushed a commit that referenced this pull request Aug 5, 2019
State transitions call respective functions in the status component where unit variables and status are actually handled.
@PabstMirror PabstMirror modified the milestones: Medical Rewrite, 3.13.0, 3.13.0-temp3 Dec 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug-fix Release Notes: **FIXED:** kind/cleanup Release Notes: **CHANGED:**
Projects
Development

Successfully merging this pull request may close these issues.

4 participants