Skip to content

Commit

Permalink
Merge pull request #3326 from acemod/makeAdvMedicalWoundsConsistant
Browse files Browse the repository at this point in the history
Make wound assignment consistent for dll/sqf
  • Loading branch information
thojkooi committed Feb 17, 2016
2 parents 8e49c8b + f1797fe commit 26cb6bd
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 8 deletions.
Binary file modified ace_medical.dll
Binary file not shown.
4 changes: 2 additions & 2 deletions addons/medical/ACE_Medical_Treatments.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -651,12 +651,12 @@ class ACE_Medical_Advanced {
selectionSpecific = 0;
};
class vehiclecrash {
thresholds[] = {{0.25, 5}};
thresholds[] = {{0.25, 5}, {0.05, 1}};
selectionSpecific = 0;
lethalDamage = 0.2;
};
class backblast {
thresholds[] = {{0, 2},{0.55, 5}, {1, 6}};
thresholds[] = {{1, 6}, {0.55, 5}, {0, 2}};
selectionSpecific = 0;
lethalDamage = 1;
};
Expand Down
9 changes: 8 additions & 1 deletion addons/medical/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,14 @@ PREP(handleCreateLitter);
GVAR(injuredUnitCollection) = [];
GVAR(IVBags) = [];

DFUNC(handleDamage_assignWounds) = if ("ace_medical" callExtension "version" == "") then { DFUNC(handleDamage_woundsOld) } else { DFUNC(handleDamage_wounds)};
private _versionEx = "ace_medical" callExtension "version";
DFUNC(handleDamage_assignWounds) = if (_versionEx == "") then {
ACE_LOGINFO_1("Extension %1.dll not installed.","ace_medical");
DFUNC(handleDamage_woundsOld)
} else {
ACE_LOGINFO_2("Extension version: %1: %2","ace_medical",_versionEx);
DFUNC(handleDamage_wounds)
};

call FUNC(parseConfigForInjuries);

Expand Down
2 changes: 1 addition & 1 deletion addons/medical/functions/fnc_handleDamage_wounds.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ _painToAdd = 0;
_woundsCreated = [];

call compile _extensionOutput;
_foundIndex = -1;
{
_foundIndex = -1;
_toAddClassID = _x select 1;
_bodyPartNToAdd = _x select 2;
{
Expand Down
2 changes: 1 addition & 1 deletion addons/medical/functions/fnc_handleDamage_woundsOld.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ _painToAdd = 0;
_woundsCreated = [];
{
if (_x select 0 <= _damage) exitWith {
for "_i" from 0 to (1+ floor(random(_x select 1)-1)) /* step +1 */ do {
for "_i" from 0 to ((_x select 1)-1) do {

// Find the injury we are going to add. Format [ classID, allowdSelections, bloodloss, painOfInjury, minimalDamage]
_toAddInjury = if (random(1) >= 0.85) then {_allInjuriesForDamageType select _highestPossibleSpot} else {_allPossibleInjuries select (floor(random (count _allPossibleInjuries)));};
Expand Down
4 changes: 2 additions & 2 deletions extensions/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ endif()

string(TIMESTAMP ACE_BUILDSTAMP "%Y-%m-%dT%H:%M:%SZ")
set(ACE_VERSION_MAJOR 3)
set(ACE_VERSION_MINOR 4)
set(ACE_VERSION_REVISION 1)
set(ACE_VERSION_MINOR 5)
set(ACE_VERSION_REVISION 0)
EXECUTE_PROCESS(COMMAND git rev-parse --verify HEAD
OUTPUT_VARIABLE T_ACE_VERSION_BUILD
OUTPUT_STRIP_TRAILING_WHITESPACE
Expand Down
2 changes: 1 addition & 1 deletion extensions/medical/handleDamage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ namespace ace {
injuries::OpenWound newWound(woundID++, injuryToAdd->ID, bodyPartID, 1, injuryToAdd->bloodLoss, injuryToAdd->pain);
injuriesToAdd.push_back(newWound);
}
return injuriesToAdd;
}
++c;
}
return injuriesToAdd;
}
}
return injuriesToAdd;
Expand Down

0 comments on commit 26cb6bd

Please sign in to comment.