From c7549a13a44b97fa68005f0a069f4c3cf021cfa1 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Tue, 7 Apr 2015 00:41:53 +0200 Subject: [PATCH 01/15] Improved pain reduction --- addons/medical/ACE_Medical_Treatments.hpp | 2 +- .../functions/fnc_treatmentAdvanced_medicationLocal.sqf | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/addons/medical/ACE_Medical_Treatments.hpp b/addons/medical/ACE_Medical_Treatments.hpp index 9f0484f671..f061f93f48 100644 --- a/addons/medical/ACE_Medical_Treatments.hpp +++ b/addons/medical/ACE_Medical_Treatments.hpp @@ -751,7 +751,7 @@ class ACE_Medical_Advanced { // specific details for the ACE_Morphine treatment action class Morphine { - painReduce = 0.7; + painReduce = 1; hrIncreaseLow[] = {-10, -30, 35}; hrIncreaseNormal[] = {-10, -50, 40}; hrIncreaseHigh[] = {-10, -40, 50}; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_medicationLocal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_medicationLocal.sqf index 714f0f7e7f..bbf5aea6c0 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_medicationLocal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_medicationLocal.sqf @@ -71,9 +71,11 @@ if (alive _target) then { }; }; -// Reduce the pain level -_pain = _target getvariable [QGVAR(pain), 0]; -_target setvariable [QGVAR(pain), (_pain - _painReduce) max 0]; +if (_painReduce > 0) then { + // Reduce the pain level + _pain = _target getvariable [QGVAR(pain), 0]; + _target setvariable [QGVAR(pain), (_pain - (_pain * _painReduce)) max 0]; +}; _resistance = _unit getvariable [QGVAR(peripheralResistance), 100]; _resistance = _resistance + _viscosityChange; From 12493f8595566a5d381144d349d2f5379c6cb84b Mon Sep 17 00:00:00 2001 From: Glowbal Date: Tue, 7 Apr 2015 00:57:05 +0200 Subject: [PATCH 02/15] Improved wounds configuration (missing maxDamage values added) --- addons/medical/ACE_Medical_Treatments.hpp | 30 +++++++++++++++---- addons/medical/XEH_postInit.sqf | 4 +-- .../functions/fnc_handleDamage_wounds.sqf | 12 +++++--- .../functions/fnc_parseConfigForInjuries.sqf | 3 +- 4 files changed, 36 insertions(+), 13 deletions(-) diff --git a/addons/medical/ACE_Medical_Treatments.hpp b/addons/medical/ACE_Medical_Treatments.hpp index f061f93f48..097292d9cc 100644 --- a/addons/medical/ACE_Medical_Treatments.hpp +++ b/addons/medical/ACE_Medical_Treatments.hpp @@ -295,14 +295,16 @@ class ACE_Medical_Advanced { selections[] = {"All"}; bleedingRate = 0.0001; pain = 0.01; - causes[] = {"falling", "ropeburn", "vehiclecrash"}; + causes[] = {"falling", "ropeburn", "vehiclecrash", "unknown"}; minDamage = 0.01; class Minor { minDamage = 0.01; + maxDamage = 0.2; bleedingRate = 0.0001; }; class Medium { minDamage = 0.2; + maxDamage = 0.3; bleedingRate = 0.00015; }; class Large { @@ -321,10 +323,12 @@ class ACE_Medical_Advanced { minDamage = 0.2; class Minor { minDamage = 0.2; + maxDamage = 0.3; bleedingRate = 0.01; }; class Medium { minDamage = 0.3; + maxDamage = 0.6; bleedingRate = 0.02; }; class Large { @@ -341,14 +345,18 @@ class ACE_Medical_Advanced { pain = 0.05; causes[] = {"bullet", "backblast", "punch","vehiclecrash","falling"}; minDamage = 0.01; + maxDamage = 0.1; class Minor { minDamage = 0.01; + maxDamage = 0.1; }; class Medium { minDamage = 0.1; + maxDamage = 0.15; }; class Large { - minDamage = 0.3; + minDamage = 0.15; + maxDamage = 0.2; }; }; @@ -358,14 +366,16 @@ class ACE_Medical_Advanced { selections[] = {"All"}; bleedingRate = 0.01; pain = 0.1; - causes[] = {"falling", "vehiclecrash", "punch"}; + causes[] = {"falling", "vehiclecrash", "punch", "unknown"}; minDamage = 0.1; class Minor { minDamage = 0.1; + maxDamage = 0.45; bleedingRate = 0.005; }; class Medium { minDamage = 0.4; + maxDamage = 0.7; bleedingRate = 0.007; }; class Large { @@ -380,14 +390,16 @@ class ACE_Medical_Advanced { selections[] = {"All"}; bleedingRate = 0.01; pain = 0.075; - causes[] = {"vehiclecrash", "grenade", "explosive", "shell", "backblast", "stab"}; + causes[] = {"vehiclecrash", "grenade", "explosive", "shell", "backblast", "stab", "unknown"}; minDamage = 0.1; class Minor { minDamage = 0.1; + maxDamage = 0.3; bleedingRate = 0.005; }; class Medium { minDamage = 0.3; + maxDamage = 0.65; bleedingRate = 0.02; }; class Large { @@ -406,10 +418,12 @@ class ACE_Medical_Advanced { minDamage = 0.01; class Minor { minDamage = 0.1; + maxDamage = 0.5; bleedingRate = 0.005; }; class Medium { minDamage = 0.5; + maxDamage = 0.7; bleedingRate = 0.01; }; class Large { @@ -424,10 +438,11 @@ class ACE_Medical_Advanced { selections[] = {"All"}; bleedingRate = 0.01; pain = 0.2; - causes[] = {"bullet", "grenade","explosive", "shell"}; + causes[] = {"bullet", "grenade","explosive", "shell", "unknown"}; minDamage = 0.15; class Minor { minDamage = 0.15; + maxDamage = 0.3; bleedingRate = 0.025; }; class Medium { @@ -450,10 +465,12 @@ class ACE_Medical_Advanced { minDamage = 0.01; class Minor { minDamage = 0.01; + maxDamage = 0.5; bleedingRate = 0.01; }; class Medium { minDamage = 0.5; + maxDamage = 0.75; bleedingRate = 0.03; }; class Large { @@ -518,6 +535,9 @@ class ACE_Medical_Advanced { thresholds[] = {{0.1, 1}}; selectionSpecific = 1; }; + class unknown { + thresholds[] = {{0.1, 1}}; + }; }; }; class Treatment { diff --git a/addons/medical/XEH_postInit.sqf b/addons/medical/XEH_postInit.sqf index 27f2ce07b9..ea9ac70550 100644 --- a/addons/medical/XEH_postInit.sqf +++ b/addons/medical/XEH_postInit.sqf @@ -134,9 +134,9 @@ GVAR(effectTimeBlood) = time; _bleeding = ACE_player call FUNC(getBloodLoss); // Bleeding Indicator - if (_bleeding > 0 and GVAR(effectTimeBlood) + 6 < time) then { + if (_bleeding > 0 and GVAR(effectTimeBlood) + 3.5 < time) then { GVAR(effectTimeBlood) = time; - [500 * _bleeding] call BIS_fnc_bloodEffect; + [600 * _bleeding] call BIS_fnc_bloodEffect; }; // Blood Volume Effect diff --git a/addons/medical/functions/fnc_handleDamage_wounds.sqf b/addons/medical/functions/fnc_handleDamage_wounds.sqf index b2d7b3514d..1eebe038cd 100644 --- a/addons/medical/functions/fnc_handleDamage_wounds.sqf +++ b/addons/medical/functions/fnc_handleDamage_wounds.sqf @@ -33,6 +33,13 @@ _injuryTypeInfo = missionNamespace getvariable [format[QGVAR(woundInjuryType_%1) // This are the available injuries for this damage type. Format [[classtype, selections, bloodloss, minimalDamage, pain], ..] _allInjuriesForDamageType = _injuryTypeInfo select 2; +// It appears we are dealing with an unknown type of damage. + +if (count _allInjuriesForDamageType == 0) then { + // grabbing the configuration for unknown damage type + _injuryTypeInfo = missionNamespace getvariable [QGVAR(woundInjuryType_unknown),[[], false, []]]; + _allInjuriesForDamageType = _injuryTypeInfo select 2; +}; // find the available injuries for this damage type and damage amount _highestPossibleSpot = -1; @@ -67,10 +74,7 @@ _allPossibleInjuries = []; // No possible wounds available for this damage type or damage amount. if (_highestPossibleSpot < 0) exitwith { - // It appears we are dealing with an unknown type of damage. - if (count _allInjuriesForDamageType == 0) then { - }; }; // Administration for open wounds and ids @@ -84,7 +88,7 @@ _woundsCreated = []; for "_i" from 0 to (1+ floor(random(_x select 1)-1)) /* step +1 */ do { // Find the injury we are going to add. Format [ classID, allowdSelections, bloodloss, painOfInjury, minimalDamage] - _toAddInjury = if (random(1) >= 0.5) then {_allInjuriesForDamageType select _highestPossibleSpot} else {_allPossibleInjuries select (floor(random (count _allPossibleInjuries)));}; + _toAddInjury = if (random(1) >= 0.85) then {_allInjuriesForDamageType select _highestPossibleSpot} else {_allPossibleInjuries select (floor(random (count _allPossibleInjuries)));}; _toAddClassID = _toAddInjury select 0; _foundIndex = -1; diff --git a/addons/medical/functions/fnc_parseConfigForInjuries.sqf b/addons/medical/functions/fnc_parseConfigForInjuries.sqf index 4efc7ac8ae..c624b1af1b 100644 --- a/addons/medical/functions/fnc_parseConfigForInjuries.sqf +++ b/addons/medical/functions/fnc_parseConfigForInjuries.sqf @@ -12,10 +12,9 @@ #include "script_component.hpp" -private ["_injuriesRootConfig", "_woundsConfig", "_allWoundClasses", "_amountOf", "_entry","_classType", "_selections", "_bloodLoss", "_pain","_minDamage","_causes", "_allTypes", "_damageTypesConfig", "_thresholds", "_typeThresholds", "_selectionSpecific", "_selectionSpecificType", "_classDisplayName", "_subClassDisplayName", "_maxDamage", "_subClassmaxDamage", "_defaultMinLethalDamage", "_minLethalDamage"]; +private ["_injuriesRootConfig", "_woundsConfig", "_allWoundClasses", "_amountOf", "_entry","_classType", "_selections", "_bloodLoss", "_pain","_minDamage","_causes", "_damageTypesConfig", "_thresholds", "_typeThresholds", "_selectionSpecific", "_selectionSpecificType", "_classDisplayName", "_subClassDisplayName", "_maxDamage", "_subClassmaxDamage", "_defaultMinLethalDamage", "_minLethalDamage"]; _injuriesRootConfig = (configFile >> "ACE_Medical_Advanced" >> "Injuries"); -_allTypes = ["stab", "grenade", "bullet", "explosive", "shell", "punch", "vehiclecrash", "backblast", "falling", "bite", "ropeburn"]; _allFoundDamageTypes = []; _configDamageTypes = (_injuriesRootConfig >> "damageTypes"); From 7fb3ac67403c7cf20b4727390e83b62bc02f93d5 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Tue, 7 Apr 2015 19:16:56 +0200 Subject: [PATCH 03/15] Added _x_ca suffixes to all item pictures --- addons/medical/CfgWeapons.hpp | 28 +++++++++--------- .../items/{atropine.paa => atropine_x_ca.paa} | Bin .../items/{bloodIV.paa => bloodIV_x_ca.paa} | Bin .../items/{bodybag.paa => bodybag_x_ca.paa} | Bin ...ticBandage.paa => elasticBandage_x_ca.paa} | Bin .../{epinephrine.paa => epinephrine_x_ca.paa} | Bin ...eldDressing.paa => fieldDressing_x_ca.paa} | Bin .../items/{morphine.paa => morphine_x_ca.paa} | Bin ...ingBandage.paa => packingBandage_x_ca.paa} | Bin ..._aid_kit.paa => personal_aid_kit_x_ca.paa} | Bin .../items/{plasmaIV.paa => plasmaIV_x_ca.paa} | Bin .../{quickclot.paa => quickclot_x_ca.paa} | Bin .../items/{salineIV.paa => salineIV_x_ca.paa} | Bin .../{surgicalKit.paa => surgicalKit_x_ca.paa} | Bin .../{tourniquet.paa => tourniquet_x_ca.paa} | Bin 15 files changed, 14 insertions(+), 14 deletions(-) rename addons/medical/ui/items/{atropine.paa => atropine_x_ca.paa} (100%) rename addons/medical/ui/items/{bloodIV.paa => bloodIV_x_ca.paa} (100%) rename addons/medical/ui/items/{bodybag.paa => bodybag_x_ca.paa} (100%) rename addons/medical/ui/items/{elasticBandage.paa => elasticBandage_x_ca.paa} (100%) rename addons/medical/ui/items/{epinephrine.paa => epinephrine_x_ca.paa} (100%) rename addons/medical/ui/items/{fieldDressing.paa => fieldDressing_x_ca.paa} (100%) rename addons/medical/ui/items/{morphine.paa => morphine_x_ca.paa} (100%) rename addons/medical/ui/items/{packingBandage.paa => packingBandage_x_ca.paa} (100%) rename addons/medical/ui/items/{personal_aid_kit.paa => personal_aid_kit_x_ca.paa} (100%) rename addons/medical/ui/items/{plasmaIV.paa => plasmaIV_x_ca.paa} (100%) rename addons/medical/ui/items/{quickclot.paa => quickclot_x_ca.paa} (100%) rename addons/medical/ui/items/{salineIV.paa => salineIV_x_ca.paa} (100%) rename addons/medical/ui/items/{surgicalKit.paa => surgicalKit_x_ca.paa} (100%) rename addons/medical/ui/items/{tourniquet.paa => tourniquet_x_ca.paa} (100%) diff --git a/addons/medical/CfgWeapons.hpp b/addons/medical/CfgWeapons.hpp index 6545464ea9..51795d266c 100644 --- a/addons/medical/CfgWeapons.hpp +++ b/addons/medical/CfgWeapons.hpp @@ -24,7 +24,7 @@ class CfgWeapons { class ACE_fieldDressing: ACE_ItemCore { scope = 2; model = QUOTE(PATHTOF(data\bandage.p3d)); - picture = QUOTE(PATHTOF(ui\items\fieldDressing.paa)); + picture = QUOTE(PATHTOF(ui\items\fieldDressing_x_ca.paa)); displayName = $STR_ACE_MEDICAL_BANDAGE_BASIC_DISPLAY; descriptionShort = $STR_ACE_MEDICAL_BANDAGE_BASIC_DESC_SHORT; descriptionUse = $STR_ACE_MEDICAL_BANDAGE_BASIC_DESC_USE; @@ -38,7 +38,7 @@ class CfgWeapons { count = 1; type = 16; displayName = $STR_ACE_MEDICAL_PACKING_BANDAGE_DISPLAY; - picture = QUOTE(PATHTOF(ui\items\packingBandage.paa)); + picture = QUOTE(PATHTOF(ui\items\packingBandage_x_ca.paa)); model = QUOTE(PATHTOF(data\packingbandage.p3d)); descriptionShort = $STR_ACE_MEDICAL_PACKING_BANDAGE_DESC_SHORT; descriptionUse = $STR_ACE_MEDICAL_PACKING_BANDAGE_DESC_USE; @@ -52,7 +52,7 @@ class CfgWeapons { count = 1; type = 16; displayName = $STR_ACE_MEDICAL_BANDAGE_ELASTIC_DISPLAY; - picture = QUOTE(PATHTOF(ui\items\elasticBandage.paa)); + picture = QUOTE(PATHTOF(ui\items\elasticBandage_x_ca.paa)); model = "\A3\Structures_F_EPA\Items\Medical\Bandage_F.p3d"; descriptionShort = $STR_ACE_MEDICAL_BANDAGE_ELASTIC_DESC_SHORT; descriptionUse = $STR_ACE_MEDICAL_BANDAGE_ELASTIC_DESC_USE; @@ -66,7 +66,7 @@ class CfgWeapons { count = 1; type = 16; displayName = $STR_ACE_MEDICAL_TOURNIQUET_DISPLAY; - picture = QUOTE(PATHTOF(ui\items\tourniquet.paa)); + picture = QUOTE(PATHTOF(ui\items\tourniquet_x_ca.paa)); model = QUOTE(PATHTOF(data\tourniquet.p3d)); descriptionShort = $STR_ACE_MEDICAL_TOURNIQUET_DESC_SHORT; descriptionUse = $STR_ACE_MEDICAL_TOURNIQUET_DESC_USE; @@ -80,7 +80,7 @@ class CfgWeapons { count = 1; type = 16; displayName = $STR_ACE_MEDICAL_MORPHINE_DISPLAY; - picture = QUOTE(PATHTOF(ui\items\morphine.paa)); + picture = QUOTE(PATHTOF(ui\items\morphine_x_ca.paa)); model = QUOTE(PATHTOF(data\morphine.p3d)); descriptionShort = $STR_ACE_MEDICAL_MORPHINE_DESC_SHORT; descriptionUse = $STR_ACE_MEDICAL_MORPHINE_DESC_USE; @@ -94,7 +94,7 @@ class CfgWeapons { count = 1; type = 16; displayName = $STR_ACE_MEDICAL_ATROPINE_DISPLAY; - picture = QUOTE(PATHTOF(ui\items\atropine.paa)); + picture = QUOTE(PATHTOF(ui\items\atropine_x_ca.paa)); model = QUOTE(PATHTOF(data\atropine.p3d)); descriptionShort = $STR_ACE_MEDICAL_ATROPINE_DESC_SHORT; descriptionUse = $STR_ACE_MEDICAL_ATROPINE_DESC_USE; @@ -109,7 +109,7 @@ class CfgWeapons { count = 1; type = 16; displayName = $STR_ACE_MEDICAL_EPINEPHRINE_DISPLAY; - picture = QUOTE(PATHTOF(ui\items\epinephrine.paa)); + picture = QUOTE(PATHTOF(ui\items\epinephrine_x_ca.paa)); model = QUOTE(PATHTOF(data\epinephrine.p3d)); descriptionShort = $STR_ACE_MEDICAL_EPINEPHRINE_DESC_SHORT; descriptionUse = $STR_ACE_MEDICAL_EPINEPHRINE_DESC_USE; @@ -122,7 +122,7 @@ class CfgWeapons { value = 1; count = 1; displayName = $STR_ACE_MEDICAL_PLASMA_IV; - picture = QUOTE(PATHTOF(ui\items\plasmaIV.paa)); + picture = QUOTE(PATHTOF(ui\items\plasmaIV_x_ca.paa)); descriptionShort = $STR_ACE_MEDICAL_PLASMA_IV_DESC_SHORT; descriptionUse = $STR_ACE_MEDICAL_PLASMA_IV_DESC_USE; class ItemInfo: InventoryItem_Base_F { @@ -147,7 +147,7 @@ class CfgWeapons { count = 1; model = "\A3\Structures_F_EPA\Items\Medical\BloodBag_F.p3d"; displayName = $STR_ACE_MEDICAL_BLOOD_IV; - picture = QUOTE(PATHTOF(ui\items\bloodIV.paa)); + picture = QUOTE(PATHTOF(ui\items\bloodIV_x_ca.paa)); descriptionShort = $STR_ACE_MEDICAL_BLOOD_IV_DESC_SHORT; descriptionUse = $STR_ACE_MEDICAL_BLOOD_IV_DESC_USE; class ItemInfo: InventoryItem_Base_F { @@ -171,7 +171,7 @@ class CfgWeapons { value = 1; count = 1; displayName = $STR_ACE_MEDICAL_SALINE_IV; - picture = QUOTE(PATHTOF(ui\items\salineIV.paa)); + picture = QUOTE(PATHTOF(ui\items\salineIV_x_ca.paa)); descriptionShort = $STR_ACE_MEDICAL_SALINE_IV_DESC_SHORT; descriptionUse = $STR_ACE_MEDICAL_SALINE_IV_DESC_USE; class ItemInfo: InventoryItem_Base_F { @@ -196,7 +196,7 @@ class CfgWeapons { count = 1; type = 16; displayName = $STR_ACE_MEDICAL_QUIKCLOT_DISPLAY; - picture = QUOTE(PATHTOF(ui\items\quickclot.paa)); + picture = QUOTE(PATHTOF(ui\items\quickclot_x_ca.paa)); descriptionShort = $STR_ACE_MEDICAL_QUIKCLOT_DESC_SHORT; descriptionUse = $STR_ACE_MEDICAL_QUIKCLOT_DESC_USE; class ItemInfo: InventoryItem_Base_F { @@ -209,7 +209,7 @@ class CfgWeapons { count = 1; type = 16; displayName = $STR_ACE_MEDICAL_AID_KIT_DISPLAY; - picture = QUOTE(PATHTOF(ui\items\personal_aid_kit.paa)); + picture = QUOTE(PATHTOF(ui\items\personal_aid_kit_x_ca.paa)); descriptionShort = $STR_ACE_MEDICAL_AID_KIT_DESC_SHORT; descriptionUse = $STR_ACE_MEDICAL_AID_KIT_DESC_USE; class ItemInfo: InventoryItem_Base_F { @@ -220,7 +220,7 @@ class CfgWeapons { scope=2; displayName= $STR_ACE_MEDICAL_SURGICALKIT_DISPLAY; model = QUOTE(PATHTOF(data\surgical_kit.p3d)); - picture = QUOTE(PATHTOF(ui\items\surgicalKit.paa)); + picture = QUOTE(PATHTOF(ui\items\surgicalKit_x_ca.paa)); descriptionShort = $STR_ACE_MEDICAL_SURGICALKIT_DESC_SHORT; descriptionUse = $STR_ACE_MEDICAL_SURGICALKIT_DESC_USE; class ItemInfo: InventoryItem_Base_F { @@ -231,7 +231,7 @@ class CfgWeapons { scope=2; displayName= $STR_ACE_MEDICAL_BODYBAG_DISPLAY; model = QUOTE(PATHTOF(data\bodybagItem.p3d)); - picture = QUOTE(PATHTOF(ui\items\bodybag.paa)); + picture = QUOTE(PATHTOF(ui\items\bodybag_x_ca.paa)); descriptionShort = $STR_ACE_MEDICAL_BODYBAG_DESC_SHORT; descriptionUse = $STR_ACE_MEDICAL_BODYBAG_DESC_USE; class ItemInfo: InventoryItem_Base_F { diff --git a/addons/medical/ui/items/atropine.paa b/addons/medical/ui/items/atropine_x_ca.paa similarity index 100% rename from addons/medical/ui/items/atropine.paa rename to addons/medical/ui/items/atropine_x_ca.paa diff --git a/addons/medical/ui/items/bloodIV.paa b/addons/medical/ui/items/bloodIV_x_ca.paa similarity index 100% rename from addons/medical/ui/items/bloodIV.paa rename to addons/medical/ui/items/bloodIV_x_ca.paa diff --git a/addons/medical/ui/items/bodybag.paa b/addons/medical/ui/items/bodybag_x_ca.paa similarity index 100% rename from addons/medical/ui/items/bodybag.paa rename to addons/medical/ui/items/bodybag_x_ca.paa diff --git a/addons/medical/ui/items/elasticBandage.paa b/addons/medical/ui/items/elasticBandage_x_ca.paa similarity index 100% rename from addons/medical/ui/items/elasticBandage.paa rename to addons/medical/ui/items/elasticBandage_x_ca.paa diff --git a/addons/medical/ui/items/epinephrine.paa b/addons/medical/ui/items/epinephrine_x_ca.paa similarity index 100% rename from addons/medical/ui/items/epinephrine.paa rename to addons/medical/ui/items/epinephrine_x_ca.paa diff --git a/addons/medical/ui/items/fieldDressing.paa b/addons/medical/ui/items/fieldDressing_x_ca.paa similarity index 100% rename from addons/medical/ui/items/fieldDressing.paa rename to addons/medical/ui/items/fieldDressing_x_ca.paa diff --git a/addons/medical/ui/items/morphine.paa b/addons/medical/ui/items/morphine_x_ca.paa similarity index 100% rename from addons/medical/ui/items/morphine.paa rename to addons/medical/ui/items/morphine_x_ca.paa diff --git a/addons/medical/ui/items/packingBandage.paa b/addons/medical/ui/items/packingBandage_x_ca.paa similarity index 100% rename from addons/medical/ui/items/packingBandage.paa rename to addons/medical/ui/items/packingBandage_x_ca.paa diff --git a/addons/medical/ui/items/personal_aid_kit.paa b/addons/medical/ui/items/personal_aid_kit_x_ca.paa similarity index 100% rename from addons/medical/ui/items/personal_aid_kit.paa rename to addons/medical/ui/items/personal_aid_kit_x_ca.paa diff --git a/addons/medical/ui/items/plasmaIV.paa b/addons/medical/ui/items/plasmaIV_x_ca.paa similarity index 100% rename from addons/medical/ui/items/plasmaIV.paa rename to addons/medical/ui/items/plasmaIV_x_ca.paa diff --git a/addons/medical/ui/items/quickclot.paa b/addons/medical/ui/items/quickclot_x_ca.paa similarity index 100% rename from addons/medical/ui/items/quickclot.paa rename to addons/medical/ui/items/quickclot_x_ca.paa diff --git a/addons/medical/ui/items/salineIV.paa b/addons/medical/ui/items/salineIV_x_ca.paa similarity index 100% rename from addons/medical/ui/items/salineIV.paa rename to addons/medical/ui/items/salineIV_x_ca.paa diff --git a/addons/medical/ui/items/surgicalKit.paa b/addons/medical/ui/items/surgicalKit_x_ca.paa similarity index 100% rename from addons/medical/ui/items/surgicalKit.paa rename to addons/medical/ui/items/surgicalKit_x_ca.paa diff --git a/addons/medical/ui/items/tourniquet.paa b/addons/medical/ui/items/tourniquet_x_ca.paa similarity index 100% rename from addons/medical/ui/items/tourniquet.paa rename to addons/medical/ui/items/tourniquet_x_ca.paa From 3d82cb8eac6398db9a1d2b308ff768b148cb53bb Mon Sep 17 00:00:00 2001 From: Glowbal Date: Tue, 7 Apr 2015 19:54:24 +0200 Subject: [PATCH 04/15] Removed deprecated onTreatmentCompleted event --- addons/medical/XEH_postInit.sqf | 1 - addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf | 1 - addons/medical/functions/fnc_treatmentAdvanced_medication.sqf | 1 - addons/medical/functions/fnc_treatmentIV.sqf | 1 - addons/medical/functions/fnc_treatmentTourniquet.sqf | 2 +- 5 files changed, 1 insertion(+), 5 deletions(-) diff --git a/addons/medical/XEH_postInit.sqf b/addons/medical/XEH_postInit.sqf index ea9ac70550..7d52ff36d4 100644 --- a/addons/medical/XEH_postInit.sqf +++ b/addons/medical/XEH_postInit.sqf @@ -8,7 +8,6 @@ GVAR(heartBeatSounds_Fast) = ["ACE_heartbeat_fast_1", "ACE_heartbeat_fast_2", "A GVAR(heartBeatSounds_Normal) = ["ACE_heartbeat_norm_1", "ACE_heartbeat_norm_2"]; GVAR(heartBeatSounds_Slow) = ["ACE_heartbeat_slow_1", "ACE_heartbeat_slow_2"]; -["Medical_treatmentCompleted", FUNC(onTreatmentCompleted)] call ace_common_fnc_addEventHandler; ["medical_propagateWound", FUNC(onPropagateWound)] call ace_common_fnc_addEventHandler; ["medical_woundUpdateRequest", FUNC(onWoundUpdateRequest)] call ace_common_fnc_addEventHandler; ["interactMenuClosed", {[objNull, false] call FUNC(displayPatientInformation); }] call ace_common_fnc_addEventHandler; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf b/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf index 6584569227..91ae7f61c1 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf @@ -37,7 +37,6 @@ if !([_target] call FUNC(hasMedicalEnabled)) exitwith { }; }foreach _items;*/ -["Medical_treatmentCompleted", [_caller, _target, _selectionName, _className, true]] call ace_common_fnc_localEvent; [_target, "activity", "STR_ACE_MEDICAL_ACTIVITY_bandagedPatient", [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); true; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_medication.sqf b/addons/medical/functions/fnc_treatmentAdvanced_medication.sqf index 4d83a97c2e..508040b8af 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_medication.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_medication.sqf @@ -32,7 +32,6 @@ _items = _this select 4; }; }foreach _items; -["Medical_treatmentCompleted", [_caller, _target, _selectionName, _className, true]] call ace_common_fnc_localEvent; [_target, "activity", "STR_ACE_MEDICAL_ACTIVITY_usedItem", [[_caller] call EFUNC(common,getName), _className]] call FUNC(addToLog); true; diff --git a/addons/medical/functions/fnc_treatmentIV.sqf b/addons/medical/functions/fnc_treatmentIV.sqf index 532b1a733c..c171d7364f 100644 --- a/addons/medical/functions/fnc_treatmentIV.sqf +++ b/addons/medical/functions/fnc_treatmentIV.sqf @@ -28,6 +28,5 @@ if (count _items == 0) exitwith {}; _removeItem = _items select 0; [[_target, _removeItem], QUOTE(DFUNC(treatmentIVLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ -["Medical_treatmentCompleted", [_caller, _target, _selectionName, _className, true]] call ace_common_fnc_localEvent; [_target, _removeItem] call FUNC(addToTriageCard); [_target, "activity", "STR_ACE_MEDICAL_ACTIVITY_gaveIV", [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); diff --git a/addons/medical/functions/fnc_treatmentTourniquet.sqf b/addons/medical/functions/fnc_treatmentTourniquet.sqf index 379ddbda7a..cff9458426 100644 --- a/addons/medical/functions/fnc_treatmentTourniquet.sqf +++ b/addons/medical/functions/fnc_treatmentTourniquet.sqf @@ -41,7 +41,7 @@ if ((_tourniquets select _part) > 0) exitwith { _removeItem = _items select 0; [[_target, _removeItem], QUOTE(DFUNC(treatmentTourniquetLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ -["Medical_treatmentCompleted", [_caller, _target, _selectionName, _className, true]] call ace_common_fnc_localEvent; + [_target, _removeItem] call FUNC(addToTriageCard); [_target, "activity", "STR_ACE_MEDICAL_ACTIVITY_appliedTourniquet", [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); From 526e24f1335dc7ce23a0e2f13a595a7fdc5ad3b1 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Tue, 7 Apr 2015 19:56:54 +0200 Subject: [PATCH 05/15] formatting --- .../medical/functions/fnc_actionDropUnit.sqf | 4 +- .../functions/fnc_actionRemoveTourniquet.sqf | 3 - addons/medical/functions/fnc_copyDeadBody.sqf | 4 +- .../functions/fnc_dropDownTriageCard.sqf | 10 +- .../functions/fnc_handleBandageOpening.sqf | 108 +++++++++--------- addons/medical/functions/fnc_handleKilled.sqf | 10 +- .../functions/fnc_onCarryObjectDropped.sqf | 2 +- .../functions/fnc_onWoundUpdateRequest.sqf | 8 +- .../fnc_treatmentAdvanced_bandage.sqf | 2 +- .../functions/fnc_treatmentBasic_epipen.sqf | 2 +- .../functions/fnc_treatmentIVLocal.sqf | 4 +- .../functions/fnc_treatment_failure.sqf | 4 +- .../functions/fnc_treatment_success.sqf | 2 +- 13 files changed, 80 insertions(+), 83 deletions(-) diff --git a/addons/medical/functions/fnc_actionDropUnit.sqf b/addons/medical/functions/fnc_actionDropUnit.sqf index db1c02aced..53883c93c1 100644 --- a/addons/medical/functions/fnc_actionDropUnit.sqf +++ b/addons/medical/functions/fnc_actionDropUnit.sqf @@ -17,7 +17,7 @@ private "_caller"; _caller = _this select 0; if (!isnil QGVAR(DROP_ADDACTION)) then { - [_caller,objNull] call EFUNC(common,carryObj); - _caller removeAction GVAR(DROP_ADDACTION); + [_caller,objNull] call EFUNC(common,carryObj); + _caller removeAction GVAR(DROP_ADDACTION); GVAR(DROP_ADDACTION) = nil; }; diff --git a/addons/medical/functions/fnc_actionRemoveTourniquet.sqf b/addons/medical/functions/fnc_actionRemoveTourniquet.sqf index 75d7b67daa..2eafe36732 100644 --- a/addons/medical/functions/fnc_actionRemoveTourniquet.sqf +++ b/addons/medical/functions/fnc_actionRemoveTourniquet.sqf @@ -26,7 +26,6 @@ _tourniquets = _target getvariable [QGVAR(tourniquets), [0,0,0,0,0,0]]; // Check if there is a tourniquet on this bodypart if ((_tourniquets select _part) == 0) exitwith { - // TODO localization _output = "There is no tourniquet on this body part!"; ["displayTextStructured", [_caller], [_output, 1.5, _caller]] call EFUNC(common,targetEvent); }; @@ -37,5 +36,3 @@ _target setvariable [QGVAR(tourniquets), _tourniquets, true]; // Adding the tourniquet item to the caller _caller addItem "ACE_tourniquet"; - -// "AinvPknlMstpSlayWrflDnon_medic diff --git a/addons/medical/functions/fnc_copyDeadBody.sqf b/addons/medical/functions/fnc_copyDeadBody.sqf index 68d5a356ec..8e476b8662 100644 --- a/addons/medical/functions/fnc_copyDeadBody.sqf +++ b/addons/medical/functions/fnc_copyDeadBody.sqf @@ -67,9 +67,9 @@ _newUnit selectWeapon (primaryWeapon _newUnit); // We are attaching the old unit and hiding it, so we can keep the original unit until later. _oldBody attachTo [_newUnit, [0,0,0]]; if (isMultiplayer) then { - hideObjectGlobal _oldBody; + hideObjectGlobal _oldBody; } else { - hideObject _oldBody; + hideObject _oldBody; }; _newUnit setvariable [QGVAR(copyOfUnit), _oldBody, true]; diff --git a/addons/medical/functions/fnc_dropDownTriageCard.sqf b/addons/medical/functions/fnc_dropDownTriageCard.sqf index 5e763822db..6ea910b7af 100644 --- a/addons/medical/functions/fnc_dropDownTriageCard.sqf +++ b/addons/medical/functions/fnc_dropDownTriageCard.sqf @@ -22,11 +22,11 @@ if (isnil "_display") exitwith {}; _pos = [0,0,0,0]; if (_show) then { - _pos = ctrlPosition (_display displayCtrl 2001); + _pos = ctrlPosition (_display displayCtrl 2001); }; for "_idc" from 2002 to 2006 step 1 do { - _pos set [1, (_pos select 1) + (_pos select 3)]; - _ctrl = (_display displayCtrl _idc); - _ctrl ctrlSetPosition _pos; - _ctrl ctrlCommit 0; + _pos set [1, (_pos select 1) + (_pos select 3)]; + _ctrl = (_display displayCtrl _idc); + _ctrl ctrlSetPosition _pos; + _ctrl ctrlCommit 0; }; diff --git a/addons/medical/functions/fnc_handleBandageOpening.sqf b/addons/medical/functions/fnc_handleBandageOpening.sqf index eb35b3e8c5..b4e40984ae 100644 --- a/addons/medical/functions/fnc_handleBandageOpening.sqf +++ b/addons/medical/functions/fnc_handleBandageOpening.sqf @@ -38,81 +38,81 @@ _reopeningMaxDelay = 200; _config = (ConfigFile >> "ACE_Medical_Advanced" >> "Treatment" >> "Bandaging"); if (isClass (_config >> _bandage)) then { _config = (_config >> _bandage); - _reopeningChance = getNumber (_config >> "reopeningChance"); - _reopeningMinDelay = getNumber (_config >> "reopeningMinDelay"); - _reopeningMaxDelay = getNumber (_config >> "reopeningMaxDelay") max _reopeningMinDelay; + _reopeningChance = getNumber (_config >> "reopeningChance"); + _reopeningMinDelay = getNumber (_config >> "reopeningMinDelay"); + _reopeningMaxDelay = getNumber (_config >> "reopeningMaxDelay") max _reopeningMinDelay; }; if (isClass (_config >> _className)) then { _woundTreatmentConfig = (_config >> _className); if (isNumber (_woundTreatmentConfig >> "reopeningChance")) then { - _reopeningChance = getNumber (_woundTreatmentConfig >> "reopeningChance"); - }; + _reopeningChance = getNumber (_woundTreatmentConfig >> "reopeningChance"); + }; if (isNumber (_woundTreatmentConfig >> "reopeningMinDelay")) then { - _reopeningMinDelay = getNumber (_woundTreatmentConfig >> "reopeningMinDelay"); - }; + _reopeningMinDelay = getNumber (_woundTreatmentConfig >> "reopeningMinDelay"); + }; if (isNumber (_woundTreatmentConfig >> "reopeningMaxDelay")) then { - _reopeningMaxDelay = getNumber (_woundTreatmentConfig >> "reopeningMaxDelay") max _reopeningMinDelay; - }; + _reopeningMaxDelay = getNumber (_woundTreatmentConfig >> "reopeningMaxDelay") max _reopeningMinDelay; + }; }; _bandagedWounds = _target getvariable [QGVAR(bandagedWounds), []]; _exist = false; _injuryId = _injury select 0; { - if ((_x select 0) == _injuryId) exitwith { - _exist = true; - _existingInjury = _x; - _existingInjury set [3, (_existingInjury select 3) + _impact]; - _bandagedWounds set [_foreachIndex, _existingInjury]; - }; + if ((_x select 0) == _injuryId) exitwith { + _exist = true; + _existingInjury = _x; + _existingInjury set [3, (_existingInjury select 3) + _impact]; + _bandagedWounds set [_foreachIndex, _existingInjury]; + }; }foreach _bandagedWounds; if !(_exist) then { - // [ID, classID, bodypart, percentage treated, bloodloss rate] - _bandagedWounds pushback [_injuryId, _injury select 1, _injury select 2, _impact, _injury select 4]; + // [ID, classID, bodypart, percentage treated, bloodloss rate] + _bandagedWounds pushback [_injuryId, _injury select 1, _injury select 2, _impact, _injury select 4]; }; _target setvariable [QGVAR(bandagedWounds), _bandagedWounds, true]; // Check if we are ever going to reopen this if (random(1) <= _reopeningChance) then { - _delay = _reopeningMinDelay + random(_reopeningMaxDelay - _reopeningMinDelay); - [{ - private ["_target", "_impact", "_part", "_injuryIndex", "_bandage", "_injury", "_openWounds", "_selectedInjury","_bandagedWounds","_exist"]; - _target = _this select 0; - _impact = _this select 1; - _part = _this select 2; - _injuryIndex = _this select 3; - _injury = _this select 4; + _delay = _reopeningMinDelay + random(_reopeningMaxDelay - _reopeningMinDelay); + [{ + private ["_target", "_impact", "_part", "_injuryIndex", "_bandage", "_injury", "_openWounds", "_selectedInjury","_bandagedWounds","_exist"]; + _target = _this select 0; + _impact = _this select 1; + _part = _this select 2; + _injuryIndex = _this select 3; + _injury = _this select 4; - if (alive _target) then { - _openWounds = _target getvariable [QGVAR(openWounds), []]; - if ((count _openWounds)-1 < _injuryIndex) exitwith {}; - _selectedInjury = _openWounds select _injuryIndex; - if (_selectedInjury select 0 == _injury select 0) then { // matching the IDs - _selectedInjury set [3, (_selectedInjury select 3) + _impact]; - _openWounds set [_injuryIndex, _selectedInjury]; - _target setvariable [QGVAR(openWounds), _openWounds, !USE_WOUND_EVENT_SYNC]; - if (USE_WOUND_EVENT_SYNC) then { - ["medical_propagateWound", [_target, _selectedInjury]] call EFUNC(common,globalEvent); - }; - _bandagedWounds = _target getvariable [QGVAR(bandagedWounds), []]; - _exist = false; - _injuryId = _injury select 0; - { - if ((_x select 0) == _injuryId) exitwith { - _exist = true; - _existingInjury = _x; - _existingInjury set [3, ((_existingInjury select 3) - _impact) max 0]; - _bandagedWounds set [_foreachIndex, _existingInjury]; - }; - }foreach _bandagedWounds; + if (alive _target) then { + _openWounds = _target getvariable [QGVAR(openWounds), []]; + if ((count _openWounds)-1 < _injuryIndex) exitwith {}; + _selectedInjury = _openWounds select _injuryIndex; + if (_selectedInjury select 0 == _injury select 0) then { // matching the IDs + _selectedInjury set [3, (_selectedInjury select 3) + _impact]; + _openWounds set [_injuryIndex, _selectedInjury]; + _target setvariable [QGVAR(openWounds), _openWounds, !USE_WOUND_EVENT_SYNC]; + if (USE_WOUND_EVENT_SYNC) then { + ["medical_propagateWound", [_target, _selectedInjury]] call EFUNC(common,globalEvent); + }; + _bandagedWounds = _target getvariable [QGVAR(bandagedWounds), []]; + _exist = false; + _injuryId = _injury select 0; + { + if ((_x select 0) == _injuryId) exitwith { + _exist = true; + _existingInjury = _x; + _existingInjury set [3, ((_existingInjury select 3) - _impact) max 0]; + _bandagedWounds set [_foreachIndex, _existingInjury]; + }; + }foreach _bandagedWounds; - if (_exist) then { - _target setvariable [QGVAR(bandagedWounds), _bandagedWounds, true]; - }; - }; - // Otherwise something went wrong, we we don't reopen them.. - }; - }, [_target, _impact, _part, _injuryIndex, _injury], _delay, 0] call EFUNC(common,waitAndExecute); + if (_exist) then { + _target setvariable [QGVAR(bandagedWounds), _bandagedWounds, true]; + }; + }; + // Otherwise something went wrong, we we don't reopen them.. + }; + }, [_target, _impact, _part, _injuryIndex, _injury], _delay, 0] call EFUNC(common,waitAndExecute); }; diff --git a/addons/medical/functions/fnc_handleKilled.sqf b/addons/medical/functions/fnc_handleKilled.sqf index 1a602bd702..ce0f087836 100644 --- a/addons/medical/functions/fnc_handleKilled.sqf +++ b/addons/medical/functions/fnc_handleKilled.sqf @@ -24,9 +24,9 @@ if (GVAR(level) >= 2) then { _unit setvariable [QGVAR(airwayStatus), 0]; if (USE_WOUND_EVENT_SYNC) then { - _openWounds = _unit getvariable [QGVAR(openWounds), []]; - { - ["medical_propagateWound", [_unit, _x]] call EFUNC(common,globalEvent); - }foreach _openWounds; - }; + _openWounds = _unit getvariable [QGVAR(openWounds), []]; + { + ["medical_propagateWound", [_unit, _x]] call EFUNC(common,globalEvent); + }foreach _openWounds; + }; }; diff --git a/addons/medical/functions/fnc_onCarryObjectDropped.sqf b/addons/medical/functions/fnc_onCarryObjectDropped.sqf index 8f6dd57310..6a6a990d53 100644 --- a/addons/medical/functions/fnc_onCarryObjectDropped.sqf +++ b/addons/medical/functions/fnc_onCarryObjectDropped.sqf @@ -33,7 +33,7 @@ if (_carrying >= 0) then { _target setvariable [QGVAR(hasCopy), nil, true]; }; - _caller setvariable [QGVAR(isCarrying), -1, true]; + _caller setvariable [QGVAR(isCarrying), -1, true]; if (primaryWeapon _caller == "ACE_FakePrimaryWeapon") then { _caller removeWeapon "ACE_FakePrimaryWeapon"; }; diff --git a/addons/medical/functions/fnc_onWoundUpdateRequest.sqf b/addons/medical/functions/fnc_onWoundUpdateRequest.sqf index a32288d0a6..c160e47ea0 100644 --- a/addons/medical/functions/fnc_onWoundUpdateRequest.sqf +++ b/addons/medical/functions/fnc_onWoundUpdateRequest.sqf @@ -20,8 +20,8 @@ _lastId = _this select 1; _originOfrequest = _this select 2; if (local _unit) then { - _openWounds = _unit getvariable [QGVAR(openWounds), []]; - { - ["medical_propagateWound", [_originOfrequest], [_unit, _x]] call EFUNC(common,targetEvent); - }foreach _openWounds; + _openWounds = _unit getvariable [QGVAR(openWounds), []]; + { + ["medical_propagateWound", [_originOfrequest], [_unit, _x]] call EFUNC(common,targetEvent); + }foreach _openWounds; }; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf b/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf index 91ae7f61c1..146e996d25 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf @@ -27,7 +27,7 @@ _items = _this select 4; _specificSpot = if (count _this > 6) then {_this select 6} else {-1}; if !([_target] call FUNC(hasMedicalEnabled)) exitwith { - _this call FUNC(treatmentBasic_bandage); + _this call FUNC(treatmentBasic_bandage); }; [[_target, _className, _selectionName, _specificSpot], QUOTE(DFUNC(treatmentAdvanced_bandageLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ diff --git a/addons/medical/functions/fnc_treatmentBasic_epipen.sqf b/addons/medical/functions/fnc_treatmentBasic_epipen.sqf index ead2bf9d52..bdfb95fb2a 100644 --- a/addons/medical/functions/fnc_treatmentBasic_epipen.sqf +++ b/addons/medical/functions/fnc_treatmentBasic_epipen.sqf @@ -24,5 +24,5 @@ _className = _this select 3; [_target, false] call FUNC(setUnconscious); if (_target getvariable [QGVAR(inReviveState), false]) then { - _target setvariable [QGVAR(inReviveState), nil, true]; + _target setvariable [QGVAR(inReviveState), nil, true]; }; diff --git a/addons/medical/functions/fnc_treatmentIVLocal.sqf b/addons/medical/functions/fnc_treatmentIVLocal.sqf index b0b5ce6a7f..66ecdf9d90 100644 --- a/addons/medical/functions/fnc_treatmentIVLocal.sqf +++ b/addons/medical/functions/fnc_treatmentIVLocal.sqf @@ -37,6 +37,6 @@ _varName = format["ACE_Medical_IVVolume_%1",_typeOf]; _target setvariable [_varName, (_target getvariable [_varName, 0]) + _volumeAdded, true]; if !(_varName in GVAR(IVBags)) then { - GVAR(IVBags) pushback _varName; - publicVariable QGVAR(IVBags); + GVAR(IVBags) pushback _varName; + publicVariable QGVAR(IVBags); }; diff --git a/addons/medical/functions/fnc_treatment_failure.sqf b/addons/medical/functions/fnc_treatment_failure.sqf index 1a22e191fd..d4f853374c 100644 --- a/addons/medical/functions/fnc_treatment_failure.sqf +++ b/addons/medical/functions/fnc_treatment_failure.sqf @@ -30,12 +30,12 @@ if (primaryWeapon _caller == "ACE_FakePrimaryWeapon") then { _caller removeWeapon "ACE_FakePrimaryWeapon"; }; if (vehicle _caller == _caller) then { - [_caller, _caller getvariable [QGVAR(treatmentPrevAnimCaller), ""], 1] call EFUNC(common,doAnimation); + [_caller, _caller getvariable [QGVAR(treatmentPrevAnimCaller), ""], 1] call EFUNC(common,doAnimation); }; _caller setvariable [QGVAR(treatmentPrevAnimCaller), nil]; { - (_x select 0) addItem (_x select 1); + (_x select 0) addItem (_x select 1); }foreach _usersOfItems; // Record specific callback diff --git a/addons/medical/functions/fnc_treatment_success.sqf b/addons/medical/functions/fnc_treatment_success.sqf index 85cfbf7e52..5910a4be86 100644 --- a/addons/medical/functions/fnc_treatment_success.sqf +++ b/addons/medical/functions/fnc_treatment_success.sqf @@ -28,7 +28,7 @@ if (primaryWeapon _caller == "ACE_FakePrimaryWeapon") then { _caller removeWeapon "ACE_FakePrimaryWeapon"; }; if (vehicle _caller == _caller) then { - [_caller, _caller getvariable [QGVAR(treatmentPrevAnimCaller), ""], 1] call EFUNC(common,doAnimation); + [_caller, _caller getvariable [QGVAR(treatmentPrevAnimCaller), ""], 1] call EFUNC(common,doAnimation); }; _caller setvariable [QGVAR(treatmentPrevAnimCaller), nil]; From ac3bda31355d0aa37c92e45bb148fd45af681fd2 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Tue, 7 Apr 2015 20:19:32 +0200 Subject: [PATCH 06/15] improvements to displayPatientInformation. Bandaged wounds should be more clear now --- .../fnc_displayPatientInformation.sqf | 50 +++++++++++-------- 1 file changed, 29 insertions(+), 21 deletions(-) diff --git a/addons/medical/functions/fnc_displayPatientInformation.sqf b/addons/medical/functions/fnc_displayPatientInformation.sqf index 599c2f344f..2e0525f1a3 100644 --- a/addons/medical/functions/fnc_displayPatientInformation.sqf +++ b/addons/medical/functions/fnc_displayPatientInformation.sqf @@ -14,11 +14,12 @@ #include "script_component.hpp" -private ["_target", "_show"]; +private ["_target", "_show", "_selectionN"]; _target = _this select 0; _show = if (count _this > 1) then {_this select 1} else {true}; -GVAR(currentSelectedSelectionN) = if (count _this > 2) then {_this select 2} else {0}; +_selectionN = if (count _this > 2) then {_this select 2} else {0}; +GVAR(currentSelectedSelectionN) = if (typeName _selectionN == "SCALAR") then {_selectionN} else {0}; GVAR(displayPatientInformationTarget) = if (_show) then {_target} else {ObjNull}; if (USE_WOUND_EVENT_SYNC) then { @@ -75,6 +76,7 @@ if (_show) then { _genericMessages pushback [format[localize "STR_ACE_MEDICAL_receivingIvVolume", floor _totalIvVolume], [1, 1, 1, 1]]; }; + _damaged = [false, false, false, false, false, false]; _selectionBloodLoss = [0,0,0,0,0,0]; if (GVAR(level) >= 2) then { _openWounds = _target getvariable [QGVAR(openWounds), []]; @@ -82,10 +84,12 @@ if (_show) then { { _amountOf = _x select 3; // Find how much this bodypart is bleeding - _selectionBloodLoss set [(_x select 2), (_selectionBloodLoss select (_x select 2)) + (15 * ((_x select 4) * _amountOf))]; - if (GVAR(currentSelectedSelectionN) == (_x select 2)) then { + if (_amountOf > 0) then { + _damaged set[_x select 2, true]; + _selectionBloodLoss set [(_x select 2), (_selectionBloodLoss select (_x select 2)) + (20 * ((_x select 4) * _amountOf))]; + + if (_selectionN == (_x select 2)) then { // Collect the text to be displayed for this injury [ Select injury class type definition - select the classname DisplayName (6th), amount of injuries for this] - if (_amountOf > 0) then { if (_amountOf >= 1) then { // TODO localization _allInjuryTexts pushback [format["%2x %1", (GVAR(AllWoundInjuryTypes) select (_x select 1)) select 6, _amountOf], [1,1,1,1]]; @@ -101,27 +105,28 @@ if (_show) then { { _amountOf = _x select 3; // Find how much this bodypart is bleeding - //if (_selectionBloodLoss select (_x select 2) == 0) then { - // _selectionBloodLoss set [(_x select 2), (_selectionBloodLoss select (_x select 2)) + (15 * ((_x select 4) * _amountOf))]; - //}; - if (GVAR(currentSelectedSelectionN) == (_x select 2)) then { + if !(_damaged select (_x select 2)) then { + _selectionBloodLoss set [(_x select 2), (_selectionBloodLoss select (_x select 2)) + (20 * ((_x select 4) * _amountOf))]; + }; + if (_selectionN == (_x select 2)) then { // Collect the text to be displayed for this injury [ Select injury class type definition - select the classname DisplayName (6th), amount of injuries for this] if (_amountOf > 0) then { if (_amountOf >= 1) then { // TODO localization - _allInjuryTexts pushback [format["[B] %2x %1", (GVAR(AllWoundInjuryTypes) select (_x select 1)) select 6, _amountOf], [1,0.5,0.5,1]]; + _allInjuryTexts pushback [format["[B] %2x %1", (GVAR(AllWoundInjuryTypes) select (_x select 1)) select 6, _amountOf], [0.88,0.7,0.65,1]]; } else { // TODO localization - _allInjuryTexts pushback [format["[B] Partial %1", (GVAR(AllWoundInjuryTypes) select (_x select 1)) select 6], [1,0.5,0.5,1]]; + _allInjuryTexts pushback [format["[B] Partial %1", (GVAR(AllWoundInjuryTypes) select (_x select 1)) select 6], [0.88,0.7,0.65,1]]; }; }; }; }foreach _bandagedwounds; } else { + _damaged = [true, true, true, true, true, true]; { _selectionBloodLoss set [_forEachIndex, _target getHitPointDamage _x]; - if (_target getHitPointDamage _x > 0.1) then { + if (_target getHitPointDamage _x > 0.1 && {_forEachIndex == _selectionN}) then { // @todo localize _allInjuryTexts pushBack [format ["%1 %2", ["Lightly wounded", "Heavily wounded"] select (_target getHitPointDamage _x > 0.5), @@ -132,7 +137,7 @@ if (_show) then { }; // Handle the body image coloring - _damaged = [false, false, false, false, false, false]; + _availableSelections = [50,51,52,53,54,55]; { private ["_red", "_green", "_blue"]; @@ -141,27 +146,30 @@ if (_show) then { _red = 1; _green = 1; _blue = 1; - if (_total >0) then { - _green = 0.9 - _total; - if (_green < 0.0) then { - _green = 0.0; + if (_total > 0) then { + if (_damaged select _forEachIndex) then { + _green = (0.9 - _total) max 0; + _blue = _green; + } else { + _green = (0.9 - _total) max 0; + _red = _green; + //_blue = _green; }; - _blue = _green; - _damaged set[_foreachIndex, true]; }; (_display displayCtrl (_availableSelections select _foreachIndex)) ctrlSetTextColor [_red, _green, _blue, 1.0]; }foreach _selectionBloodLoss; - // TODO fill the lb with the appropiate information for the patient _lbCtrl = (_display displayCtrl 200); lbClear _lbCtrl; { _lbCtrl lbAdd (_x select 0); _lbCtrl lbSetColor [_foreachIndex, _x select 1]; }foreach _genericMessages; + + _amountOfGeneric = count _genericMessages; { _lbCtrl lbAdd (_x select 0); - _lbCtrl lbSetColor [_foreachIndex, _x select 1]; + _lbCtrl lbSetColor [_foreachIndex + _amountOfGeneric, _x select 1]; }foreach _allInjuryTexts; if (count _allInjuryTexts == 0) then { _lbCtrl lbAdd "No injuries on this bodypart.."; From 545014b07391c2cbcfb7ed1b0fd57664158c1cd6 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Tue, 7 Apr 2015 20:47:36 +0200 Subject: [PATCH 07/15] missing return value --- addons/medical/functions/fnc_determineIfFatal.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical/functions/fnc_determineIfFatal.sqf b/addons/medical/functions/fnc_determineIfFatal.sqf index 978aa16b2b..6c90e54da3 100644 --- a/addons/medical/functions/fnc_determineIfFatal.sqf +++ b/addons/medical/functions/fnc_determineIfFatal.sqf @@ -16,7 +16,7 @@ _part = _this select 1; _withDamage = if (count _this > 2) then { _this select 2} else {0}; if (!alive _unit) exitwith {true}; -if (_part < 0 || _part > 5) exitwith {}; +if (_part < 0 || _part > 5) exitwith {false}; if ((vehicle _unit != _unit) && {!alive (vehicle _unit)}) exitwith { true }; // Find the correct Damage threshold for unit. From 2b341c2a8b5b55f4d1bf877dabaa78145c40ff61 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Tue, 7 Apr 2015 20:50:44 +0200 Subject: [PATCH 08/15] left over CSE function calls removed --- addons/medical/functions/fnc_actionLoadUnit.sqf | 3 --- 1 file changed, 3 deletions(-) diff --git a/addons/medical/functions/fnc_actionLoadUnit.sqf b/addons/medical/functions/fnc_actionLoadUnit.sqf index 7f55d585d6..b4320d8d73 100644 --- a/addons/medical/functions/fnc_actionLoadUnit.sqf +++ b/addons/medical/functions/fnc_actionLoadUnit.sqf @@ -23,9 +23,6 @@ if ([_target] call EFUNC(common,isAwake)) exitwith { ["displayTextStructured", [_caller], [["This person (%1) is awake and cannot be loaded", [_target] call EFUNC(common,getName)], 1.5, _caller]] call EFUNC(common,targetEvent); }; -[_caller, objNull] call cse_fnc_carryObj; -[_target, objNull] call cse_fnc_carryObj; - _vehicle = [_caller, _target] call EFUNC(common,loadPerson); if (!isNull _vehicle) then { if (!isnil QGVAR(DROP_ADDACTION)) then { From c72dd39691637ae3fc57f68fff5651726afeae29 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 7 Apr 2015 13:53:40 -0500 Subject: [PATCH 09/15] Build script: use cmd line cfgConvert --- .../pabstFrankensteinBuilder.py | 38 ++++++++----------- 1 file changed, 15 insertions(+), 23 deletions(-) diff --git a/tools/ace_build_tool/pabstFrankensteinBuilder.py b/tools/ace_build_tool/pabstFrankensteinBuilder.py index a0c57f2b3e..09b12a5dc3 100644 --- a/tools/ace_build_tool/pabstFrankensteinBuilder.py +++ b/tools/ace_build_tool/pabstFrankensteinBuilder.py @@ -576,33 +576,25 @@ See the make.cfg file for additional build options. if build_tool == "pboproject": try: #PABST: Convert config (run the macro'd config.cpp through CfgConvert twice to produce a de-macro'd cpp that pboProject can read without fucking up: - os.chdir(os.path.join(arma3tools_path, "CfgConvert")) shutil.copyfile(os.path.join(work_drive, prefix, module, "config.cpp"), os.path.join(work_drive, prefix, module, "config.backup")) - ret = subprocess.call(["cfgConvertGUI.exe", os.path.join(work_drive, prefix, module, "config.cpp")]) - if ret != 0: - print_error("cfgConvertGUI (bin) return code == " + str(ret)) - input("Press Enter to continue...") - - #PABST: Need micro sleeps because cfgConvertGUI can return before it's finished procressing - time.sleep(0.05) - - ret = subprocess.call(["cfgConvertGUI.exe", os.path.join(work_drive, prefix, module, "config.bin")]) - if ret != 0: - print_error("cfgConvertGUI (txt) return code == " + str(ret)) - input("Press Enter to continue...") - - time.sleep(0.05) - - #cmd = [rapifyTool, "-L", "-P", os.path.join(work_drive, prefix, module, "config.cpp")]; - #ret = subprocess.call(cmd) - #if ret != 0: - # print_error("rapifyTool return code == " + str(ret) + str(cmd)) - # input("Press Enter to continue...") - - # Call pboProject os.chdir("P:\\") + cmd = [os.path.join(work_drive, "CfgConvert", "CfgConvert.exe"), "-bin", "-dst", os.path.join(work_drive, prefix, module, "config.bin"), os.path.join(work_drive, prefix, module, "config.cpp")] + ret = subprocess.call(cmd) + #ret = subprocess.call(["cfgConvertGUI.exe", os.path.join(work_drive, prefix, module, "config.cpp")]) + + if ret != 0: + print_error("CfgConvert -bin return code == " + str(ret)) + input("Press Enter to continue...") + + + cmd = [os.path.join(work_drive, "CfgConvert", "CfgConvert.exe"), "-txt", "-dst", os.path.join(work_drive, prefix, module, "config.cpp"), os.path.join(work_drive, prefix, module, "config.bin")] + ret = subprocess.call(cmd) + if ret != 0: + print_error("CfgConvert -txt) return code == " + str(ret)) + input("Press Enter to continue...") + if os.path.isfile(os.path.join(work_drive, prefix, module, "$NOBIN$")): print_green("$NOBIN$ Found. Proceeding with non-binarizing!") cmd = [makepboTool, "-P","-A","-L","-N","-G", os.path.join(work_drive, prefix, module),os.path.join(module_root, release_dir, project,"Addons")] From 722c2af4dc2b37056cf6054764837ac2ab15d40f Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 7 Apr 2015 20:54:25 +0200 Subject: [PATCH 10/15] lightIntensity, handle soldier flashlights --- addons/common/XEH_preInit.sqf | 1 + .../fnc_getLightPropertiesWeapon.sqf | 58 ++++++++++++++ .../fnc_lightIntensityFromObject.sqf | 75 +++++++++++++++---- 3 files changed, 118 insertions(+), 16 deletions(-) create mode 100644 addons/common/functions/fnc_getLightPropertiesWeapon.sqf diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index 95a639b943..b7da27ea75 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -193,6 +193,7 @@ PREP(getHitPoints); PREP(getHitPointsWithSelections); PREP(getReflectorsWithSelections); PREP(getLightProperties); +PREP(getLightPropertiesWeapon); PREP(getVehicleCrew); // turrets diff --git a/addons/common/functions/fnc_getLightPropertiesWeapon.sqf b/addons/common/functions/fnc_getLightPropertiesWeapon.sqf new file mode 100644 index 0000000000..d444654b5f --- /dev/null +++ b/addons/common/functions/fnc_getLightPropertiesWeapon.sqf @@ -0,0 +1,58 @@ +/* + * Author: commy2 + * Read properties of given flashlight. @todo, Can weapons themselves still have flashlights (no attachment)? + * + * Arguments: + * 0: A flashlight (String) + * + * Return Value: + * Stuff from config (Array) + * + */ +#include "script_component.hpp" + +private "_weapon"; + +_weapon = _this select 0; + +private "_config"; +_config = configFile >> "CfgWeapons" >> _weapon >> "ItemInfo" >> "FlashLight"; + +private ["_intensity", "_position", "_direction", "_innerAngle", "_outerAngle"]; + +_intensity = getNumber (_config >> "intensity"); +_position = getText (_config >> "position"); +_direction = getText (_config >> "direction"); +_innerAngle = getNumber (_config >> "innerAngle"); +_outerAngle = getNumber (_config >> "outerAngle"); + +[_intensity, _position, _direction, _innerAngle, _outerAngle] + +/* +class FlashLight +{ + color[] = {180,156,120}; + ambient[] = {0.9,0.78,0.6}; + intensity = 20; + size = 1; + innerAngle = 20; + outerAngle = 80; + coneFadeCoef = 5; + position = "flash dir"; + direction = "flash"; + useFlare = 1; + flareSize = 1.4; + flareMaxDistance = "100.0f"; + dayLight = 0; + class Attenuation + { + start = 0.5; + constant = 0; + linear = 0; + quadratic = 1.1; + hardLimitStart = 20; + hardLimitEnd = 30; + }; + scale[] = {0}; +}; +*/ diff --git a/addons/common/functions/fnc_lightIntensityFromObject.sqf b/addons/common/functions/fnc_lightIntensityFromObject.sqf index cf9e215403..1a79ceb211 100644 --- a/addons/common/functions/fnc_lightIntensityFromObject.sqf +++ b/addons/common/functions/fnc_lightIntensityFromObject.sqf @@ -20,37 +20,80 @@ _lightSource = _this select 1; private "_unitPos"; _unitPos = _unit modelToWorld (_unit selectionPosition "spine3"); -private ["_lights", "_lightLevel"]; - -_lights = [_lightSource] call FUNC(getTurnedOnLights); - +private "_lightLevel"; _lightLevel = 0; -{ - private ["_properties", "_intensity", "_innerAngle", "_outerAngle", "_position", "_direction", "_directionToUnit", "_distance", "_angle"]; +if (_lightSource isKindOf "CAManBase") then { + // handle persons with flashlights - _properties = [_lightSource, _x] call FUNC(getLightProperties); + private "_weapon"; + _weapon = currentWeapon _lightSource; - // @todo intensity affects range? - //_intensity = _properties select 0; + if !(_lightSource isFlashlightOn _weapon) exitWith {}; + + private ["_flashlight", "_properties", "_intensity", "_innerAngle", "_outerAngle", "_position", "_direction", "_directionToUnit", "_distance", "_angle"]; + + _flashlight = switch (_weapon) do { + case (primaryWeapon _lightSource): { + primaryWeaponItems _lightSource select 1 + }; + case (secondaryWeapon _lightSource): { + secondaryWeaponItems _lightSource select 1 + }; + case (handgunWeapon _lightSource): { + handgunItems _lightSource select 1 + }; + default {""}; + }; + + _properties = [_flashlight] call FUNC(getLightPropertiesWeapon); _innerAngle = (_properties select 3) / 2; _outerAngle = (_properties select 4) / 2; - // get world position and direction - _position = _lightSource modelToWorld (_lightSource selectionPosition (_properties select 1)); - _direction = _lightSource modelToWorld (_lightSource selectionPosition (_properties select 2)); + _position = _lightSource modelToWorld (_lightSource selectionPosition "rightHand"); + _direction = _lightSource weaponDirection _weapon; - _direction = _position vectorFromTo _direction; _directionToUnit = _position vectorFromTo _unitPos; _distance = _unitPos distance _position; _angle = acos (_direction vectorDotProduct _directionToUnit); - _lightLevel = _lightLevel max ((linearConversion [0, 30, _distance, 1, 0, true]) * (linearConversion [_innerAngle, _outerAngle, _angle, 1, 0, true])); + _lightLevel = (linearConversion [0, 30, _distance, 1, 0, true]) * (linearConversion [_innerAngle, _outerAngle, _angle, 1, 0, true]); -//systemChat format ["%1 %2", (linearConversion [0, 30, _distance, 1, 0, true]), (linearConversion [_innerAngle, _outerAngle, _angle, 1, 0, true])]; +} else { + // handle any object, strcutures, cars, tanks, etc. -} forEach _lights; + private "_lights"; + _lights = [_lightSource] call FUNC(getTurnedOnLights); + + { + private ["_properties", "_intensity", "_innerAngle", "_outerAngle", "_position", "_direction", "_directionToUnit", "_distance", "_angle"]; + + _properties = [_lightSource, _x] call FUNC(getLightProperties); + + // @todo intensity affects range? + //_intensity = _properties select 0; + + _innerAngle = (_properties select 3) / 2; + _outerAngle = (_properties select 4) / 2; + + // get world position and direction + _position = _lightSource modelToWorld (_lightSource selectionPosition (_properties select 1)); + _direction = _lightSource modelToWorld (_lightSource selectionPosition (_properties select 2)); + + _direction = _position vectorFromTo _direction; + _directionToUnit = _position vectorFromTo _unitPos; + + _distance = _unitPos distance _position; + _angle = acos (_direction vectorDotProduct _directionToUnit); + + _lightLevel = _lightLevel max ((linearConversion [0, 30, _distance, 1, 0, true]) * (linearConversion [_innerAngle, _outerAngle, _angle, 1, 0, true])); + + //systemChat format ["%1 %2", (linearConversion [0, 30, _distance, 1, 0, true]), (linearConversion [_innerAngle, _outerAngle, _angle, 1, 0, true])]; + + } forEach _lights; + +}; _lightLevel From ffbe9f0c71e82248d6aab7f9b0b52222a1ec3b57 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Tue, 7 Apr 2015 21:06:48 +0200 Subject: [PATCH 11/15] Setting for getting rid of hitpoint damage after adv medical damage --- addons/medical/ACE_Settings.hpp | 4 ++++ .../functions/fnc_treatmentAdvanced_bandageLocal.sqf | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/addons/medical/ACE_Settings.hpp b/addons/medical/ACE_Settings.hpp index 0af12c0a37..4d2f2db9be 100644 --- a/addons/medical/ACE_Settings.hpp +++ b/addons/medical/ACE_Settings.hpp @@ -113,4 +113,8 @@ class ACE_Settings { typeName = "BOOL"; value = 1; }; + class GVAR(healHitPointAfterAdvBandage) { + typeName = "BOOL"; + value = 1; + }; }; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf index 0eaa8b4fa8..217a69cd4d 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf @@ -96,8 +96,11 @@ if (_impact > 0 && {GVAR(enableAdvancedWounds)}) then { }; // If all wounds have been bandaged, we will reset all damage to 0, so the unit is not showing any blood on the model anymore. -if (count _openWounds == 0) then { - _target setDamage 0; +if (GVAR(healHitPointAfterAdvBandage) && {{(_x select 2) == _part && {_x select 3 > 0}}count _openWounds == 0}) then { + _hitSelections = ["head", "body", "hand_l", "hand_r", "leg_l", "leg_r"]; + _hitPoints = ["HitHead", "HitBody", "HitLeftArm", "HitRightArm", "HitLeftLeg", "HitRightLeg"]; + _point = _hitPoints select (_hitSelections find _selectionName); + [_target, _point, 0] call FUNC(setHitPointDamage); // _target setvariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0], true]; }; From d825505aa07318da5625260d49495a30c18c61c4 Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 7 Apr 2015 21:22:00 +0200 Subject: [PATCH 12/15] cache light config properties --- addons/common/functions/fnc_lightIntensityFromObject.sqf | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/common/functions/fnc_lightIntensityFromObject.sqf b/addons/common/functions/fnc_lightIntensityFromObject.sqf index 1a79ceb211..f9749ab8a0 100644 --- a/addons/common/functions/fnc_lightIntensityFromObject.sqf +++ b/addons/common/functions/fnc_lightIntensityFromObject.sqf @@ -46,7 +46,8 @@ if (_lightSource isKindOf "CAManBase") then { default {""}; }; - _properties = [_flashlight] call FUNC(getLightPropertiesWeapon); + _properties = [[_flashlight], FUNC(getLightPropertiesWeapon), uiNamespace, format [QEGVAR(cache,%1_%2), QUOTE(DFUNC(getLightPropertiesWeapon)), _flashlight], 1E11] call FUNC(cachedCall); + //_properties = [_flashlight] call FUNC(getLightPropertiesWeapon); _innerAngle = (_properties select 3) / 2; _outerAngle = (_properties select 4) / 2; @@ -70,7 +71,8 @@ if (_lightSource isKindOf "CAManBase") then { { private ["_properties", "_intensity", "_innerAngle", "_outerAngle", "_position", "_direction", "_directionToUnit", "_distance", "_angle"]; - _properties = [_lightSource, _x] call FUNC(getLightProperties); + _properties = [[_lightSource, _x], FUNC(getLightProperties), uiNamespace, format [QEGVAR(cache,%1_%2_%3), QUOTE(DFUNC(getLightProperties)), typeOf _lightSource, _x], 1E11] call FUNC(cachedCall); + //_properties = [_lightSource, _x] call FUNC(getLightProperties); // @todo intensity affects range? //_intensity = _properties select 0; From 88a5519465c90be3d7d79d0eb1be9293c06ac01c Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 7 Apr 2015 21:42:08 +0200 Subject: [PATCH 13/15] cache the frames --- addons/common/functions/fnc_getTurnedOnLights.sqf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/common/functions/fnc_getTurnedOnLights.sqf b/addons/common/functions/fnc_getTurnedOnLights.sqf index 6f0dc5a9bb..e50c15f593 100644 --- a/addons/common/functions/fnc_getTurnedOnLights.sqf +++ b/addons/common/functions/fnc_getTurnedOnLights.sqf @@ -19,7 +19,8 @@ if (!isLightOn _vehicle) exitWith {[]}; private ["_reflectorsWithSelections", "_lights", "_hitpoints"]; -_reflectorsWithSelections = [_vehicle] call FUNC(getReflectorsWithSelections); +_reflectorsWithSelections = [[_vehicle], FUNC(getReflectorsWithSelections), uiNamespace, format [QEGVAR(cache,%1_%2), QUOTE(DFUNC(getReflectorsWithSelections)), typeOf _vehicle], 1E11] call FUNC(cachedCall); +//_reflectorsWithSelections = [_vehicle] call FUNC(getReflectorsWithSelections); _lights = _reflectorsWithSelections select 0; _hitpoints = _reflectorsWithSelections select 1; From d1b8595c0ed938a88bbf21405ce0319f3456da24 Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 7 Apr 2015 23:02:54 +0200 Subject: [PATCH 14/15] light intensity from object: handle campfires --- addons/common/functions/fnc_lightIntensityFromObject.sqf | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/addons/common/functions/fnc_lightIntensityFromObject.sqf b/addons/common/functions/fnc_lightIntensityFromObject.sqf index f9749ab8a0..98e7935f9f 100644 --- a/addons/common/functions/fnc_lightIntensityFromObject.sqf +++ b/addons/common/functions/fnc_lightIntensityFromObject.sqf @@ -96,6 +96,14 @@ if (_lightSource isKindOf "CAManBase") then { } forEach _lights; + // handle campfires + if (inflamed _lightSource) then { + private "_distance"; + _distance = _unitPos distance position _lightSource; + + _lightLevel = _lightLevel max linearConversion [0, 30, _distance, 0.5, 0, true]; + }; + }; _lightLevel From 2f4335d3c28062579cb4aa541fea7ecab3dcc57c Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 7 Apr 2015 17:14:27 -0500 Subject: [PATCH 15/15] #344 - Ignore missing ace_serverconfig on client --- addons/common/scripts/Version/checkVersionNumber.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/common/scripts/Version/checkVersionNumber.sqf b/addons/common/scripts/Version/checkVersionNumber.sqf index 87b89a8b6b..467ebd9c1a 100644 --- a/addons/common/scripts/Version/checkVersionNumber.sqf +++ b/addons/common/scripts/Version/checkVersionNumber.sqf @@ -81,7 +81,7 @@ if (!isServer) then { _index = _files find _x; if (_index == -1) then { - _missingAddons pushBack _x; + if (_x != "ace_serverconfig") then {_missingAddons pushBack _x;}; } else { _clientVersion = _versions select _index;