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

Medical adjustments2 #2361

Merged
merged 85 commits into from
Sep 7, 2015
Merged

Medical adjustments2 #2361

merged 85 commits into from
Sep 7, 2015

Conversation

commy2
Copy link
Contributor

@commy2 commy2 commented Sep 3, 2015

more recent branch of #2304 that includes some fixes from the "cleanup" and some debug stuff

@commy2
Copy link
Contributor Author

commy2 commented Sep 7, 2015

Just putting some notes here:

12:36:46 21858
12:36:46 ["head",0]
12:36:46 21858
12:36:46 ["",0.125134]
12:36:46 21858
12:36:46 ["",0.125134]
12:36:46 21858
12:36:46 ["head",0]
12:36:46 21858
12:36:46 ["body",0.30695]
12:36:46 21858
12:36:46 ["hand_l",0]
12:36:46 21858
12:36:46 ["hand_r",0.0148034]
12:36:47 21859
12:36:47 ["",0.125134]


12:36:47 21863
12:36:47 ["head",0]
12:36:47 21863
12:36:47 ["",0.125134]
12:36:47 21863
12:36:47 ["",0.250268]
12:36:47 21863
12:36:47 ["head",0]
12:36:47 21863
12:36:47 ["body",0.613901]
12:36:47 21863
12:36:47 ["hand_l",0]
12:36:47 21863
12:36:47 ["hand_r",0.0307413]
12:36:47 21863
12:36:47 ["",0.250268]

#include "script_component.hpp"

params ["_unit", "_selection", "_damage", "_shooter", "_projectile"];
TRACE_5("ACE_DEBUG: HandleDamage Called",_unit,_selection,_damage,_shooter,_projectile);

// bug, apparently can fire for remote units in special cases
if !(local _unit) exitWith {
    TRACE_2("ACE_DEBUG: HandleDamage on remote unit!",_unit,isServer);
    nil
};

private ["_damageReturn",  "_typeOfDamage", "_minLethalDamage", "_newDamage", "_typeIndex", "_preventDeath"];

// bug, assumed fixed, @todo excessive testing, if nothing happens remove
if (typeName _projectile == "OBJECT") then {
    _projectile = typeOf _projectile;
    _this set [4, _projectile];
};

TRACE_3("ACE_DEBUG: HandleDamage",_selection,_damage,_unit);

// If damage is in dummy hitpoints, "hands" and "legs", don't change anything
if (_selection == "hands") exitWith {_unit getHit "hands"};
if (_selection == "legs") exitWith {_unit getHit "legs"};

// If the damage is being weird, we just tell it to fuck off. Ignore: "hands", "legs", "?"
if (_selection != "" && {!(_selection in GVAR(SELECTIONS))}) exitWith {0}; //@todo "neck", "pelvis", "spine1", "spine2", "spine3"

/*
diag_log text str diag_frameno;
diag_log text str [_selection, _damage];
*/

//
if (_selection == "") then {
    GVAR(HDEID) = (GETMVAR(GVAR(HDEID),0)) + 1;
};
if (GETMVAR(GVAR(HDEID),0) == 1) then {
    GVAR(HDEADE) = [];
};
if (GETMVAR(GVAR(HDEID),0) == 2) then {
    GVAR(HDEADE) pushBack _selection;
};
if (GETMVAR(GVAR(HDEID),0) == 3) then {
    diag_log text str GVAR(HDEADE);
    GVAR(HDEID) = 0;
};
//

_damage

@thojkooi thojkooi added kind/enhancement Release Notes: **IMPROVED:** kind/bug-fix Release Notes: **FIXED:** and removed status/WIP labels Sep 7, 2015
thojkooi added a commit that referenced this pull request Sep 7, 2015
@thojkooi thojkooi merged commit 7b349ab into master Sep 7, 2015
@thojkooi thojkooi deleted the medical-adjustments2 branch September 7, 2015 13:51
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/enhancement Release Notes: **IMPROVED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants