From fde8f7383f4d4e63f4ff47e37b1cde4e0ac98fc0 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 28 Jun 2015 13:08:47 -0500 Subject: [PATCH 001/132] Map Opened/Closed Events + use in maptools --- addons/common/XEH_postInit.sqf | 18 ++++++++++ addons/maptools/XEH_postInitClient.sqf | 16 +++++++-- addons/maptools/XEH_preInit.sqf | 1 - .../functions/fnc_mapStateUpdater.sqf | 33 ------------------- .../functions/fnc_updateMapToolMarkers.sqf | 10 ++++++ 5 files changed, 42 insertions(+), 36 deletions(-) delete mode 100644 addons/maptools/functions/fnc_mapStateUpdater.sqf diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 3796a4fdc8..159ef1883a 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -353,5 +353,23 @@ GVAR(deviceKeyCurrentIndex) = -1; {false}, [0xC7, [true, false, false]], false] call cba_fnc_addKeybind; //SHIFT + Home Key +//Map opened/closed Events: +GVAR(mapOpened) = false; +[] spawn { + waitUntil {(!isNull findDisplay 12)}; + ((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["Draw", { + if (!GVAR(mapOpened)) then { + GVAR(mapOpened) = true; + ["mapOpened", []] call FUNC(localEvent); + [{ + if (!visibleMap) then { + GVAR(mapOpened) = false; + ["mapClosed", []] call FUNC(localEvent); + [_this select 1] call CBA_fnc_removePerFrameHandler; + }; + }, 0, []] call CBA_fnc_addPerFrameHandler; + }; + }]; +}; GVAR(commonPostInited) = true; diff --git a/addons/maptools/XEH_postInitClient.sqf b/addons/maptools/XEH_postInitClient.sqf index 8129a75b15..e227463711 100644 --- a/addons/maptools/XEH_postInitClient.sqf +++ b/addons/maptools/XEH_postInitClient.sqf @@ -67,6 +67,18 @@ GVAR(drawing_controls) = [36732, 36733, 36734, 36735, 36736, 36737]; // Update the size and rotation of map tools [] call FUNC(updateMapToolMarkers); - - [FUNC(mapStateUpdater), 0, []] call CBA_fnc_addPerFrameHandler; }; + +["mapOpened", { + // Show and update map tools if required + [] call FUNC(updateMapToolMarkers); + // Show GPS if required + [GVAR(mapGpsShow)] call FUNC(openMapGps); +}] call EFUNC(common,addEventHandler); + +["mapClosed", { + // Hide GPS + [false] call FUNC(openMapGps); + // Cancel drawing + call FUNC(cancelDrawing); +}] call EFUNC(common,addEventHandler); diff --git a/addons/maptools/XEH_preInit.sqf b/addons/maptools/XEH_preInit.sqf index 2da38996c3..2bcd68385a 100644 --- a/addons/maptools/XEH_preInit.sqf +++ b/addons/maptools/XEH_preInit.sqf @@ -16,7 +16,6 @@ PREP(handleMouseButton); PREP(handleMouseMove); PREP(handleMouseZChanged); PREP(isInsideMapTool); -PREP(mapStateUpdater); PREP(openMapGps); PREP(openMapGpsUpdate); PREP(removeLineMarker); diff --git a/addons/maptools/functions/fnc_mapStateUpdater.sqf b/addons/maptools/functions/fnc_mapStateUpdater.sqf deleted file mode 100644 index 2b4e634567..0000000000 --- a/addons/maptools/functions/fnc_mapStateUpdater.sqf +++ /dev/null @@ -1,33 +0,0 @@ - -#include "script_component.hpp" - -if (visibleMap) then { - // Show/Hide draw buttons - if ("ACE_MapTools" in items ACE_player) then { - { ((finddisplay 12) displayctrl _x) ctrlShow true; } forEach GVAR(drawing_controls); - } else { - { ((finddisplay 12) displayctrl _x) ctrlShow false; } forEach GVAR(drawing_controls); - if (GVAR(drawing_isDrawing)) then { - call FUNC(cancelDrawing); - }; - }; -}; - -//When Map is Closed: -if (GVAR(mapVisableLastFrame) && (!visibleMap)) then { - GVAR(mapVisableLastFrame) = false; - // Hide GPS - [false] call FUNC(openMapGps); - // Cancel drawing - call FUNC(cancelDrawing); -}; - -//When Map is Opened: -if ((!GVAR(mapVisableLastFrame)) && (visibleMap)) then { - //todo: "mapOpened" Event???? - GVAR(mapVisableLastFrame) = true; - // Show and update map tools if required - [] call FUNC(updateMapToolMarkers); - // Show GPS if required - [GVAR(mapGpsShow)] call FUNC(openMapGps); -}; diff --git a/addons/maptools/functions/fnc_updateMapToolMarkers.sqf b/addons/maptools/functions/fnc_updateMapToolMarkers.sqf index fa6db8872a..959be6752e 100644 --- a/addons/maptools/functions/fnc_updateMapToolMarkers.sqf +++ b/addons/maptools/functions/fnc_updateMapToolMarkers.sqf @@ -20,6 +20,16 @@ PARAMS_1(_theMap); private ["_rotatingTexture", "_textureWidth", "_scale", "_xPos", "_yPos"]; +// Show/Hide draw buttons +if ("ACE_MapTools" in items ACE_player) then { + { ((finddisplay 12) displayctrl _x) ctrlShow true; } forEach GVAR(drawing_controls); +} else { + { ((finddisplay 12) displayctrl _x) ctrlShow false; } forEach GVAR(drawing_controls); + if (GVAR(drawing_isDrawing)) then { + call FUNC(cancelDrawing); + }; +}; + if (!("ACE_MapTools" in items ACE_player)|| {GVAR(mapTool_Shown) == 0}) exitWith {}; _rotatingTexture = ""; From 17115b88466f31c76dd37d99bcbd9e70d2bda4c3 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Tue, 11 Aug 2015 20:58:00 +0200 Subject: [PATCH 002/132] test switch to adv medical handleDamage --- addons/medical/XEH_preInit.sqf | 2 + addons/medical/functions/fnc_handleDamage.sqf | 29 ++- .../functions/fnc_handleDamage_basic.sqf | 4 +- .../functions/fnc_handleDamage_basic2.sqf | 168 ++++++++++++++++++ 4 files changed, 201 insertions(+), 2 deletions(-) create mode 100644 addons/medical/functions/fnc_handleDamage_basic2.sqf diff --git a/addons/medical/XEH_preInit.sqf b/addons/medical/XEH_preInit.sqf index b479383468..6ae9dbb866 100644 --- a/addons/medical/XEH_preInit.sqf +++ b/addons/medical/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; +PREP(handleDamage_basic2); + PREP(actionCheckBloodPressure); PREP(actionCheckBloodPressureLocal); PREP(actionCheckPulse); diff --git a/addons/medical/functions/fnc_handleDamage.sqf b/addons/medical/functions/fnc_handleDamage.sqf index a4e5525276..47234d09fd 100644 --- a/addons/medical/functions/fnc_handleDamage.sqf +++ b/addons/medical/functions/fnc_handleDamage.sqf @@ -44,7 +44,34 @@ if !(_unit getVariable [QGVAR(allowDamage), true]) exitWith {_damageOld}; // Get return damage _damageReturn = _damage; if (GVAR(level) < 2) then { - _damageReturn = _this call FUNC(handleDamage_basic); + _newDamage = _this call FUNC(handleDamage_basic2); + _projectile = _this select 4; + _typeOfDamage = [_projectile] call FUNC(getTypeOfDamage); + + _typeIndex = (GVAR(allAvailableDamageTypes) find _typeOfDamage); + _minLethalDamage = 0.01; + if (_typeIndex >= 0) then { + _minLethalDamage = GVAR(minLethalDamages) select _typeIndex; + }; + + if (vehicle _unit != _unit && {!(vehicle _unit isKindOf "StaticWeapon")} && {isNull _shooter} && {_projectile == ""} && {_selection == ""}) then { + if (GVAR(enableVehicleCrashes)) then { + _selection = GVAR(SELECTIONS) select (floor(random(count GVAR(SELECTIONS)))); + }; + }; + + if ((_minLethalDamage <= _newDamage) && {[_unit, [_selection] call FUNC(selectionNameToNumber), _newDamage] call FUNC(determineIfFatal)}) then { + if ((_unit getVariable [QGVAR(preventInstaDeath), GVAR(preventInstaDeath)])) exitwith { + _damageReturn = 0.9; + }; + if ([_unit] call FUNC(setDead)) then { + _damageReturn = 1; + } else { + _damageReturn = _damageReturn min 0.89; + }; + } else { + _damageReturn = _damageReturn min 0.89; + }; } else { if !([_unit] call FUNC(hasMedicalEnabled)) exitwith { // Because of the config changes, we cannot properly disable the medical system for a unit. diff --git a/addons/medical/functions/fnc_handleDamage_basic.sqf b/addons/medical/functions/fnc_handleDamage_basic.sqf index 04049cfa7c..9b48a5d5c7 100644 --- a/addons/medical/functions/fnc_handleDamage_basic.sqf +++ b/addons/medical/functions/fnc_handleDamage_basic.sqf @@ -37,6 +37,8 @@ _threshold = [ _unit getVariable [QGVAR(damageThreshold), GVAR(AIDamageThreshold)], _unit getVariable [QGVAR(damageThreshold), GVAR(playerDamageThreshold)] ] select ([_unit] call EFUNC(common,isPlayer)); +if (_selectionName in ["leg_l", "leg_r", "hand_l", "hand_r"]) then {_threshold = _threshold * 1.7}; + _damage = _damage * (1 / _threshold); // This is a new hit, reset variables. @@ -63,7 +65,7 @@ if (diag_frameno > (_unit getVariable [QGVAR(basic_frameNo), -3]) + 2) then { (_unit getHitPointDamage "HitLeftLeg") + (_unit getHitPointDamage "HitRightLeg"); if (_damagesum < 0.06 and damage _unit > 0.06 and alive _unit) then { - _unit setHitPointDamage ["HitBody", damage _unit]; + // _unit setHitPointDamage ["HitBody", damage _unit]; }; [(_this select 1)] call cba_fnc_removePerFrameHandler; }; diff --git a/addons/medical/functions/fnc_handleDamage_basic2.sqf b/addons/medical/functions/fnc_handleDamage_basic2.sqf new file mode 100644 index 0000000000..9da6fd405d --- /dev/null +++ b/addons/medical/functions/fnc_handleDamage_basic2.sqf @@ -0,0 +1,168 @@ +/* + * Author: KoffeinFlummi, Glowbal + * Cache a handleDamage call to execute it 3 frames later + * + * Arguments: + * 0: Unit That Was Hit + * 1: Name Of Hit Selection + * 2: Amount Of Damage + * 3: Shooter + * 4: Projectile + * 5: Current damage to be returned + * + * Return Value: + * + * + * Public: No + */ + +#include "script_component.hpp" + +private ["_unit", "_selectionName", "_damage", "_source", "_projectile", "_hitSelections", "_hitPoints", "_impactVelocity", "_newDamage", "_cache_hitpoints", "_cache_projectiles", "_cache_params", "_cache_damages"]; +_unit = _this select 0; +_selectionName = _this select 1; +_damage = _this select 2; +_source = _this select 3; +_projectile = _this select 4; + +_hitSelections = GVAR(SELECTIONS); +_hitPoints = GVAR(HITPOINTS); + +// Calculate change in damage. +_newDamage = _damage - (damage _unit); +if (_selectionName in _hitSelections) then { + _newDamage = _damage - (_unit getHitPointDamage (_hitPoints select (_hitSelections find _selectionName))); +}; + +//_damage = _damage + _newDamage; + +// Check for vehicle crash +if (vehicle _unit != _unit && {!(vehicle _unit isKindOf "StaticWeapon")} && {isNull _source} && {_projectile == ""} && {_selectionName == ""}) then { + if (GVAR(enableVehicleCrashes)) then { + _selectionName = _hitSelections select (floor(random(count _hitSelections))); + _projectile = "vehiclecrash"; + _this set [1, _selectionName]; + _this set [4, _projectile]; + }; +}; + +// Handle falling damage +_impactVelocity = (velocity _unit) select 2; +if (_impactVelocity < -5 && {vehicle _unit == _unit}) then { + _unit setVariable [QGVAR(isFalling), true]; + _unit setVariable [QGVAR(impactVelocity), _impactVelocity]; +}; +if (_unit getVariable [QGVAR(isFalling), false]) then { + if !(_selectionName in ["", "leg_l", "leg_r"]) then { + if (_selectionName == "body") then { + _newDamage = _newDamage * abs(_unit getVariable [QGVAR(impactVelocity), _impactVelocity]) / 50; + } else { + _newDamage = _newDamage * 0.5; + }; + } else { + if (_selectionName == "") then { + _selectionName = ["leg_l", "leg_r"] select (floor(random 2)); + _this set [1, _selectionName]; + }; + _newDamage = _newDamage * 0.7; + }; + _projectile = "falling"; + _this set [4, "falling"]; +}; + +// Finished with the current frame, reset variables +// Note: sometimes handleDamage spans over 2 or even 3 frames. +if (diag_frameno > (_unit getVariable [QGVAR(frameNo_damageCaching), -3]) + 2) then { + _unit setVariable [QGVAR(frameNo_damageCaching), diag_frameno]; + + // handle the cached damages 3 frames later + [{ + params ["_args", "_id"]; + _args params ["_target", "_frameNo"]; + + if (diag_frameno > _frameNo + 2) then { + _target setDamage 0; + + _cache_params = _target getVariable [QGVAR(cachedHandleDamageParams), []]; + _cache_damages = _target getVariable QGVAR(cachedDamages); + _damageBodyParts = _target getvariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]]; + { + _x params ["_unit","_selectionName","_amountOfDamage","_sourceOfDamage","_typeOfProjectile","_typeOfDamage"]; + if !(isNull _sourceOfDamage && {_typeOfProjectile == ""} && {vehicle _unit == _unit} && {(_selectionName == "head" || isBurning _unit)}) then { + _part = [_selectionName] call FUNC(selectionNameToNumber); + if (_part < 0) exitwith {}; + _damageBodyParts set [_part, (_damageBodyParts select _part) + (_cache_damages select _foreachIndex)]; + }; + }foreach _cache_params; + _unit setvariable [QGVAR(bodyPartStatus), _damageBodyParts, true]; + + EXPLODE_6_PVT(_damageBodyParts,_headDamage,_torsoDamage,_handsDamageR,_handsDamageL,_legsDamageR,_legsDamageL); + _target setHitPointDamage ["hitHead", _headDamage min 0.95]; + _target setHitPointDamage ["hitBody", _torsoDamage min 0.95]; + _target setHitPointDamage ["hitHands", (_handsDamageR + _handsDamageL) min 0.95]; + _target setHitPointDamage ["hitLegs", (_legsDamageR + _legsDamageL) min 0.95]; + + { + _target setHitPointDamage [_x, (_damageBodyParts select _foreachIndex) min 0.95]; + }foreach GVAR(HITPOINTS); + [_id] call cba_fnc_removePerFrameHandler; + }; + }, 0, [_unit, diag_frameno] ] call CBA_fnc_addPerFrameHandler; + + _unit setVariable [QGVAR(cachedProjectiles), []]; + _unit setVariable [QGVAR(cachedHitPoints), []]; + _unit setVariable [QGVAR(cachedDamages), []]; + _unit setVariable [QGVAR(cachedHandleDamageParams), []]; +}; + +// Caching of the damage events +if (_selectionName != "") then { + _cache_projectiles = _unit getVariable QGVAR(cachedProjectiles); + private ["_index","_otherDamage"]; + _index = _cache_projectiles find _projectile; + // Check if the current projectile has already been handled once + if (_index >= 0 && {_projectile != "falling"}) exitwith { + _cache_damages = _unit getVariable QGVAR(cachedDamages); + // Find the previous damage this projectile has done + _otherDamage = (_cache_damages select _index); + + // Take the highest damage of the two + if (_newDamage > _otherDamage) then { + _cache_params = _unit getVariable QGVAR(cachedHandleDamageParams); + _cache_hitpoints = _unit getVariable QGVAR(cachedHitPoints); + + private ["_hitPoint", "_restore"]; + // Restore the damage before the previous damage was processed + _hitPoint = _cache_hitpoints select _index; + _restore = ((_unit getHitPointDamage _hitPoint) - _otherDamage) max 0; + _unit setHitPointDamage [_hitPoint, _restore]; + + _cache_hitpoints set [_index, (_hitPoints select (_hitSelections find _selectionName))]; + _cache_damages set [_index, _newDamage]; + _cache_params set[_index, _this]; + + _unit setVariable [QGVAR(cachedProjectiles), _cache_projectiles]; + _unit setVariable [QGVAR(cachedHitPoints), _cache_hitpoints]; + _unit setVariable [QGVAR(cachedDamages), _cache_damages]; + _unit setVariable [QGVAR(cachedHandleDamageParams), _cache_params]; + }; + }; + + _cache_hitpoints = _unit getVariable QGVAR(cachedHitPoints); + _cache_damages = _unit getVariable QGVAR(cachedDamages); + _cache_params = _unit getVariable QGVAR(cachedHandleDamageParams); + + // This is an unhandled projectile + _cache_projectiles pushBack _projectile; + _cache_hitpoints pushBack (_hitPoints select (_hitSelections find _selectionName)); + _cache_damages pushBack _newDamage; + _cache_params pushBack _this; + + // Store the new cached values + _unit setVariable [QGVAR(cachedProjectiles), _cache_projectiles]; + _unit setVariable [QGVAR(cachedHitPoints), _cache_hitpoints]; + _unit setVariable [QGVAR(cachedDamages), _cache_damages]; + _unit setVariable [QGVAR(cachedHandleDamageParams), _cache_params]; +}; + +_newDamage; From c6fbdb420c13f0c3d0224079cd84fe8ec7d25c83 Mon Sep 17 00:00:00 2001 From: jokoho48 Date: Thu, 13 Aug 2015 23:42:20 +0200 Subject: [PATCH 003/132] Code cleanup of Hearing module --- addons/hearing/XEH_postInit.sqf | 2 +- addons/hearing/functions/fnc_addEarPlugs.sqf | 3 +- addons/hearing/functions/fnc_earRinging.sqf | 3 +- .../hearing/functions/fnc_explosionNear.sqf | 2 +- addons/hearing/functions/fnc_firedNear.sqf | 32 +++++++++---------- .../hearing/functions/fnc_hasEarPlugsIn.sqf | 3 +- .../hearing/functions/fnc_moduleHearing.sqf | 3 +- .../hearing/functions/fnc_putInEarplugs.sqf | 2 +- .../hearing/functions/fnc_removeEarplugs.sqf | 2 +- addons/hearing/functions/fnc_updateVolume.sqf | 4 +-- 10 files changed, 25 insertions(+), 31 deletions(-) diff --git a/addons/hearing/XEH_postInit.sqf b/addons/hearing/XEH_postInit.sqf index ad73ed55d5..66406ad917 100644 --- a/addons/hearing/XEH_postInit.sqf +++ b/addons/hearing/XEH_postInit.sqf @@ -15,7 +15,7 @@ GVAR(time4) = 0; ["SettingsInitialized", { // Spawn volume updating process - [FUNC(updateVolume), 1, [false] ] call CBA_fnc_addPerFrameHandler; + [FUNC(updateVolume), 1, [false]] call CBA_fnc_addPerFrameHandler; }] call EFUNC(common,addEventHandler); //Update veh attunation when player veh changes diff --git a/addons/hearing/functions/fnc_addEarPlugs.sqf b/addons/hearing/functions/fnc_addEarPlugs.sqf index 62ed4518e2..b2e43bc718 100644 --- a/addons/hearing/functions/fnc_addEarPlugs.sqf +++ b/addons/hearing/functions/fnc_addEarPlugs.sqf @@ -14,8 +14,7 @@ * Public: No */ #include "script_component.hpp" - -PARAMS_1(_unit); +params ["_unit"]; // Exit if hearing is disabled or soldier has earplugs already in (persistence scenarios) if (!GVAR(enableCombatDeafness) || {[_unit] call FUNC(hasEarPlugsIn)}) exitWith {}; diff --git a/addons/hearing/functions/fnc_earRinging.sqf b/addons/hearing/functions/fnc_earRinging.sqf index 6a896c1820..63ca3e5f1c 100644 --- a/addons/hearing/functions/fnc_earRinging.sqf +++ b/addons/hearing/functions/fnc_earRinging.sqf @@ -15,8 +15,7 @@ * Public: No */ #include "script_component.hpp" - -PARAMS_2(_unit,_strength); +params ["_unit", "_strength"]; if (_unit != ACE_player) exitWith {}; if (_strength < 0.05) exitWith {}; diff --git a/addons/hearing/functions/fnc_explosionNear.sqf b/addons/hearing/functions/fnc_explosionNear.sqf index dde9bc50cc..8cea263fec 100644 --- a/addons/hearing/functions/fnc_explosionNear.sqf +++ b/addons/hearing/functions/fnc_explosionNear.sqf @@ -19,7 +19,7 @@ //Only run if deafness or ear ringing is enabled: if ((!GVAR(enableCombatDeafness)) && GVAR(DisableEarRinging)) exitWith {}; -PARAMS_2(_unit,_damage); +params ["_unit", "_damage"]; private ["_strength"]; _strength = 0 max _damage; diff --git a/addons/hearing/functions/fnc_firedNear.sqf b/addons/hearing/functions/fnc_firedNear.sqf index 6fc48b27fa..5adf66fb25 100644 --- a/addons/hearing/functions/fnc_firedNear.sqf +++ b/addons/hearing/functions/fnc_firedNear.sqf @@ -24,7 +24,7 @@ //Only run if deafness or ear ringing is enabled: if ((!GVAR(enableCombatDeafness)) && GVAR(DisableEarRinging)) exitWith {}; -PARAMS_7(_object,_firer,_distance,_weapon,_muzzle,_mode,_ammo); +params ["_object", "_firer", "_distance", "_weapon", "_muzzle", "_mode", "_ammo"]; //Only run if firedNear object is player or player's vehicle: if ((ACE_player != _object) && {(vehicle ACE_player) != _object}) exitWith {}; @@ -37,11 +37,11 @@ _vehAttenuation = if ((ACE_player == (vehicle ACE_player)) || {isTurnedOut ACE_p _distance = 1 max _distance; -_silencer = switch (_weapon) do { - case (primaryWeapon _firer) : {(primaryWeaponItems _firer) select 0}; - case (secondaryWeapon _firer) : {(secondaryWeaponItems _firer) select 0}; - case (handgunWeapon _firer) : {(handgunItems _firer) select 0}; - default {""}; +_silencer = call { + if (primaryWeapon _firer) exitWith {(primaryWeaponItems _firer) select 0}; + if (secondaryWeapon _firer) exitWith {(secondaryWeaponItems _firer) select 0}; + if (handgunWeapon _firer) exitWith {(handgunItems _firer) select 0}; + "" }; _audibleFireCoef = 1; @@ -58,7 +58,7 @@ if (count _weaponMagazines == 0) then { _muzzleMagazines = getArray (configFile >> "CfgWeapons" >> _weapon >> _x >> "magazines"); _weaponMagazines append _muzzleMagazines; }; - } forEach _muzzles; + } count _muzzles; { _ammoType = getText(configFile >> "CfgMagazines" >> _x >> "ammo"); _weaponMagazines set [_forEachIndex, [_x, _ammoType]]; @@ -68,11 +68,11 @@ if (count _weaponMagazines == 0) then { _magazine = ""; { - EXPLODE_2_PVT(_x,_magazineType,_ammoType); + params ["_magazineType", "_ammoType"]; if (_ammoType == _ammo) exitWith { _magazine = _magazineType; }; -} forEach _weaponMagazines; +} count _weaponMagazines; if (_magazine == "") exitWith {}; @@ -80,14 +80,12 @@ _initSpeed = getNumber(configFile >> "CfgMagazines" >> _magazine >> "initSpeed") _ammoConfig = (configFile >> "CfgAmmo" >> _ammo); _parentClasses = [_ammoConfig, true] call BIS_fnc_returnParents; _caliber = getNumber(_ammoConfig >> "ACE_caliber"); -_caliber = switch (true) do { - case ("ShellBase" in _parentClasses): { 80 }; - case ("RocketBase" in _parentClasses): { 200 }; - case ("MissileBase" in _parentClasses): { 600 }; - case ("SubmunitionBase" in _parentClasses): { 80 }; - default { - if (_caliber <= 0) then { 6.5 } else { _caliber }; - }; +_caliber = call { + if ("ShellBase" in _parentClasses) exitWith { 80 }; + if ("RocketBase" in _parentClasses) exitWith { 200 }; + if ("MissileBase" in _parentClasses) exitWith { 600 }; + if ("SubmunitionBase" in _parentClasses) exitWith { 80 }; + if (_caliber <= 0) then { 6.5 } else { _caliber }; }; _loudness = (_caliber ^ 1.25 / 10) * (_initspeed / 1000) * _audibleFireCoef / 5; _strength = _vehAttenuation * (_loudness - (_loudness / 50 * _distance)); // linear drop off diff --git a/addons/hearing/functions/fnc_hasEarPlugsIn.sqf b/addons/hearing/functions/fnc_hasEarPlugsIn.sqf index 58dc302888..67a76685f4 100644 --- a/addons/hearing/functions/fnc_hasEarPlugsIn.sqf +++ b/addons/hearing/functions/fnc_hasEarPlugsIn.sqf @@ -14,7 +14,6 @@ * Public: No */ #include "script_component.hpp" - -PARAMS_1(_unit); +params ["_unit"]; _unit getVariable ["ACE_hasEarPlugsin", false] diff --git a/addons/hearing/functions/fnc_moduleHearing.sqf b/addons/hearing/functions/fnc_moduleHearing.sqf index 6ec0af0231..50675022a0 100644 --- a/addons/hearing/functions/fnc_moduleHearing.sqf +++ b/addons/hearing/functions/fnc_moduleHearing.sqf @@ -9,8 +9,7 @@ * None */ #include "script_component.hpp" - -PARAMS_3(_logic,_units,_activated); +params ["_logic", "_units", "_activated"]; if !(_activated) exitWith {}; diff --git a/addons/hearing/functions/fnc_putInEarplugs.sqf b/addons/hearing/functions/fnc_putInEarplugs.sqf index 8b11e6ba25..8d5479c17b 100644 --- a/addons/hearing/functions/fnc_putInEarplugs.sqf +++ b/addons/hearing/functions/fnc_putInEarplugs.sqf @@ -15,7 +15,7 @@ */ #include "script_component.hpp" -PARAMS_1(_player); +params ["_player"]; // Plugs in inventory, putting them in _player removeItem "ACE_EarPlugs"; diff --git a/addons/hearing/functions/fnc_removeEarplugs.sqf b/addons/hearing/functions/fnc_removeEarplugs.sqf index 19a34831cd..f5b5ca2442 100644 --- a/addons/hearing/functions/fnc_removeEarplugs.sqf +++ b/addons/hearing/functions/fnc_removeEarplugs.sqf @@ -15,7 +15,7 @@ */ #include "script_component.hpp" -PARAMS_1(_player); +params ["_player"]; if !(_player canAdd "ACE_EarPlugs") exitWith { // inventory full [localize LSTRING(Inventory_Full)] call EFUNC(common,displayTextStructured); diff --git a/addons/hearing/functions/fnc_updateVolume.sqf b/addons/hearing/functions/fnc_updateVolume.sqf index 3a72e8eb3b..f1cb063971 100644 --- a/addons/hearing/functions/fnc_updateVolume.sqf +++ b/addons/hearing/functions/fnc_updateVolume.sqf @@ -19,9 +19,9 @@ //Only run if deafness or ear ringing is enabled: if ((!GVAR(enableCombatDeafness)) && GVAR(DisableEarRinging)) exitWith {}; -EXPLODE_1_PVT((_this select 0),_justUpdateVolume); - private["_volume", "_soundTransitionTime"]; +(_this select 0) params ["_justUpdateVolume"]; + GVAR(deafnessDV) = (GVAR(deafnessDV) min 20) max 0; GVAR(volume) = (1 - (GVAR(deafnessDV) / 20)) max 0; From cb8d009ef033a629fbb41328007ba8cebdf8d816 Mon Sep 17 00:00:00 2001 From: jokoho48 Date: Fri, 14 Aug 2015 00:31:42 +0200 Subject: [PATCH 004/132] Woops --- addons/hearing/functions/fnc_firedNear.sqf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/hearing/functions/fnc_firedNear.sqf b/addons/hearing/functions/fnc_firedNear.sqf index 5adf66fb25..02de8db928 100644 --- a/addons/hearing/functions/fnc_firedNear.sqf +++ b/addons/hearing/functions/fnc_firedNear.sqf @@ -38,9 +38,9 @@ _vehAttenuation = if ((ACE_player == (vehicle ACE_player)) || {isTurnedOut ACE_p _distance = 1 max _distance; _silencer = call { - if (primaryWeapon _firer) exitWith {(primaryWeaponItems _firer) select 0}; - if (secondaryWeapon _firer) exitWith {(secondaryWeaponItems _firer) select 0}; - if (handgunWeapon _firer) exitWith {(handgunItems _firer) select 0}; + if (_weapon == primaryWeapon _firer) exitWith {(primaryWeaponItems _firer) select 0}; + if (_weapon == secondaryWeapon _firer) exitWith {(secondaryWeaponItems _firer) select 0}; + if (_weapon == handgunWeapon _firer) exitWith {(handgunItems _firer) select 0}; "" }; @@ -68,7 +68,7 @@ if (count _weaponMagazines == 0) then { _magazine = ""; { - params ["_magazineType", "_ammoType"]; + _x params ["_magazineType", "_ammoType"]; if (_ammoType == _ammo) exitWith { _magazine = _magazineType; }; From bd56d1bb83855cd055f21b2e779337e19fab87f1 Mon Sep 17 00:00:00 2001 From: jokoho48 Date: Fri, 14 Aug 2015 00:36:36 +0200 Subject: [PATCH 005/132] ok that is my fault --- addons/hearing/functions/fnc_firedNear.sqf | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/hearing/functions/fnc_firedNear.sqf b/addons/hearing/functions/fnc_firedNear.sqf index 02de8db928..1ede8db3ea 100644 --- a/addons/hearing/functions/fnc_firedNear.sqf +++ b/addons/hearing/functions/fnc_firedNear.sqf @@ -37,11 +37,11 @@ _vehAttenuation = if ((ACE_player == (vehicle ACE_player)) || {isTurnedOut ACE_p _distance = 1 max _distance; -_silencer = call { - if (_weapon == primaryWeapon _firer) exitWith {(primaryWeaponItems _firer) select 0}; - if (_weapon == secondaryWeapon _firer) exitWith {(secondaryWeaponItems _firer) select 0}; - if (_weapon == handgunWeapon _firer) exitWith {(handgunItems _firer) select 0}; - "" +_silencer = switch (_weapon) do { + case (primaryWeapon _firer) : {(primaryWeaponItems _firer) select 0}; + case (secondaryWeapon _firer) : {(secondaryWeaponItems _firer) select 0}; + case (handgunWeapon _firer) : {(handgunItems _firer) select 0}; + default {""}; }; _audibleFireCoef = 1; From 1f9a98f77d7caf1242cfcb6391cb099756301464 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Mon, 17 Aug 2015 21:51:40 -0500 Subject: [PATCH 006/132] Cleanup / Params --- addons/maptools/XEH_postInitClient.sqf | 12 ++++------ .../maptools/functions/fnc_addLineMarker.sqf | 2 +- .../functions/fnc_calculateMapScale.sqf | 4 ++-- .../functions/fnc_copyMapReceiveMarkers.sqf | 2 +- .../functions/fnc_copyMapRemoteSend.sqf | 2 +- .../maptools/functions/fnc_copyMapStart.sqf | 2 +- .../maptools/functions/fnc_handleKeyDown.sqf | 4 +++- .../functions/fnc_handleMouseButton.sqf | 24 ++++++++----------- .../functions/fnc_handleMouseMove.sqf | 7 +++--- addons/maptools/functions/fnc_openMapGps.sqf | 2 +- .../functions/fnc_removeLineMarker.sqf | 2 +- .../functions/fnc_updateLineMarker.sqf | 2 +- .../functions/fnc_updateMapToolMarkers.sqf | 6 ++--- 13 files changed, 33 insertions(+), 38 deletions(-) diff --git a/addons/maptools/XEH_postInitClient.sqf b/addons/maptools/XEH_postInitClient.sqf index e227463711..34c0a9e750 100644 --- a/addons/maptools/XEH_postInitClient.sqf +++ b/addons/maptools/XEH_postInitClient.sqf @@ -26,11 +26,11 @@ GVAR(drawing_controls) = [36732, 36733, 36734, 36735, 36736, 36737]; _fnc_installMapEvents = { private "_d"; _d = _this; - ((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["MouseMoving", {_this call FUNC(handleMouseMove);}]; - ((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["MouseButtonDown", {[1, _this] call FUNC(handleMouseButton);}]; - ((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["MouseButtonUp", {[0, _this] call FUNC(handleMouseButton)}]; - ((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["Draw", {_this call FUNC(updateMapToolMarkers);}]; - (finddisplay _d) displayAddEventHandler ["KeyDown", {_this call FUNC(handleKeyDown);}]; + ((findDisplay _d) displayCtrl 51) ctrlAddEventHandler ["MouseMoving", {_this call FUNC(handleMouseMove);}]; + ((findDisplay _d) displayCtrl 51) ctrlAddEventHandler ["MouseButtonDown", {[1, _this] call FUNC(handleMouseButton);}]; + ((findDisplay _d) displayCtrl 51) ctrlAddEventHandler ["MouseButtonUp", {[0, _this] call FUNC(handleMouseButton)}]; + ((findDisplay _d) displayCtrl 51) ctrlAddEventHandler ["Draw", {_this call FUNC(updateMapToolMarkers);}]; + (findDisplay _d) displayAddEventHandler ["KeyDown", {_this call FUNC(handleKeyDown);}]; }; // Wait until the briefing map is detected @@ -70,8 +70,6 @@ GVAR(drawing_controls) = [36732, 36733, 36734, 36735, 36736, 36737]; }; ["mapOpened", { - // Show and update map tools if required - [] call FUNC(updateMapToolMarkers); // Show GPS if required [GVAR(mapGpsShow)] call FUNC(openMapGps); }] call EFUNC(common,addEventHandler); diff --git a/addons/maptools/functions/fnc_addLineMarker.sqf b/addons/maptools/functions/fnc_addLineMarker.sqf index 157891a262..017dc5b494 100644 --- a/addons/maptools/functions/fnc_addLineMarker.sqf +++ b/addons/maptools/functions/fnc_addLineMarker.sqf @@ -15,7 +15,7 @@ */ #include "script_component.hpp" -PARAMS_4(_name,_startPos,_endPos,_color); +params ["_name", "_startPos", "_endPos", "_color"]; private ["_marker", "_difPos", "_mag"]; diff --git a/addons/maptools/functions/fnc_calculateMapScale.sqf b/addons/maptools/functions/fnc_calculateMapScale.sqf index 4723a4f5e1..78bfae43af 100644 --- a/addons/maptools/functions/fnc_calculateMapScale.sqf +++ b/addons/maptools/functions/fnc_calculateMapScale.sqf @@ -14,7 +14,7 @@ private ["_screenOffset", "_pos"]; -_pos = ((finddisplay 12) displayctrl 51) ctrlMapScreenToWorld [0.5, 0.5]; -_screenOffset = ((finddisplay 12) displayctrl 51) posWorldToScreen [(_pos select 0) + 100, (_pos select 1)]; +_pos = ((findDisplay 12) displayCtrl 51) ctrlMapScreenToWorld [0.5, 0.5]; +_screenOffset = ((findDisplay 12) displayCtrl 51) posWorldToScreen [(_pos select 0) + 100, (_pos select 1)]; (_screenOffset select 0) - 0.5 diff --git a/addons/maptools/functions/fnc_copyMapReceiveMarkers.sqf b/addons/maptools/functions/fnc_copyMapReceiveMarkers.sqf index 44f6ed6203..6c3c706208 100644 --- a/addons/maptools/functions/fnc_copyMapReceiveMarkers.sqf +++ b/addons/maptools/functions/fnc_copyMapReceiveMarkers.sqf @@ -12,7 +12,7 @@ */ #include "script_component.hpp" -PARAMS_1(_lineMarkers); +params ["_lineMarkers"]; { private "_marker"; diff --git a/addons/maptools/functions/fnc_copyMapRemoteSend.sqf b/addons/maptools/functions/fnc_copyMapRemoteSend.sqf index f4aebf6093..551019f900 100644 --- a/addons/maptools/functions/fnc_copyMapRemoteSend.sqf +++ b/addons/maptools/functions/fnc_copyMapRemoteSend.sqf @@ -12,6 +12,6 @@ #include "script_component.hpp" -PARAMS_1(_requester); +params ["_requester"]; ["drawing_sendbackMarkers", _requester, [GVAR(drawing_lineMarkers)]] call EFUNC(common,targetEvent); diff --git a/addons/maptools/functions/fnc_copyMapStart.sqf b/addons/maptools/functions/fnc_copyMapStart.sqf index a39c74d225..7295f6f499 100644 --- a/addons/maptools/functions/fnc_copyMapStart.sqf +++ b/addons/maptools/functions/fnc_copyMapStart.sqf @@ -17,6 +17,6 @@ #include "script_component.hpp" -PARAMS_1(_player,_target); +params ["_player", "_target"]; ["drawing_requestMarkers", _target, [_player]] call EFUNC(common,targetEvent); diff --git a/addons/maptools/functions/fnc_handleKeyDown.sqf b/addons/maptools/functions/fnc_handleKeyDown.sqf index d1f9e199c9..297c87e789 100644 --- a/addons/maptools/functions/fnc_handleKeyDown.sqf +++ b/addons/maptools/functions/fnc_handleKeyDown.sqf @@ -15,7 +15,7 @@ #include "script_component.hpp" -PARAMS_5(_display,_code,_shiftKey,_ctrlKey,_altKey); +params ["", "_code"]; private ["_handled", "_relPos", "_diffVector", "_magDiffVector", "_lambdaLong", "_lambdaTrasAbs"]; @@ -30,6 +30,7 @@ if (_code == DIK_ESCAPE) exitWith { call FUNC(cancelDrawing); _handled = true; }; + _handled }; if (_code == DIK_DELETE) exitWith { @@ -65,6 +66,7 @@ if (_code == DIK_DELETE) exitWith { }; } forEach GVAR(drawing_lineMarkers); }; + _handled }; _handled diff --git a/addons/maptools/functions/fnc_handleMouseButton.sqf b/addons/maptools/functions/fnc_handleMouseButton.sqf index 16cabe9719..ec0d1264fc 100644 --- a/addons/maptools/functions/fnc_handleMouseButton.sqf +++ b/addons/maptools/functions/fnc_handleMouseButton.sqf @@ -1,6 +1,5 @@ /* * Author: esteldunedain - * * Handle mouse buttons. * * Argument: @@ -13,23 +12,18 @@ #include "script_component.hpp" -private ["_control", "_button", "_screenPos", "_shiftKey", "_ctrlKey", "_handled", "_pos", "_altKey", "_gui", "_marker"]; +params ["_dir", "_params"]; +_params params ["_control", "_button", "_screenPosX", "_screenPosY", "_shiftKey", "_ctrlKey", "_altKey"]; -PARAMS_2(_dir,_params); -_control = _params select 0; -_button = _params select 1; -_screenPos = [_params select 2, _params select 3]; -_shiftKey = _params select 4; -_ctrlKey = _params select 5; -_altKey = _params select 6; -_handled = false; +private["_gui", "_handled", "_marker", "_pos"]; +_handled = false; // If it's not a left button event, exit -if (_button != 0) exitWith {}; +if (_button != 0) exitWith {_handled}; // If releasing -if (_dir != 1 && (GVAR(mapTool_isDragging) or GVAR(mapTool_isRotating))) exitWith { +if ((_dir != 1) && {(GVAR(mapTool_isDragging) || GVAR(mapTool_isRotating))}) exitWith { GVAR(mapTool_isDragging) = false; GVAR(mapTool_isRotating) = false; _handled = true; @@ -42,7 +36,7 @@ if (_dir == 1) exitWith { if !(call FUNC(canDraw)) exitWith {_handled = false;}; // Transform mouse screen position to coordinates - _pos = _control ctrlMapScreenToWorld _screenPos; + _pos = _control ctrlMapScreenToWorld [_screenPosX, _screenPosY]; _pos set [count _pos, 0]; if (GVAR(drawing_isDrawing)) exitWith { @@ -52,7 +46,7 @@ if (_dir == 1) exitWith { // [GVAR(drawing_tempLineMarker), "FUNC(addLineMarker)", 2] call EFUNC(common,execRemoteFnc); ["drawing_addLineMarker", GVAR(drawing_tempLineMarker)] call EFUNC(common,globalEvent); // Log who drew on the briefing screen - (text format ["[ACE] Server: Player %1 drew on the briefing screen", name player]) call EFUNC(common,serverLog); + (text format ["[ACE] Server: Player %1 drew on the briefing screen", profileName]) call EFUNC(common,serverLog); } else { GVAR(drawing_tempLineMarker) call FUNC(updateLineMarker); GVAR(drawing_lineMarkers) pushBack (+GVAR(drawing_tempLineMarker)); @@ -96,6 +90,8 @@ if (_dir == 1) exitWith { }; _handled = true; }; + + _handled }; _handled diff --git a/addons/maptools/functions/fnc_handleMouseMove.sqf b/addons/maptools/functions/fnc_handleMouseMove.sqf index 2148c5a162..7e2883382b 100644 --- a/addons/maptools/functions/fnc_handleMouseMove.sqf +++ b/addons/maptools/functions/fnc_handleMouseMove.sqf @@ -1,6 +1,5 @@ /* * Author: esteldunedain - * * Handle mouse movement over the map tool. * * Argument: @@ -13,11 +12,11 @@ #include "script_component.hpp" +params ["_control", "_mousePosX", "_mousePosY"]; + private ["_control", "_pos"]; -_control = _this select 0; -_pos = [_this select 1, _this select 2]; -GVAR(mousePosition) = _control ctrlMapScreenToWorld _pos; +GVAR(mousePosition) = _control ctrlMapScreenToWorld [_mousePosX, _mousePosY]; GVAR(mousePosition) set [2, 0]; //convert 2d pos to 3d // If cannot draw then exit diff --git a/addons/maptools/functions/fnc_openMapGps.sqf b/addons/maptools/functions/fnc_openMapGps.sqf index 7d29d9e169..dc2df07b57 100644 --- a/addons/maptools/functions/fnc_openMapGps.sqf +++ b/addons/maptools/functions/fnc_openMapGps.sqf @@ -12,7 +12,7 @@ */ #include "script_component.hpp" -PARAMS_1(_shouldOpenGps); +params ["_shouldOpenGps"]; private ["_isOpen"]; diff --git a/addons/maptools/functions/fnc_removeLineMarker.sqf b/addons/maptools/functions/fnc_removeLineMarker.sqf index be82970524..bd0a16adb1 100644 --- a/addons/maptools/functions/fnc_removeLineMarker.sqf +++ b/addons/maptools/functions/fnc_removeLineMarker.sqf @@ -11,7 +11,7 @@ #include "script_component.hpp" -PARAMS_1(_name); +params ["_name"]; deleteMarkerLocal _name; { diff --git a/addons/maptools/functions/fnc_updateLineMarker.sqf b/addons/maptools/functions/fnc_updateLineMarker.sqf index a745bfa123..6400d02461 100644 --- a/addons/maptools/functions/fnc_updateLineMarker.sqf +++ b/addons/maptools/functions/fnc_updateLineMarker.sqf @@ -13,7 +13,7 @@ */ #include "script_component.hpp" -PARAMS_4(_name,_startPos,_endPos,_color); +params ["_name", "_startPos", "_endPos", "_color"]; private ["_difPos", "_mag"]; diff --git a/addons/maptools/functions/fnc_updateMapToolMarkers.sqf b/addons/maptools/functions/fnc_updateMapToolMarkers.sqf index 959be6752e..c4f2f6f1dc 100644 --- a/addons/maptools/functions/fnc_updateMapToolMarkers.sqf +++ b/addons/maptools/functions/fnc_updateMapToolMarkers.sqf @@ -16,15 +16,15 @@ #define CENTER_OFFSET_Y_PERC 0.1606 #define CONSTANT_SCALE 0.2 -PARAMS_1(_theMap); +params ["_theMap"]; private ["_rotatingTexture", "_textureWidth", "_scale", "_xPos", "_yPos"]; // Show/Hide draw buttons if ("ACE_MapTools" in items ACE_player) then { - { ((finddisplay 12) displayctrl _x) ctrlShow true; } forEach GVAR(drawing_controls); + { ((findDisplay 12) displayCtrl _x) ctrlShow true; } forEach GVAR(drawing_controls); } else { - { ((finddisplay 12) displayctrl _x) ctrlShow false; } forEach GVAR(drawing_controls); + { ((findDisplay 12) displayCtrl _x) ctrlShow false; } forEach GVAR(drawing_controls); if (GVAR(drawing_isDrawing)) then { call FUNC(cancelDrawing); }; From 4a245bd935c8d5b77b8f0c974b7d6acfccec4586 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Mon, 17 Aug 2015 22:21:18 -0500 Subject: [PATCH 007/132] Remove Spawn for CBA_fnc_addPerFrameHandler --- addons/common/XEH_postInit.sqf | 35 ++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 43b5478eff..0dbbff04ec 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -373,21 +373,24 @@ GVAR(deviceKeyCurrentIndex) = -1; //Map opened/closed Events: GVAR(mapOpened) = false; -[] spawn { - waitUntil {(!isNull findDisplay 12)}; - ((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["Draw", { - if (!GVAR(mapOpened)) then { - GVAR(mapOpened) = true; - ["mapOpened", []] call FUNC(localEvent); - [{ - if (!visibleMap) then { - GVAR(mapOpened) = false; - ["mapClosed", []] call FUNC(localEvent); - [_this select 1] call CBA_fnc_removePerFrameHandler; - }; - }, 0, []] call CBA_fnc_addPerFrameHandler; - }; - }]; -}; +[{ + if (!isNull (findDisplay 12)) then { + [_this select 1] call CBA_fnc_removePerFrameHandler; + TRACE_1("Installing Map Draw EH for MapOpened event"); + ((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["Draw", { + if (!GVAR(mapOpened)) then { + GVAR(mapOpened) = true; + ["mapOpened", []] call FUNC(localEvent); + [{ + if (!visibleMap) then { + GVAR(mapOpened) = false; + ["mapClosed", []] call FUNC(localEvent); + [_this select 1] call CBA_fnc_removePerFrameHandler; + }; + }, 0, []] call CBA_fnc_addPerFrameHandler; + }; + }]; + }; +}, 0, []] call CBA_fnc_addPerFrameHandler; GVAR(commonPostInited) = true; From 3bcebf9033492874f4118fa2172c72281a350fa8 Mon Sep 17 00:00:00 2001 From: jonpas Date: Tue, 18 Aug 2015 23:41:25 +0200 Subject: [PATCH 008/132] Moved spare parts adding to init, Added module option to add spare parts or not, Added module to add specific spare part and amount of it to specific vehicle(s) --- addons/repair/ACE_Settings.hpp | 7 +++ addons/repair/CfgEventHandlers.hpp | 10 +-- addons/repair/CfgVehicles.hpp | 60 +++++++++++++++--- addons/repair/XEH_postInit.sqf | 14 +++++ addons/repair/XEH_preInit.sqf | 4 ++ addons/repair/functions/fnc_addSpareParts.sqf | 46 ++++++++++++++ .../functions/fnc_moduleAddSpareParts.sqf | 61 +++++++++++++++++++ .../functions/fnc_moduleRepairSettings.sqf | 2 + addons/repair/stringtable.xml | 32 ++++++++++ 9 files changed, 223 insertions(+), 13 deletions(-) create mode 100644 addons/repair/functions/fnc_addSpareParts.sqf create mode 100644 addons/repair/functions/fnc_moduleAddSpareParts.sqf diff --git a/addons/repair/ACE_Settings.hpp b/addons/repair/ACE_Settings.hpp index e956e853de..b4be91d1c3 100644 --- a/addons/repair/ACE_Settings.hpp +++ b/addons/repair/ACE_Settings.hpp @@ -61,4 +61,11 @@ class ACE_Settings { values[] = {CSTRING(engineerSetting_anyone), CSTRING(engineerSetting_EngineerOnly), CSTRING(engineerSetting_RepairSpecialistOnly)}; category = CSTRING(categoryName); }; + class GVAR(addSpareParts) { + displayName = CSTRING(addSpareParts_name); + description = CSTRING(addSpareParts_description); + typeName = "BOOL"; + value = 1; + category = CSTRING(categoryName); + }; }; diff --git a/addons/repair/CfgEventHandlers.hpp b/addons/repair/CfgEventHandlers.hpp index 27e14937cf..8a2d3e728c 100644 --- a/addons/repair/CfgEventHandlers.hpp +++ b/addons/repair/CfgEventHandlers.hpp @@ -13,31 +13,31 @@ class Extended_PostInit_EventHandlers { class Extended_Init_EventHandlers { class Car { class ADDON { - init = QUOTE(_this call DFUNC(addRepairActions)); + init = QUOTE(_this call DFUNC(addRepairActions); _this call DFUNC(addSpareParts)); }; }; class Tank { class ADDON { - init = QUOTE(_this call DFUNC(addRepairActions)); + init = QUOTE(_this call DFUNC(addRepairActions); _this call DFUNC(addSpareParts)); }; }; class Helicopter { class ADDON { - init = QUOTE(_this call DFUNC(addRepairActions)); + init = QUOTE(_this call DFUNC(addRepairActions); _this call DFUNC(addSpareParts)); }; }; class Plane { class ADDON { - init = QUOTE(_this call DFUNC(addRepairActions)); + init = QUOTE(_this call DFUNC(addRepairActions); _this call DFUNC(addSpareParts)); }; }; class Ship_F { class ADDON { - init = QUOTE(_this call DFUNC(addRepairActions)); + init = QUOTE(_this call DFUNC(addRepairActions); _this call DFUNC(addSpareParts)); }; }; class ACE_RepairItem_Base { diff --git a/addons/repair/CfgVehicles.hpp b/addons/repair/CfgVehicles.hpp index f24cd9bc9a..47cca3387b 100644 --- a/addons/repair/CfgVehicles.hpp +++ b/addons/repair/CfgVehicles.hpp @@ -91,6 +91,12 @@ class CfgVehicles { class Special { name = CSTRING(engineerSetting_RepairSpecialistOnly); value = 2; default = 1;}; }; }; + class addSpareParts { + displayName = CSTRING(addSpareParts_name); + description = CSTRING(addSpareParts_description); + typeName = "BOOL"; + defaultValue = 1; + }; }; class ModuleDescription { description = CSTRING(moduleDescription); @@ -215,19 +221,57 @@ class CfgVehicles { sync[] = {}; }; }; + class ACE_moduleAddSpareParts: Module_F { + scope = 2; + displayName = CSTRING(AddSpareParts_Module_DisplayName); + icon = QUOTE(PATHTOF(ui\Icon_Module_Repair_ca.paa)); + category = "ACE"; + function = QFUNC(moduleAddSpareParts); + functionPriority = 10; + isGlobal = 0; + isTriggerActivated = 0; + isDisposable = 0; + author = ECSTRING(common,ACETeam); + class Arguments { + class List { + displayName = CSTRING(AddSpareParts_List_DisplayName); + description = CSTRING(AddSpareParts_List_Description); + defaultValue = ""; + typeName = "STRING"; + }; + class Part { + displayName = CSTRING(AddSpareParts_Part_DisplayName); + description = CSTRING(AddSpareParts_Part_Description); + typeName = "STRING"; + class values { + class Wheel { + name = CSTRING(SpareWheel); + value = "ACE_Wheel"; + default = 1; + }; + class Track { + name = CSTRING(SpareTrack); + value = "ACE_Track"; + }; + }; + }; + class Amount { + displayName = CSTRING(AddSpareParts_Amount_DisplayName); + description = CSTRING(AddSpareParts_Amount_Description); + typeName = "NUMBER"; + defaultValue = 1; + }; + }; + class ModuleDescription { + description = CSTRING(AddSpareParts_Module_Description); + sync[] = {}; + }; + }; class LandVehicle; class Car: LandVehicle { MACRO_REPAIRVEHICLE - class ACE_Cargo { - class Cargo { - class ACE_Wheel { - type = "ACE_Wheel"; - amount = 1; - }; - }; - }; }; class Tank: LandVehicle { diff --git a/addons/repair/XEH_postInit.sqf b/addons/repair/XEH_postInit.sqf index 44ca157b0c..d61f20a31e 100644 --- a/addons/repair/XEH_postInit.sqf +++ b/addons/repair/XEH_postInit.sqf @@ -5,3 +5,17 @@ // wheels ["setWheelHitPointDamage", {(_this select 0) setHitPointDamage [_this select 1, _this select 2]}] call EFUNC(common,addEventHandler); + +if (isServer) then { + ["SettingsInitialized", { + GVAR(settingInitted) = true; // Stop collecting in FUNC(addSpareParts) + + // Exit if adding spare parts disabled + if (!GVAR(addSpareParts)) exitWith {GVAR(addSparePartsCollection) = nil}; + + // Add spare parts to vehicles in collection + { + [_x] call FUNC(addSpareParts); + } forEach GVAR(addSparePartsCollection); + }] call EFUNC(common,addEventHandler); +}; diff --git a/addons/repair/XEH_preInit.sqf b/addons/repair/XEH_preInit.sqf index ebf4c87537..28078d1b9c 100644 --- a/addons/repair/XEH_preInit.sqf +++ b/addons/repair/XEH_preInit.sqf @@ -3,6 +3,7 @@ ADDON = false; PREP(addRepairActions); +PREP(addSpareParts); PREP(canRemove); PREP(canRepair); PREP(canRepairTrack); @@ -22,6 +23,7 @@ PREP(isEngineer); PREP(isInRepairFacility); PREP(isNearRepairVehicle); PREP(isRepairVehicle); +PREP(moduleAddSpareParts); PREP(moduleAssignEngineer); PREP(moduleAssignRepairVehicle); PREP(moduleAssignRepairFacility); @@ -36,4 +38,6 @@ PREP(spawnObject); PREP(useItem); PREP(useItems); +GVAR(addSparePartsCollection) = []; + ADDON = true; diff --git a/addons/repair/functions/fnc_addSpareParts.sqf b/addons/repair/functions/fnc_addSpareParts.sqf new file mode 100644 index 0000000000..dd6588b485 --- /dev/null +++ b/addons/repair/functions/fnc_addSpareParts.sqf @@ -0,0 +1,46 @@ +/* + * Author: Jonpas + * Adds spare parts to the vehicle. Before SettingsInitialized only collect for later execution. + * + * Arguments: + * 0: Vehicle + * 1: Amount (default: 1) + * 2: Spare Part Classname (default: "") + * 3: Force (add even if setting is disabled) (default: false) + * + * Return Value: + * None + * + * Example: + * _added = [vehicle] call ace_repair_fnc_addSpareParts + * + * Public: No + */ +#include "script_component.hpp" + +private ["_part"]; +params ["_vehicle", ["_amount", 1], ["_part", ""], ["_force", false]]; +TRACE_2("params",_vehicle,_amount); + +// Exit if ace_cargo is not loaded +if !(["ace_cargo"] call EFUNC(common,isModLoaded)) exitWith {}; + +// Collect until SettingsInitialized +if (isNil QGVAR(settingInitted)) exitWith { + GVAR(addSparePartsCollection) pushBack _vehicle; +}; + +// Exit if not forced and add spare parts is disabled (after settings initted to make sure it really is) +if (!_force && !GVAR(addSpareParts)) exitWith {}; + +// Select appropriate part +if (_part == "") then { + if (_vehicle isKindOf "Car") then { _part = "ACE_Wheel" }; + if (_vehicle isKindOf "Tank") then { _part = "ACE_Track" }; +}; +// Exit if no appropriate part +if (_part == "") exitWith {}; + +// Load +//["LoadItem", [_part, _vehicle]] call EFUNC(cargo,loadItem); +[_part, _vehicle, _amount] call EFUNC(cargo,addItem); // Change to above event diff --git a/addons/repair/functions/fnc_moduleAddSpareParts.sqf b/addons/repair/functions/fnc_moduleAddSpareParts.sqf new file mode 100644 index 0000000000..46689951a7 --- /dev/null +++ b/addons/repair/functions/fnc_moduleAddSpareParts.sqf @@ -0,0 +1,61 @@ +/* + * Author: Jonpas + * Adds spare parts to a vehicle. + * + * Arguments: + * 0: The module logic + * 1: Synchronized units + * 2: Activated + * + * Return Value: + * None + * + * Example: + * function = "ace_repair_fnc_moduleAssignRepairVehicle" + * + * Public: No + */ +#define DEBUG_MODE_FULL +#include "script_component.hpp" + +params ["_logic"]; + +if (!isNull _logic) then { + private ["_list", "_part", "_amount", "_nilCheckPassedList"]; + // Module settings + _list = _logic getVariable ["List", ""]; + _part = _logic getVariable ["Part", 0]; + _amount = _logic getVariable ["Amount", 1]; + + // Parse list + _nilCheckPassedList = ""; + { + _x = [_x] call EFUNC(common,stringRemoveWhiteSpace); + if !(isnil _x) then { + if (_nilCheckPassedList == "") then { + _nilCheckPassedList = _x; + } else { + _nilCheckPassedList = _nilCheckPassedList + "," + _x; + }; + }; + } forEach ([_list, ","] call BIS_fnc_splitString); + _list = "[" + _nilCheckPassedList + "]"; + _list = [] call compile _list; + + // Add synchronized objects to list + { + _list pushBack _x; + } forEach (synchronizedObjects _logic); + + if (_list isEqualTo []) exitWith {}; + + TRACE_3("module info parsed",_list,_part,_amount); + // Add spare parts + { + if (!isNil "_x" && {typeName _x == typeName objNull}) then { + [_x, _amount, _part, true] call FUNC(addSpareParts); + }; + } forEach _list; +}; + +true diff --git a/addons/repair/functions/fnc_moduleRepairSettings.sqf b/addons/repair/functions/fnc_moduleRepairSettings.sqf index 3b97d2f168..2c7e406490 100644 --- a/addons/repair/functions/fnc_moduleRepairSettings.sqf +++ b/addons/repair/functions/fnc_moduleRepairSettings.sqf @@ -31,4 +31,6 @@ if (!isServer) exitWith {}; [_logic, QGVAR(fullRepairLocation), "fullRepairLocation"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(engineerSetting_fullRepair), "engineerSetting_fullRepair"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(addSpareParts), "addSpareParts"] call EFUNC(common,readSettingFromModule); + diag_log text "[ACE]: Repair Module Initialized."; diff --git a/addons/repair/stringtable.xml b/addons/repair/stringtable.xml index ffafc56683..ce53e79c6d 100644 --- a/addons/repair/stringtable.xml +++ b/addons/repair/stringtable.xml @@ -104,6 +104,12 @@ Who can perform a full repair on a vehicle? + + Add Spare Parts + + + Add spare parts to vehicles (requires Cargo component)? + Repair %1 Reparieren %1 @@ -635,6 +641,32 @@ Assign one or multiple objects as a repair Facility + + + Add Spare Parts + + + Add spare parts to one or multiple objects + + + List + + + List of objects that will get spare parts added, separated by commas. + + + Part + + + Spare part. + + + Amount + + + Number of selected spare parts. + + Vehicle Repair From ffb765bf7a7adaf311c8ced43328c4683af539ba Mon Sep 17 00:00:00 2001 From: jonpas Date: Tue, 18 Aug 2015 23:43:34 +0200 Subject: [PATCH 009/132] Changed to AddCargoItem event --- addons/repair/functions/fnc_addSpareParts.sqf | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/addons/repair/functions/fnc_addSpareParts.sqf b/addons/repair/functions/fnc_addSpareParts.sqf index dd6588b485..4ec01a6cc1 100644 --- a/addons/repair/functions/fnc_addSpareParts.sqf +++ b/addons/repair/functions/fnc_addSpareParts.sqf @@ -12,7 +12,7 @@ * None * * Example: - * _added = [vehicle] call ace_repair_fnc_addSpareParts + * [vehicle] call ace_repair_fnc_addSpareParts * * Public: No */ @@ -42,5 +42,4 @@ if (_part == "") then { if (_part == "") exitWith {}; // Load -//["LoadItem", [_part, _vehicle]] call EFUNC(cargo,loadItem); -[_part, _vehicle, _amount] call EFUNC(cargo,addItem); // Change to above event +["AddCargoItem", [_part, _vehicle, _amount]] call EFUNC(common,localEvent); From 4e3bbfac1677c0f09178012521907671c2d55cdd Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 18 Aug 2015 16:57:56 -0500 Subject: [PATCH 010/132] Clean old updateMapToolMarkers calls --- addons/maptools/CfgVehicles.hpp | 10 ++++---- addons/maptools/XEH_postInitClient.sqf | 3 --- .../maptools/functions/fnc_handleKeyDown.sqf | 3 ++- .../functions/fnc_handleMouseButton.sqf | 23 +++++++++---------- .../functions/fnc_handleMouseMove.sqf | 6 ++--- .../functions/fnc_updateLineMarker.sqf | 1 + .../functions/fnc_updateMapToolMarkers.sqf | 2 +- 7 files changed, 22 insertions(+), 26 deletions(-) diff --git a/addons/maptools/CfgVehicles.hpp b/addons/maptools/CfgVehicles.hpp index 5c3266d2d6..063f88f38b 100644 --- a/addons/maptools/CfgVehicles.hpp +++ b/addons/maptools/CfgVehicles.hpp @@ -14,7 +14,7 @@ class CfgVehicles { class ACE_MapToolsHide { displayName = CSTRING(MapToolsHide); condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 0})); - statement = QUOTE(GVAR(mapTool_Shown) = 0; [] call FUNC(updateMapToolMarkers)); + statement = QUOTE(GVAR(mapTool_Shown) = 0;); exceptions[] = {"isNotDragging", "notOnMap", "isNotInside", "isNotSitting"}; showDisabled = 1; priority = 5; @@ -22,7 +22,7 @@ class CfgVehicles { class ACE_MapToolsShowNormal { displayName = CSTRING(MapToolsShowNormal); condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 1})); - statement = QUOTE(GVAR(mapTool_Shown) = 1; [] call FUNC(updateMapToolMarkers)); + statement = QUOTE(GVAR(mapTool_Shown) = 1;); exceptions[] = {"isNotDragging", "notOnMap", "isNotInside", "isNotSitting"}; showDisabled = 1; priority = 4; @@ -30,7 +30,7 @@ class CfgVehicles { class ACE_MapToolsShowSmall { displayName = CSTRING(MapToolsShowSmall); condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 2})); - statement = QUOTE(GVAR(mapTool_Shown) = 2; [] call FUNC(updateMapToolMarkers)); + statement = QUOTE(GVAR(mapTool_Shown) = 2;); exceptions[] = {"isNotDragging", "notOnMap", "isNotInside", "isNotSitting"}; showDisabled = 1; priority = 3; @@ -38,7 +38,7 @@ class CfgVehicles { class ACE_MapToolsAlignNorth { displayName = CSTRING(MapToolsAlignNorth); condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 0})); - statement = QUOTE(GVAR(mapTool_angle) = 0; [] call FUNC(updateMapToolMarkers)); + statement = QUOTE(GVAR(mapTool_angle) = 0;); exceptions[] = {"isNotDragging", "notOnMap", "isNotInside", "isNotSitting"}; showDisabled = 1; priority = 2; @@ -46,7 +46,7 @@ class CfgVehicles { class ACE_MapToolsAlignCompass { displayName = CSTRING(MapToolsAlignCompass); condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 0} && {('ItemCompass' in assigneditems ACE_player) || {'ItemCompass' in assigneditems ACE_player}})); - statement = QUOTE(GVAR(mapTool_angle) = getDir ACE_player; [] call FUNC(updateMapToolMarkers)); + statement = QUOTE(GVAR(mapTool_angle) = getDir ACE_player;); exceptions[] = {"isNotDragging", "notOnMap", "isNotInside", "isNotSitting"}; showDisabled = 1; priority = 1; diff --git a/addons/maptools/XEH_postInitClient.sqf b/addons/maptools/XEH_postInitClient.sqf index 34c0a9e750..1e428f71b7 100644 --- a/addons/maptools/XEH_postInitClient.sqf +++ b/addons/maptools/XEH_postInitClient.sqf @@ -64,9 +64,6 @@ GVAR(drawing_controls) = [36732, 36733, 36734, 36735, 36736, 36737]; // Install event handlers on the map control and display (control = 51) GVAR(drawing_syncMarkers) = false; 12 call _fnc_installMapEvents; - - // Update the size and rotation of map tools - [] call FUNC(updateMapToolMarkers); }; ["mapOpened", { diff --git a/addons/maptools/functions/fnc_handleKeyDown.sqf b/addons/maptools/functions/fnc_handleKeyDown.sqf index 297c87e789..a83522ac91 100644 --- a/addons/maptools/functions/fnc_handleKeyDown.sqf +++ b/addons/maptools/functions/fnc_handleKeyDown.sqf @@ -16,10 +16,11 @@ #include "script_component.hpp" params ["", "_code"]; +TRACE_1("params",_code); private ["_handled", "_relPos", "_diffVector", "_magDiffVector", "_lambdaLong", "_lambdaTrasAbs"]; -_handled = false; +_handled = false; #define DIK_ESCAPE 0x01 #define DIK_DELETE 0xD3 diff --git a/addons/maptools/functions/fnc_handleMouseButton.sqf b/addons/maptools/functions/fnc_handleMouseButton.sqf index ec0d1264fc..442ec4d50e 100644 --- a/addons/maptools/functions/fnc_handleMouseButton.sqf +++ b/addons/maptools/functions/fnc_handleMouseButton.sqf @@ -14,6 +14,7 @@ params ["_dir", "_params"]; _params params ["_control", "_button", "_screenPosX", "_screenPosY", "_shiftKey", "_ctrlKey", "_altKey"]; +TRACE_2("params",_dir,_params); private["_gui", "_handled", "_marker", "_pos"]; @@ -23,16 +24,14 @@ _handled = false; if (_button != 0) exitWith {_handled}; // If releasing -if ((_dir != 1) && {(GVAR(mapTool_isDragging) || GVAR(mapTool_isRotating))}) exitWith { - GVAR(mapTool_isDragging) = false; - GVAR(mapTool_isRotating) = false; - _handled = true; - _handled -}; - -// If clicking -if (_dir == 1) exitWith { - +if (_dir != 1) then { + if (GVAR(mapTool_isDragging) || GVAR(mapTool_isRotating)) then { + GVAR(mapTool_isDragging) = false; + GVAR(mapTool_isRotating) = false; + _handled = true; + }; +} else { + // If clicking if !(call FUNC(canDraw)) exitWith {_handled = false;}; // Transform mouse screen position to coordinates @@ -43,7 +42,6 @@ if (_dir == 1) exitWith { // Already drawing -> Add tempLineMarker to permanent list if (GVAR(drawing_syncMarkers)) then { deleteMarkerLocal (GVAR(drawing_tempLineMarker) select 0); - // [GVAR(drawing_tempLineMarker), "FUNC(addLineMarker)", 2] call EFUNC(common,execRemoteFnc); ["drawing_addLineMarker", GVAR(drawing_tempLineMarker)] call EFUNC(common,globalEvent); // Log who drew on the briefing screen (text format ["[ACE] Server: Player %1 drew on the briefing screen", profileName]) call EFUNC(common,serverLog); @@ -90,8 +88,9 @@ if (_dir == 1) exitWith { }; _handled = true; }; - _handled }; +diag_log text format ["HJa %1", _handled]; + _handled diff --git a/addons/maptools/functions/fnc_handleMouseMove.sqf b/addons/maptools/functions/fnc_handleMouseMove.sqf index 7e2883382b..b27087290b 100644 --- a/addons/maptools/functions/fnc_handleMouseMove.sqf +++ b/addons/maptools/functions/fnc_handleMouseMove.sqf @@ -13,6 +13,7 @@ #include "script_component.hpp" params ["_control", "_mousePosX", "_mousePosY"]; +TRACE_3("params",_control,_mousePosX,_mousePosY); private ["_control", "_pos"]; @@ -31,6 +32,7 @@ if !(call FUNC(canDraw)) exitWith { // Handle drawing if (GVAR(drawing_isDrawing)) exitWith { GVAR(drawing_tempLineMarker) set [2, GVAR(mousePosition)]; + TRACE_1("updating line pos",GVAR(mousePosition)); GVAR(drawing_tempLineMarker) call FUNC(updateLineMarker); false }; @@ -43,8 +45,6 @@ if (GVAR(mapTool_isDragging)) exitWith { GVAR(mapTool_pos) set [0, (GVAR(mapTool_startPos) select 0) + (GVAR(mousePosition) select 0) - (GVAR(mapTool_startDragPos) select 0)]; GVAR(mapTool_pos) set [1, (GVAR(mapTool_startPos) select 1) + (GVAR(mousePosition) select 1) - (GVAR(mapTool_startDragPos) select 1)]; - // Update the size and rotation of the maptool - [] call FUNC(updateMapToolMarkers); true }; @@ -55,8 +55,6 @@ if (GVAR(mapTool_isRotating)) exitWith { _angle = (180 + ((GVAR(mousePosition) select 0) - (GVAR(mapTool_startPos) select 0)) atan2 ((GVAR(mousePosition) select 1) - (GVAR(mapTool_startPos) select 1)) mod 360); GVAR(mapTool_angle) = GVAR(mapTool_startAngle) + _angle - GVAR(mapTool_startDragAngle); - // Update the size and rotation of the maptool - [] call FUNC(updateMapToolMarkers); true }; diff --git a/addons/maptools/functions/fnc_updateLineMarker.sqf b/addons/maptools/functions/fnc_updateLineMarker.sqf index 6400d02461..12aee5b1df 100644 --- a/addons/maptools/functions/fnc_updateLineMarker.sqf +++ b/addons/maptools/functions/fnc_updateLineMarker.sqf @@ -14,6 +14,7 @@ #include "script_component.hpp" params ["_name", "_startPos", "_endPos", "_color"]; +TRACE_4("params",_name,_startPos,_endPos,_color); private ["_difPos", "_mag"]; diff --git a/addons/maptools/functions/fnc_updateMapToolMarkers.sqf b/addons/maptools/functions/fnc_updateMapToolMarkers.sqf index c4f2f6f1dc..5c88d907b8 100644 --- a/addons/maptools/functions/fnc_updateMapToolMarkers.sqf +++ b/addons/maptools/functions/fnc_updateMapToolMarkers.sqf @@ -21,7 +21,7 @@ params ["_theMap"]; private ["_rotatingTexture", "_textureWidth", "_scale", "_xPos", "_yPos"]; // Show/Hide draw buttons -if ("ACE_MapTools" in items ACE_player) then { +if ([] call FUNC(canDraw)) then { { ((findDisplay 12) displayCtrl _x) ctrlShow true; } forEach GVAR(drawing_controls); } else { { ((findDisplay 12) displayCtrl _x) ctrlShow false; } forEach GVAR(drawing_controls); From 5b8708a179df47fbf4a2c87d117f8dcbaafc55d3 Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Thu, 20 Aug 2015 18:17:37 +0100 Subject: [PATCH 011/132] Prevent CBA keybindings in zeus interface Checks if the key pressed matches the zeus menu keybind and only fires the code to handle CBA keybinds if true. Should fix the majority of weirdness with keybinds in zeus. However, not perfect as shared keybinds with different modifiers will still fire and it's really an un-ideal workaround. --- addons/interact_menu/XEH_clientInit.sqf | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/addons/interact_menu/XEH_clientInit.sqf b/addons/interact_menu/XEH_clientInit.sqf index cbc28e66b4..7c7724d9b4 100644 --- a/addons/interact_menu/XEH_clientInit.sqf +++ b/addons/interact_menu/XEH_clientInit.sqf @@ -75,10 +75,24 @@ addMissionEventHandler ["Draw3D", DFUNC(render)]; if (GVAR(menuBackground)==2) then {(uiNamespace getVariable [QGVAR(menuBackground), displayNull]) closeDisplay 0;}; }] call EFUNC(common,addEventHandler); -// Let key work with zeus open (not perfect, enables all added hotkeys in zeus interface rather than only menu) +// Let key work with zeus open (not perfect, contains workaround to prevent other CBA keybindings) ["zeusDisplayChanged",{ if (_this select 1) then { - (finddisplay 312) displayAddEventHandler ["KeyUp", {[_this,'keyup'] call CBA_events_fnc_keyHandler}]; - (finddisplay 312) displayAddEventHandler ["KeyDown", {[_this,'keydown'] call CBA_events_fnc_keyHandler}]; + (finddisplay 312) displayAddEventHandler ["KeyUp", { + _key = ["ACE3 Common","ace_interact_menu_InteractKey"] call CBA_fnc_getKeybind; + _key = (_key select 5) select 0; + + if ((_this select 1) == _key) then { + [_this,'keyup'] call CBA_events_fnc_keyHandler + }; + }]; + (finddisplay 312) displayAddEventHandler ["KeyDown", { + _key = ["ACE3 Common","ace_interact_menu_InteractKey"] call CBA_fnc_getKeybind; + _key = (_key select 5) select 0; + + if ((_this select 1) == _key) then { + [_this,'keydown'] call CBA_events_fnc_keyHandler + }; + }]; }; }] call EFUNC(common,addEventHandler); From d09ca9ec8be5ce1102f740ae524b90fb8d16c2fa Mon Sep 17 00:00:00 2001 From: jokoho48 Date: Sat, 22 Aug 2015 16:25:10 +0200 Subject: [PATCH 012/132] Code Cleanup Medical Module (Part 1). --- .../fnc_actionCheckBloodPressure.sqf | 7 +- .../fnc_actionCheckBloodPressureLocal.sqf | 11 ++- .../functions/fnc_actionCheckPulse.sqf | 7 +- .../functions/fnc_actionCheckPulseLocal.sqf | 7 +- .../functions/fnc_actionCheckResponse.sqf | 14 ++-- .../medical/functions/fnc_actionDiagnose.sqf | 7 +- .../medical/functions/fnc_actionLoadUnit.sqf | 13 ++-- .../functions/fnc_actionPlaceInBodyBag.sqf | 3 +- .../functions/fnc_actionRemoveTourniquet.sqf | 8 +-- .../functions/fnc_actionUnloadUnit.sqf | 11 ++- .../functions/fnc_addHeartRateAdjustment.sqf | 9 +-- .../functions/fnc_addToInjuredCollection.sqf | 16 ++--- addons/medical/functions/fnc_addToLog.sqf | 23 +++--- .../medical/functions/fnc_addToTriageCard.sqf | 11 ++- .../functions/fnc_addUnconsciousCondition.sqf | 7 +- .../functions/fnc_addUnloadPatientActions.sqf | 5 +- .../medical/functions/fnc_adjustPainLevel.sqf | 2 +- .../fnc_canAccessMedicalEquipment.sqf | 7 +- addons/medical/functions/fnc_canTreat.sqf | 31 ++++---- .../medical/functions/fnc_canTreatCached.sqf | 3 +- addons/medical/functions/fnc_copyDeadBody.sqf | 7 +- addons/medical/functions/fnc_createLitter.sqf | 50 +++++++------ .../functions/fnc_determineIfFatal.sqf | 26 +++---- .../fnc_displayPatientInformation.sqf | 71 +++++++++---------- .../functions/fnc_displayTriageCard.sqf | 29 ++++---- .../functions/fnc_dropDownTriageCard.sqf | 8 +-- addons/medical/functions/fnc_getBloodLoss.sqf | 9 ++- .../functions/fnc_getBloodPressure.sqf | 19 +++-- .../functions/fnc_getBloodVolumeChange.sqf | 10 ++- .../functions/fnc_getCardiacOutput.sqf | 3 +- .../functions/fnc_getHeartRateChange.sqf | 11 ++- .../medical/functions/fnc_getTriageStatus.sqf | 8 ++- .../medical/functions/fnc_getTypeOfDamage.sqf | 32 ++++----- .../functions/fnc_getUnconsciousCondition.sqf | 6 +- .../functions/fnc_handleBandageOpening.sqf | 30 +++----- .../functions/fnc_handleCreateLitter.sqf | 32 ++++++--- addons/medical/functions/fnc_handleDamage.sqf | 11 +-- .../functions/fnc_handleDamage_advanced.sqf | 11 +-- .../fnc_handleDamage_advancedSetDamage.sqf | 6 +- .../functions/fnc_handleDamage_airway.sqf | 10 +-- .../functions/fnc_handleDamage_basic.sqf | 17 ++--- .../functions/fnc_handleDamage_caching.sqf | 28 ++++---- .../functions/fnc_handleDamage_fractures.sqf | 8 +-- .../fnc_handleDamage_internalInjuries.sqf | 10 +-- .../functions/fnc_handleDamage_wounds.sqf | 17 ++--- .../functions/fnc_handleDamage_woundsOld.sqf | 14 ++-- addons/medical/functions/fnc_handleKilled.sqf | 4 +- addons/medical/functions/fnc_handleLocal.sqf | 4 +- .../functions/fnc_handleUnitVitals.sqf | 10 ++- addons/medical/functions/fnc_hasItem.sqf | 12 ++-- addons/medical/functions/fnc_hasItems.sqf | 6 +- .../functions/fnc_hasMedicalEnabled.sqf | 32 +++++---- .../functions/fnc_hasTourniquetAppliedTo.sqf | 4 +- addons/medical/functions/fnc_init.sqf | 5 +- .../medical/functions/fnc_isBeingCarried.sqf | 2 +- .../medical/functions/fnc_isBeingDragged.sqf | 2 +- .../functions/fnc_isInMedicalFacility.sqf | 8 +-- .../functions/fnc_isInMedicalVehicle.sqf | 5 +- .../functions/fnc_isInStableCondition.sqf | 6 +- addons/medical/functions/fnc_isMedic.sqf | 5 +- .../functions/fnc_isMedicalVehicle.sqf | 3 +- addons/medical/functions/fnc_itemCheck.sqf | 5 +- .../functions/fnc_modifyMedicalAction.sqf | 9 +-- .../fnc_moduleAdvancedMedicalSettings.sqf | 7 +- .../functions/fnc_moduleAssignMedicRoles.sqf | 14 ++-- .../fnc_moduleAssignMedicalFacility.sqf | 8 +-- .../fnc_moduleAssignMedicalVehicle.sqf | 14 ++-- .../functions/fnc_moduleMedicalSettings.sqf | 7 +- .../functions/fnc_moduleReviveSettings.sqf | 7 +- .../functions/fnc_onMedicationUsage.sqf | 40 ++++------- .../functions/fnc_onPropagateWound.sqf | 7 +- .../functions/fnc_onWoundUpdateRequest.sqf | 7 +- .../functions/fnc_parseConfigForInjuries.sqf | 29 ++++---- .../functions/fnc_playInjuredSound.sqf | 6 +- .../functions/fnc_setCardiacArrest.sqf | 4 +- addons/medical/functions/fnc_setDead.sqf | 4 +- .../fnc_treatmentTourniquetLocal.sqf | 4 +- .../medical/functions/fnc_unconsciousPFH.sqf | 6 +- 78 files changed, 428 insertions(+), 543 deletions(-) diff --git a/addons/medical/functions/fnc_actionCheckBloodPressure.sqf b/addons/medical/functions/fnc_actionCheckBloodPressure.sqf index e8e03bb4c0..96c9740b5d 100644 --- a/addons/medical/functions/fnc_actionCheckBloodPressure.sqf +++ b/addons/medical/functions/fnc_actionCheckBloodPressure.sqf @@ -7,14 +7,11 @@ * 1: The patient * * Return Value: -* NONE +* None * * Public: No */ #include "script_component.hpp" -private ["_caller","_target"]; -_caller = _this select 0; -_target = _this select 1; -[[_caller, _target], QUOTE(DFUNC(actionCheckBloodPressureLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ +[_this, QUOTE(DFUNC(actionCheckBloodPressureLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ diff --git a/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf b/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf index 82edd1749f..c7b444de73 100644 --- a/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf +++ b/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf @@ -7,24 +7,21 @@ * 1: The patient * * Return Value: - * NONE + * None * * Public: No */ #include "script_component.hpp" -private ["_caller","_target","_bloodPressure","_bloodPressureHigh","_bloodPressureLow", "_logOutPut", "_output"]; -_caller = _this select 0; -_target = _this select 1; +private ["_bloodPressure", "_logOutPut", "_output"]; +params ["_caller", "_target"]; _bloodPressure = [_target] call FUNC(getBloodPressure); if (!alive _target) then { _bloodPressure = [0,0]; }; - -_bloodPressureHigh = _bloodPressure select 1; -_bloodPressureLow = _bloodPressure select 0; +_bloodPressure params ["_bloodPressureLow", "_bloodPressureLow"]; _output = ""; _logOutPut = ""; if ([_caller] call FUNC(isMedic)) then { diff --git a/addons/medical/functions/fnc_actionCheckPulse.sqf b/addons/medical/functions/fnc_actionCheckPulse.sqf index fd96321e8f..1861195a04 100644 --- a/addons/medical/functions/fnc_actionCheckPulse.sqf +++ b/addons/medical/functions/fnc_actionCheckPulse.sqf @@ -7,14 +7,11 @@ * 1: The patient * * Return Value: -* NONE +* None * * Public: No */ #include "script_component.hpp" -private ["_caller","_target"]; -_caller = _this select 0; -_target = _this select 1; -[[_caller, _target], QUOTE(DFUNC(actionCheckPulseLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ +[_this, QUOTE(DFUNC(actionCheckPulseLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ diff --git a/addons/medical/functions/fnc_actionCheckPulseLocal.sqf b/addons/medical/functions/fnc_actionCheckPulseLocal.sqf index d759bf1bc8..74f9fc5eb5 100644 --- a/addons/medical/functions/fnc_actionCheckPulseLocal.sqf +++ b/addons/medical/functions/fnc_actionCheckPulseLocal.sqf @@ -7,16 +7,15 @@ * 1: The patient * * Return Value: - * NONE + * None * * Public: No */ #include "script_component.hpp" -private ["_caller", "_unit", "_heartRateOutput", "_heartRate", "_logOutPut"]; -_caller = _this select 0; -_unit = _this select 1; +private ["_heartRateOutput", "_heartRate", "_logOutPut"]; +params ["_caller", "_unit"]; _heartRate = _unit getvariable [QGVAR(heartRate), 80]; diff --git a/addons/medical/functions/fnc_actionCheckResponse.sqf b/addons/medical/functions/fnc_actionCheckResponse.sqf index b5df63047e..7db4fe0a5d 100644 --- a/addons/medical/functions/fnc_actionCheckResponse.sqf +++ b/addons/medical/functions/fnc_actionCheckResponse.sqf @@ -7,22 +7,20 @@ * 1: The patient * * Return Value: - * NONE + * None * * Public: No */ #include "script_component.hpp" -private ["_caller","_target", "_output"]; -_caller = _this select 0; -_target = _this select 1; +private ["_output"]; +params ["_caller", "_target"]; -_output = ""; -if ([_target] call EFUNC(common,isAwake)) then { - _output = LSTRING(Check_Response_Responsive); +_output = if ([_target] call EFUNC(common,isAwake)) then { + LSTRING(Check_Response_Responsive) } else { - _output = LSTRING(Check_Response_Unresponsive); + LSTRING(Check_Response_Unresponsive) }; ["displayTextStructured", [_caller], [[_output, [_target] call EFUNC(common,getName)], 2, _caller]] call EFUNC(common,targetEvent); diff --git a/addons/medical/functions/fnc_actionDiagnose.sqf b/addons/medical/functions/fnc_actionDiagnose.sqf index 243edbdef8..5cc0d307da 100644 --- a/addons/medical/functions/fnc_actionDiagnose.sqf +++ b/addons/medical/functions/fnc_actionDiagnose.sqf @@ -7,16 +7,15 @@ * 1: The patient * * Return Value: -* NONE +* None * * Public: No */ #include "script_component.hpp" -private ["_caller", "_target", "_genericMessages"]; -_caller = _this select 0; -_target = _this select 1; +private "_genericMessages"; +params ["_caller", "_target"]; _genericMessages = [LSTRING(diagnoseMessage)]; diff --git a/addons/medical/functions/fnc_actionLoadUnit.sqf b/addons/medical/functions/fnc_actionLoadUnit.sqf index 03d9a3ef54..f4b941383f 100644 --- a/addons/medical/functions/fnc_actionLoadUnit.sqf +++ b/addons/medical/functions/fnc_actionLoadUnit.sqf @@ -7,26 +7,25 @@ * 1: The patient * * Return Value: - * NONE + * None * * Public: No */ #include "script_component.hpp" -private ["_caller", "_target","_vehicle"]; -_caller = _this select 0; -_target = _this select 1; +private "_vehicle"; +params ["_caller", "_target"]; if ([_target] call EFUNC(common,isAwake)) exitwith { // TODO localization ["displayTextStructured", [_caller], [["This person (%1) is awake and cannot be loaded", [_target] call EFUNC(common,getName)], 1.5, _caller]] call EFUNC(common,targetEvent); }; if ([_target] call FUNC(isBeingCarried)) then { - [_caller, _target] call EFUNC(dragging,dropObject_carry); + _this call EFUNC(dragging,dropObject_carry); }; if ([_target] call FUNC(isBeingDragged)) then { - [_caller, _target] call EFUNC(dragging,dropObject); + _this call EFUNC(dragging,dropObject); }; -_vehicle = [_caller, _target] call EFUNC(common,loadPerson); +_vehicle = _this call EFUNC(common,loadPerson); diff --git a/addons/medical/functions/fnc_actionPlaceInBodyBag.sqf b/addons/medical/functions/fnc_actionPlaceInBodyBag.sqf index 73f9eeca4d..f416535701 100644 --- a/addons/medical/functions/fnc_actionPlaceInBodyBag.sqf +++ b/addons/medical/functions/fnc_actionPlaceInBodyBag.sqf @@ -14,9 +14,8 @@ #include "script_component.hpp" -PARAMS_2(_caller,_target); - private ["_position", "_headPos", "_spinePos", "_dirVect", "_direction", "_bodyBag"]; +params ["_caller", "_target"]; if (alive _target) then { [_target, true] call FUNC(setDead); diff --git a/addons/medical/functions/fnc_actionRemoveTourniquet.sqf b/addons/medical/functions/fnc_actionRemoveTourniquet.sqf index a14dbc3bcd..778042e9a6 100644 --- a/addons/medical/functions/fnc_actionRemoveTourniquet.sqf +++ b/addons/medical/functions/fnc_actionRemoveTourniquet.sqf @@ -8,17 +8,15 @@ * 2: SelectionName * * Return Value: - * NONE + * None * * Public: Yes */ #include "script_component.hpp" -private ["_caller", "_target", "_part", "_selectionName", "_tourniquets", "_output"]; -_caller = _this select 0; -_target = _this select 1; -_selectionName = _this select 2; +private ["_part", "_tourniquets", "_output"]; +params ["_caller", "_target", "_selectionName"]; // grab the required data _part = [_selectionName] call FUNC(selectionNameToNumber); diff --git a/addons/medical/functions/fnc_actionUnloadUnit.sqf b/addons/medical/functions/fnc_actionUnloadUnit.sqf index a73f32265a..6bb4f5beed 100644 --- a/addons/medical/functions/fnc_actionUnloadUnit.sqf +++ b/addons/medical/functions/fnc_actionUnloadUnit.sqf @@ -5,23 +5,20 @@ * Arguments: * 0: The medic * 1: The patient - * 2: Drag after unload + * 2: Drag after unload (default: false) * * Return Value: - * NONE + * None * * Public: No */ #include "script_component.hpp" -private ["_caller", "_target", "_drag"]; -_caller = _this select 0; -_target = _this select 1; -_drag = if (count _this > 2) then {_this select 2} else {false}; +params ["_caller", "_target", ["_drag", false]]; // cannot unload a unit not in a vehicle. if (vehicle _target == _target) exitwith {}; if (([_target] call EFUNC(common,isAwake))) exitwith {}; -["unloadPersonEvent", _target, [_target, vehicle _target]] call EFUNC(common,targetEvent) \ No newline at end of file +["unloadPersonEvent", _target, [_target, vehicle _target]] call EFUNC(common,targetEvent) diff --git a/addons/medical/functions/fnc_addHeartRateAdjustment.sqf b/addons/medical/functions/fnc_addHeartRateAdjustment.sqf index f4516a100c..7171eee275 100644 --- a/addons/medical/functions/fnc_addHeartRateAdjustment.sqf +++ b/addons/medical/functions/fnc_addHeartRateAdjustment.sqf @@ -9,18 +9,15 @@ * 3: callback * * Return Value: - * nil + * None * * Public: Yes */ #include "script_component.hpp" -private ["_unit", "_value", "_time", "_adjustment", "_callBack"]; -_unit = [_this, 0, objNull, [objNull]] call BIS_fnc_Param; -_value = [_this, 1, 0, [0]] call BIS_fnc_Param; -_time = [_this, 2, 1, [0]] call BIS_fnc_Param; -_callBack = [_this, 3, {}, [{}]] call BIS_fnc_Param; + +params [["_unit", objNull, [objNull]], ["_value", 0, [0]], ["_time", 1, [0]], ["_callBack", {}, [{}]]]; _adjustment = _unit getvariable [QGVAR(heartRateAdjustments), []]; _adjustment pushback [_value, _time, _callBack]; diff --git a/addons/medical/functions/fnc_addToInjuredCollection.sqf b/addons/medical/functions/fnc_addToInjuredCollection.sqf index 083f949d9d..66433a5ed0 100644 --- a/addons/medical/functions/fnc_addToInjuredCollection.sqf +++ b/addons/medical/functions/fnc_addToInjuredCollection.sqf @@ -6,16 +6,14 @@ * 0: The Unit * * ReturnValue: - * + * None * * Public: Yes */ #include "script_component.hpp" -private ["_unit", "_force"]; -_unit = _this select 0; -_force = if (count _this > 1) then {_this select 1} else {false}; +params ["_unit", ["_force", false]]; if ([_unit] call FUNC(hasMedicalEnabled) || _force) then { @@ -27,13 +25,13 @@ if ([_unit] call FUNC(hasMedicalEnabled) || _force) then { _unit setvariable [QGVAR(addedToUnitLoop), true, true]; [{ - private ["_unit", "_interval"]; - _unit = (_this select 0) select 0; - _interval = ACE_time - ((_this select 0) select 1); + params ["_args", "_idPFH"]; + _args params ["_unit", "_interval"]; + _interval = ACE_time - _interval; (_this select 0) set [1, ACE_time]; - + if (!alive _unit || !local _unit) then { - [_this select 1] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; if (!local _unit) then { if (GVAR(level) >= 2) then { _unit setvariable [QGVAR(heartRate), _unit getvariable [QGVAR(heartRate), 80], true]; diff --git a/addons/medical/functions/fnc_addToLog.sqf b/addons/medical/functions/fnc_addToLog.sqf index af7d9f3170..54a685611a 100644 --- a/addons/medical/functions/fnc_addToLog.sqf +++ b/addons/medical/functions/fnc_addToLog.sqf @@ -9,27 +9,26 @@ * 3: The arguments for localization * * Return Value: - * nil + * None * * Public: Yes */ #include "script_component.hpp" -private ["_unit", "_type", "_message", "_arguments", "_lastNumber", "_moment", "_logVarName", "_log","_newLog", "_logs"]; -_unit = _this select 0; -_type = _this select 1; -_message = _this select 2; -_arguments = _this select 3; +private ["_moment", "_logVarName", "_log","_newLog", "_logs"]; +params ["_unit", "_type", "_allMapMarkers", "_arguments"]; if (!local _unit) exitwith { [_this, QUOTE(DFUNC(addToLog)), _unit] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ }; -_lastNumber = date select 4; -_moment = format["%1:%2",date select 3, _lastNumber]; -if (_lastNumber < 10) then { - _moment = format["%1:0%2",date select 3, _lastNumber]; +date params ["_minute", "_hour"]; + +_moment = if (_minute < 10) then { + format["%1:0%2", _hour, _minute] +} else { + format["%1:%2", _hour, _minute] }; _logVarName = format[QGVAR(logFile_%1), _type]; @@ -41,10 +40,10 @@ if (count _log >= 8) then { if (_foreachIndex > 0) then { _newLog pushback _x; }; - }foreach _log; + } foreach _log; _log = _newLog; }; -_log pushback [_message,_moment,_type, _arguments]; +_log pushback [_message, _moment, _type, _arguments]; _unit setvariable [_logVarName, _log, true]; ["medical_onLogEntryAdded", [_unit, _type, _message, _arguments]] call EFUNC(common,localEvent); diff --git a/addons/medical/functions/fnc_addToTriageCard.sqf b/addons/medical/functions/fnc_addToTriageCard.sqf index 7495c04a8a..1869340ad8 100644 --- a/addons/medical/functions/fnc_addToTriageCard.sqf +++ b/addons/medical/functions/fnc_addToTriageCard.sqf @@ -7,16 +7,15 @@ * 1: The new item classname * * Return Value: - * nil + * None * * Public: Yes */ #include "script_component.hpp" - -private ["_unit", "_newItem", "_log", "_inList", "_amount"]; -_unit = _this select 0; -_newItem = _this select 1; +d +private ["_log", "_inList", "_amount"]; +params ["_unit", "_newItem"]; if (!local _unit) exitwith { [_this, QUOTE(DFUNC(addToTriageList)), _unit] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ @@ -36,7 +35,7 @@ _amount = 1; _amount = (_info select 1); _inList = true; }; -}foreach _log; +} foreach _log; if (!_inList) then { _log pushback [_newItem, 1, ACE_time]; diff --git a/addons/medical/functions/fnc_addUnconsciousCondition.sqf b/addons/medical/functions/fnc_addUnconsciousCondition.sqf index 579a55ca1f..6a867088da 100644 --- a/addons/medical/functions/fnc_addUnconsciousCondition.sqf +++ b/addons/medical/functions/fnc_addUnconsciousCondition.sqf @@ -3,14 +3,13 @@ * Adds new condition for the unconscious state. Conditions are not actively checked for units unless unit is in unconscious state. * * Arguments: - * 0: Code, should return a boolean + * 0-N: Code, should return a boolean * * ReturnValue: - * + * None * * Public: Yes */ - #include "script_component.hpp" if (isnil QGVAR(unconsciousConditions)) then { @@ -21,5 +20,5 @@ if (typeName _this == typeName []) then { if (typeName _x == typeName {}) then { GVAR(unconsciousConditions) pushback _x; }; - }foreach _this; + } foreach _this; }; diff --git a/addons/medical/functions/fnc_addUnloadPatientActions.sqf b/addons/medical/functions/fnc_addUnloadPatientActions.sqf index 13a4177859..11e0463328 100644 --- a/addons/medical/functions/fnc_addUnloadPatientActions.sqf +++ b/addons/medical/functions/fnc_addUnloadPatientActions.sqf @@ -13,8 +13,7 @@ * Public: No */ #include "script_component.hpp" - -EXPLODE_3_PVT(_this,_vehicle,_player,_parameters); +params ["_vehicle", "_player", "_parameters"]; private ["_actions", "_unit"]; _actions = []; @@ -28,7 +27,7 @@ _actions = []; str(_unit), [_unit, true] call EFUNC(common,getName), "", - {[_player, (_this select 2) select 0] call FUNC(actionUnloadUnit);}, + {[_player, _parameters select 0] call FUNC(actionUnloadUnit);}, {true}, {}, [_unit] diff --git a/addons/medical/functions/fnc_adjustPainLevel.sqf b/addons/medical/functions/fnc_adjustPainLevel.sqf index 7e6ce2d5f1..c4aab9e48d 100644 --- a/addons/medical/functions/fnc_adjustPainLevel.sqf +++ b/addons/medical/functions/fnc_adjustPainLevel.sqf @@ -18,7 +18,7 @@ private ["_pain"]; -PARAMS_2(_unit,_addedPain); +params ["_unit", "_addedPain"]; //Only run on local units: if (!local _unit) exitWith {ERROR("unit is not local");}; diff --git a/addons/medical/functions/fnc_canAccessMedicalEquipment.sqf b/addons/medical/functions/fnc_canAccessMedicalEquipment.sqf index 4b1940b7e3..0be01ac492 100644 --- a/addons/medical/functions/fnc_canAccessMedicalEquipment.sqf +++ b/addons/medical/functions/fnc_canAccessMedicalEquipment.sqf @@ -14,9 +14,8 @@ #include "script_component.hpp" -private ["_target", "_caller", "_accessLevel", "_return"]; -_caller = _this select 0; -_target = _this select 1; +private ["_accessLevel", "_return"]; +params ["_caller", "_targ"]; _accessLevel = _target getvariable [QGVAR(allowSharedEquipmentAccess), -1]; @@ -28,4 +27,4 @@ if (_accessLevel >= 0) then { if (_accessLevel == 2) exitwith { _return = (group _target == group _caller); }; }; -_return; \ No newline at end of file +_return; diff --git a/addons/medical/functions/fnc_canTreat.sqf b/addons/medical/functions/fnc_canTreat.sqf index e0cab95420..e1817d21fe 100644 --- a/addons/medical/functions/fnc_canTreat.sqf +++ b/addons/medical/functions/fnc_canTreat.sqf @@ -16,17 +16,16 @@ #include "script_component.hpp" -private ["_caller", "_target", "_selectionName", "_className", "_config", "_medicRequired", "_items", "_locations", "_return", "_condition", "_patientStateCondition", "_allowedSelections"]; -_caller = _this select 0; -_target = _this select 1; -_selectionName = _this select 2; -_className = _this select 3; +private ["_config", "_medicRequired", "_items", "_locations", "_return", "_condition", "_patientStateCondition", "_allowedSelections"]; +params ["_caller", "_target", "_selectionName", "_className"]; -if !(_target isKindOf "CAManBase") exitWith {false}; +if !(_target isKindOf "CAManBase") exitWith { false }; -_config = (ConfigFile >> "ACE_Medical_Actions" >> "Basic" >> _className); -if (GVAR(level)>=2) then { - _config = (ConfigFile >> "ACE_Medical_Actions" >> "Advanced" >> _className); + +_config = if (GVAR(level)>=2) then { + (ConfigFile >> "ACE_Medical_Actions" >> "Advanced" >> _className) +} else { + (ConfigFile >> "ACE_Medical_Actions" >> "Basic" >> _className) }; if !(isClass _config) exitwith {false}; @@ -35,17 +34,17 @@ _medicRequired = if (isNumber (_config >> "requiredMedic")) then { } else { // Check for required class if (isText (_config >> "requiredMedic")) exitwith { - missionNamespace getvariable [(getText (_config >> "requiredMedic")), 0]; + missionNamespace getvariable [(getText (_config >> "requiredMedic")), 0] }; 0; }; -if !([_caller, _medicRequired] call FUNC(isMedic)) exitwith {false}; +if !([_caller, _medicRequired] call FUNC(isMedic)) exitwith { false }; _items = getArray (_config >> "items"); -if (count _items > 0 && {!([_caller, _target, _items] call FUNC(hasItems))}) exitwith {false}; +if (count _items > 0 && {!([_caller, _target, _items] call FUNC(hasItems))}) exitwith { false }; _allowedSelections = getArray (_config >> "allowedSelections"); -if !("All" in _allowedSelections || {(_selectionName in _allowedSelections)}) exitwith {false}; +if !("All" in _allowedSelections || {(_selectionName in _allowedSelections)}) exitwith { false }; _return = true; if (getText (_config >> "condition") != "") then { @@ -61,7 +60,7 @@ if (getText (_config >> "condition") != "") then { _return = [_caller, _target, _selectionName, _className] call _condition; }; }; -if (!_return) exitwith {false}; +if (!_return) exitwith { false }; _patientStateCondition = if (isText(_config >> "patientStateCondition")) then { missionNamespace getvariable [getText(_config >> "patientStateCondition"), 0] @@ -71,7 +70,7 @@ _patientStateCondition = if (isText(_config >> "patientStateCondition")) then { if (_patientStateCondition == 1 && {!([_target] call FUNC(isInStableCondition))}) exitwith {false}; _locations = getArray (_config >> "treatmentLocations"); -if ("All" in _locations) exitwith {true}; +if ("All" in _locations) exitwith { true }; private [ "_medFacility", "_medVeh"]; _medFacility = {([_caller] call FUNC(isInMedicalFacility)) || ([_target] call FUNC(isInMedicalFacility))}; @@ -93,6 +92,6 @@ _medVeh = {([_caller] call FUNC(isInMedicalVehicle)) || ([_target] call FUNC(isI }; }; }; -}foreach _locations; +} foreach _locations; _return; diff --git a/addons/medical/functions/fnc_canTreatCached.sqf b/addons/medical/functions/fnc_canTreatCached.sqf index b1dfaf7d12..273da7dc4b 100644 --- a/addons/medical/functions/fnc_canTreatCached.sqf +++ b/addons/medical/functions/fnc_canTreatCached.sqf @@ -17,6 +17,7 @@ #include "script_component.hpp" #define MAX_DURATION_CACHE 2 +params ["", "_target", "_selection", "_classname"]; // parameters, function, namespace, uid -[_this, DFUNC(canTreat), _this select 1, format[QGVAR(canTreat_%1_%2), _this select 2, _this select 3], MAX_DURATION_CACHE, "clearConditionCaches"] call EFUNC(common,cachedCall); +[_this, DFUNC(canTreat), _target, format [QGVAR(canTreat_%1_%2), _selection, _classname], MAX_DURATION_CACHE, "clearConditionCaches"] call EFUNC(common,cachedCall); diff --git a/addons/medical/functions/fnc_copyDeadBody.sqf b/addons/medical/functions/fnc_copyDeadBody.sqf index 36bcd91487..9a3936f009 100644 --- a/addons/medical/functions/fnc_copyDeadBody.sqf +++ b/addons/medical/functions/fnc_copyDeadBody.sqf @@ -7,16 +7,15 @@ * 1: The caller * * Return Value: - * OBJECT Returns the copy of the unit. If no copy could be made, returns the oldBody + * Returns the copy of the unit. If no copy could be made, returns the oldBody * * Public: No */ #include "script_component.hpp" -private ["_oldBody","_newUnit","_class","_group","_position","_side", "_caller", "_name"]; -_oldBody = _this select 0; -_caller = _this select 1; +private ["_newUnit", "_class", "_group", "_position", "_side", "_name"]; +params ["_oldBody", "_caller"]; if (alive _oldBody) exitwith {_oldBody}; // we only want to do this for dead bodies diff --git a/addons/medical/functions/fnc_createLitter.sqf b/addons/medical/functions/fnc_createLitter.sqf index a3b71b7f9c..b25a3bbf94 100644 --- a/addons/medical/functions/fnc_createLitter.sqf +++ b/addons/medical/functions/fnc_createLitter.sqf @@ -3,11 +3,16 @@ * Spawns litter for the treatment action on the ground around the target * * Arguments: - * 0: The target - * 1: The treatment classname + * 0: The Caller + * 1: The target + * 2: The treatment Selection Name + * 3: The treatment classname + * 4: ? + * 5: Users of Items + * 6: Previous Damage * * Return Value: - * + * None * * Public: No */ @@ -16,13 +21,8 @@ #define MIN_ENTRIES_LITTER_CONFIG 3 -private ["_target", "_className", "_config", "_litter", "_createLitter", "_position", "_createdLitter", "_caller", "_selectionName", "_usersOfItems", "_previousDamage"]; -_caller = _this select 0; -_target = _this select 1; -_selectionName = _this select 2; -_className = _this select 3; -_usersOfItems = _this select 5; -_previousDamage = _this select 6; +private ["_config", "_litter", "_createLitter", "_position", "_createdLitter"]; +params ["_caller", "_target", "_selectionName", "_className", "", "_usersOfItems", "_previousDamage"]; if !(GVAR(allowLitterCreation)) exitwith {}; if (vehicle _caller != _caller || vehicle _target != _target) exitwith {}; @@ -38,19 +38,18 @@ if !(isArray (_config >> "litter")) exitwith {}; _litter = getArray (_config >> "litter"); _createLitter = { - private["_position", "_litterClass", "_direction"]; - + private["_position", "_direction"]; + params ["_unit", "_litter"]; // @TODO: handle carriers over water // For now, don't spawn litter if we are over water to avoid floating litter - if(surfaceIsWater (getPos (_this select 0))) exitWith { false }; - - _position = getPosATL (_this select 0); - _position = [_position select 0, _position select 1, 0]; - _litterClass = _this select 1; - if (random(1) >= 0.5) then { - _position = [(_position select 0) + random 1, (_position select 1) + random 1, _position select 2]; + if(surfaceIsWater (getPos _unit)) exitWith { false }; + + _position = getPosATL _unit; + _position params ["_posX", "_posY"]; + _position = if (random(1) >= 0.5) then { + [_posX + random 1, _posY + random 1, 0] } else { - _position = [(_position select 0) - random 1, (_position select 1) - random 1, _position select 2]; + [_posX - random 1, _posY - random 1, 0]; }; _direction = (random 360); @@ -65,11 +64,10 @@ _createdLitter = []; { if (typeName _x == "ARRAY") then { if (count _x < MIN_ENTRIES_LITTER_CONFIG) exitwith {}; - private ["_selection", "_litterCondition", "_litterOptions"]; - _selection = _x select 0; + + params ["_selection", "_litterCondition", "_litterOptions"]; + if (toLower _selection in [toLower _selectionName, "all"]) then { // in is case sensitve. We can be forgiving here, so lets use toLower. - _litterCondition = _x select 1; - _litterOptions = _x select 2; if (isnil _litterCondition) then { _litterCondition = if (_litterCondition != "") then {compile _litterCondition} else {{true}}; @@ -88,8 +86,8 @@ _createdLitter = []; if (typeName _x == "STRING") then { [_target, _x] call _createLitter; }; - }foreach _litterOptions; + } foreach _litterOptions; }; }; }; -}foreach _litter; \ No newline at end of file +} foreach _litter; diff --git a/addons/medical/functions/fnc_determineIfFatal.sqf b/addons/medical/functions/fnc_determineIfFatal.sqf index bad15dbcad..939bf8c9b7 100644 --- a/addons/medical/functions/fnc_determineIfFatal.sqf +++ b/addons/medical/functions/fnc_determineIfFatal.sqf @@ -1,19 +1,21 @@ -/** - * fn_determineIfFatal.sqf - * @Descr: N/A - * @Author: Glowbal +/* + * Author: Glowbal + * Determine If Fatal * - * @Arguments: [] - * @Return: - * @PublicAPI: false + * Arguments: + * 0: Unit + * 1: Part + * 2: with Damage (default: 0) + * + * Return Value: + * None + * + * Public: No */ - #include "script_component.hpp" -private ["_unit","_part","_damageThreshold", "_withDamage", "_damageBodyPart"]; -_unit = _this select 0; -_part = _this select 1; -_withDamage = if (count _this > 2) then { _this select 2} else {0}; +private ["_damageThreshold", "_damageBodyPart"]; +params ["_unit", "_part", ["_withDamage", 0]]; if (!alive _unit) exitwith {true}; if (_part < 0 || _part > 5) exitwith {false}; diff --git a/addons/medical/functions/fnc_displayPatientInformation.sqf b/addons/medical/functions/fnc_displayPatientInformation.sqf index e181328318..82622bdca6 100644 --- a/addons/medical/functions/fnc_displayPatientInformation.sqf +++ b/addons/medical/functions/fnc_displayPatientInformation.sqf @@ -4,10 +4,11 @@ * * Arguments: * 0: The Unit - * 1: Show + * 1: Show (default: true) + * 2: Selection (default: 0) * * ReturnValue: - * nil + * None * * Public: No */ @@ -18,9 +19,7 @@ // Exit for basic medical if (GVAR(level) < 2) exitWith {}; private ["_target", "_show", "_selectionN", "_amountOfGeneric", "_bandagedwounds", "_logCtrl", "_part", "_partText", "_pointDamage", "_severity", "_total", "_totalIvVolume", "_triageStatus", "_type"]; -_target = _this select 0; -_show = if (count _this > 1) then {_this select 1} else {true}; -_selectionN = if (count _this > 2) then {_this select 2} else {0}; +params ["_target", ["_target", true], ["_selectionN", 0]]; GVAR(currentSelectedSelectionN) = if (typeName _selectionN == "SCALAR") then {_selectionN} else {0}; GVAR(displayPatientInformationTarget) = if (_show) then {_target} else {ObjNull}; @@ -34,22 +33,22 @@ if (_show) then { [{ private ["_target", "_display", "_alphaLevel", "_damaged", "_availableSelections", "_openWounds", "_selectionBloodLoss", "_red", "_green", "_blue", "_alphaLevel", "_allInjuryTexts", "_lbCtrl", "_genericMessages"]; - _target = (_this select 0) select 0; - _selectionN = (_this select 0) select 1; + params ["_args", "_idPFH"]; + _args params ["_target", "_selectionN"]; if (GVAR(displayPatientInformationTarget) != _target || GVAR(currentSelectedSelectionN) != _selectionN) exitwith { - [_this select 1] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; }; if (ACE_player distance _target > MAX_DISTANCE) exitwith { ("ACE_MedicalRscDisplayInformation" call BIS_fnc_rscLayer) cutText ["","PLAIN"]; - [_this select 1] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; ["displayTextStructured", [ACE_player], [[LSTRING(DistanceToFar), [_target] call EFUNC(common,getName)], 1.75, ACE_player]] call EFUNC(common,targetEvent); }; disableSerialization; _display = uiNamespace getvariable QGVAR(DisplayInformation); if (isnil "_display") exitwith { - [_this select 1] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; }; _allInjuryTexts = []; @@ -81,7 +80,7 @@ if (_show) then { if !(isnil "_value") then { _totalIvVolume = _totalIvVolume + (_target getvariable [_x, 0]); }; - }foreach GVAR(IVBags); + } foreach GVAR(IVBags); if (_totalIvVolume >= 1) then { _genericMessages pushback [format[localize LSTRING(receivingIvVolume), floor _totalIvVolume], [1, 1, 1, 1]]; }; @@ -92,33 +91,33 @@ if (_show) then { _openWounds = _target getvariable [QGVAR(openWounds), []]; private "_amountOf"; { - _amountOf = _x select 3; + _x params ["", "_x1", "_selectionX", "_amountOf", "_x4"]; // Find how much this bodypart is bleeding 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))]; + _damaged set[_selectionX, true]; + _selectionBloodLoss set [_selectionX, (_selectionBloodLoss select _selectionX) + (20 * (_x4 * _amountOf))]; - if (_selectionN == (_x select 2)) then { + if (_selectionN == _selectionX) 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 >= 1) then { // TODO localization - _allInjuryTexts pushback [format["%2x %1", (GVAR(AllWoundInjuryTypes) select (_x select 1)) select 6, _amountOf], [1,1,1,1]]; + _allInjuryTexts pushback [format["%2x %1", (GVAR(AllWoundInjuryTypes) select _x1) select 6, _amountOf], [1,1,1,1]]; } else { // TODO localization - _allInjuryTexts pushback [format["Partial %1", (GVAR(AllWoundInjuryTypes) select (_x select 1)) select 6], [1,1,1,1]]; + _allInjuryTexts pushback [format["Partial %1", (GVAR(AllWoundInjuryTypes) select _x1) select 6], [1,1,1,1]]; }; }; }; - }foreach _openWounds; + } foreach _openWounds; _bandagedwounds = _target getvariable [QGVAR(bandagedWounds), []]; { - _amountOf = _x select 3; + _x params ["", "", "_selectionX", "_amountOf", "_x4"]; // Find how much this bodypart is bleeding - if !(_damaged select (_x select 2)) then { - _selectionBloodLoss set [(_x select 2), (_selectionBloodLoss select (_x select 2)) + (20 * ((_x select 4) * _amountOf))]; + if !(_damaged select _selectionX) then { + _selectionBloodLoss set [_selectionX, (_selectionBloodLoss select _selectionX) + (20 * (_x4 * _amountOf))]; }; - if (_selectionN == (_x select 2)) then { + if (_selectionN == _selectionX) 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 { @@ -130,7 +129,7 @@ if (_show) then { }; }; }; - }foreach _bandagedwounds; + } foreach _bandagedwounds; } else { _damaged = [true, true, true, true, true, true]; { @@ -160,7 +159,7 @@ if (_show) then { _availableSelections = [50,51,52,53,54,55]; { - private ["_red", "_green", "_blue"]; + private ["_red", "_green", "_blue", "_total"]; _total = _x; _red = 1; @@ -177,20 +176,22 @@ if (_show) then { }; }; (_display displayCtrl (_availableSelections select _foreachIndex)) ctrlSetTextColor [_red, _green, _blue, 1.0]; - }foreach _selectionBloodLoss; + } foreach _selectionBloodLoss; _lbCtrl = (_display displayCtrl 200); lbClear _lbCtrl; { - _lbCtrl lbAdd (_x select 0); - _lbCtrl lbSetColor [_foreachIndex, _x select 1]; - }foreach _genericMessages; + _x params ["_add", "_color"]; + _lbCtrl lbAdd _add; + _lbCtrl lbSetColor [_foreachIndex, _color]; + } foreach _genericMessages; _amountOfGeneric = count _genericMessages; { - _lbCtrl lbAdd (_x select 0); - _lbCtrl lbSetColor [_foreachIndex + _amountOfGeneric, _x select 1]; - }foreach _allInjuryTexts; + _x params ["_add", "_color"]; + _lbCtrl lbAdd _add; + _lbCtrl lbSetColor [_foreachIndex + _amountOfGeneric, _color]; + } foreach _allInjuryTexts; if (count _allInjuryTexts == 0) then { _lbCtrl lbAdd (localize LSTRING(NoInjuriesBodypart)); }; @@ -202,9 +203,7 @@ if (_show) then { _logs = _target getvariable [QGVAR(logFile_Activity), []]; { // [_message,_moment,_type, _arguments] - _message = _x select 0; - _moment = _x select 1; - _arguments = _x select 3; + _x params ["_message", "_moment", "_arguments"]; if (isLocalized _message) then { _message = localize _message; }; @@ -213,10 +212,10 @@ if (_show) then { if (typeName _x == "STRING" && {isLocalized _x}) then { _arguments set [_foreachIndex, localize _x]; }; - }foreach _arguments; + } foreach _arguments; _message = format([_message] + _arguments); _logCtrl lbAdd format["%1 %2", _moment, _message]; - }foreach _logs; + } foreach _logs; _triageStatus = [_target] call FUNC(getTriageStatus); (_display displayCtrl 303) ctrlSetText (_triageStatus select 0); diff --git a/addons/medical/functions/fnc_displayTriageCard.sqf b/addons/medical/functions/fnc_displayTriageCard.sqf index c4ed4ad829..051efbfc70 100644 --- a/addons/medical/functions/fnc_displayTriageCard.sqf +++ b/addons/medical/functions/fnc_displayTriageCard.sqf @@ -4,18 +4,18 @@ * * Arguments: * 0: The unit + * 1: Show (default: true) * * Return Value: - * nil + * None * * Public: Yes */ #include "script_component.hpp" -private ["_target", "_show", "_amount", "_item", "_log", "_message", "_triageCardTexts", "_triageStatus"]; -_target = _this select 0; -_show = if (count _this > 1) then {_this select 1} else {true}; +private ["_amount", "_item", "_log", "_message", "_triageCardTexts", "_triageStatus"]; +params ["_target", ["_show", true]]; GVAR(TriageCardTarget) = if (_show) then {_target} else {ObjNull}; @@ -25,15 +25,16 @@ if (_show) then { [{ private ["_target", "_display", "_alphaLevel", "_alphaLevel", "_lbCtrl"]; - _target = (_this select 0) select 0; + params ["_args", "_idPFH"]; + _args params ["_target"]; if (GVAR(TriageCardTarget) != _target) exitwith { - [_this select 1] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; }; disableSerialization; _display = uiNamespace getvariable QGVAR(triageCard); if (isnil "_display") exitwith { - [_this select 1] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; }; _triageCardTexts = []; @@ -44,8 +45,7 @@ if (_show) then { _log = _target getvariable [QGVAR(triageCard), []]; { - _item = _x select 0; - _amount = _x select 1; + _x params ["_item", "_amount"]; _message = _item; if (isClass(configFile >> "CfgWeapons" >> _item)) then { _message = getText(configFile >> "CfgWeapons" >> _item >> "DisplayName"); @@ -55,18 +55,21 @@ if (_show) then { }; }; _triageCardTexts pushback format["%1x - %2", _amount, _message]; - }foreach _log; + } foreach _log; if (count _triageCardTexts == 0) then { _lbCtrl lbAdd (localize LSTRING(TriageCard_NoEntry)); }; { _lbCtrl lbAdd _x; - }foreach _triageCardTexts; + } foreach _triageCardTexts; _triageStatus = [_target] call FUNC(getTriageStatus); - (_display displayCtrl 2000) ctrlSetText (_triageStatus select 0); - (_display displayCtrl 2000) ctrlSetBackgroundColor (_triageStatus select 2); + + _triageStatus params ["_text", "_color"]; + + (_display displayCtrl 2000) ctrlSetText _text; + (_display displayCtrl 2000) ctrlSetBackgroundColor _color; }, 0, [_target]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/medical/functions/fnc_dropDownTriageCard.sqf b/addons/medical/functions/fnc_dropDownTriageCard.sqf index 6f30152c5f..d207c7f9a4 100644 --- a/addons/medical/functions/fnc_dropDownTriageCard.sqf +++ b/addons/medical/functions/fnc_dropDownTriageCard.sqf @@ -3,18 +3,18 @@ * Display triage card for a unit * * Arguments: - * 0: The unit + * 0: Show * * Return Value: - * nil + * None * * Public: Yes */ #include "script_component.hpp" -private ["_show", "_ctrl", "_display", "_idc", "_pos"]; -_show = _this select 0; +private ["_ctrl", "_display", "_idc", "_pos"]; +params ["_show"]; disableSerialization; _display = uiNamespace getvariable QGVAR(triageCard); diff --git a/addons/medical/functions/fnc_getBloodLoss.sqf b/addons/medical/functions/fnc_getBloodLoss.sqf index 1881643d97..9ac1083f03 100644 --- a/addons/medical/functions/fnc_getBloodLoss.sqf +++ b/addons/medical/functions/fnc_getBloodLoss.sqf @@ -15,10 +15,9 @@ #define BLOODLOSSRATE_BASIC 0.2 -private ["_unit", "_totalBloodLoss","_tourniquets","_openWounds", "_cardiacOutput", "_internalWounds"]; +private ["_totalBloodLoss","_tourniquets","_openWounds", "_cardiacOutput", "_internalWounds"]; // TODO Only use this calculation if medium or higher, otherwise use vanilla calculations (for basic medical). - -_unit = _this select 0; +params ["_unit"]; _totalBloodLoss = 0; // Advanced medical bloodloss handling @@ -34,12 +33,12 @@ if (GVAR(level) >= 2) then { // (((BLOODLOSS_SMALL_WOUNDS * (_x select 0))) + ((BLOODLOSS_MEDIUM_WOUNDS * (_x select 1))) + ((BLOODLOSS_LARGE_WOUNDS * (_x select 2))) * (_cardiacOutput / DEFAULT_CARDIAC_OUTPUT)); }; - }foreach _openWounds; + } foreach _openWounds; _internalWounds = _unit getvariable [QGVAR(internalWounds), []]; { _totalBloodLoss = _totalBloodLoss + ((_x select 4) * (_x select 3)); - }foreach _internalWounds; + } foreach _internalWounds; // cap the blood loss to be no greater as the current cardiac output //(_totalBloodLoss min _cardiacOutput); diff --git a/addons/medical/functions/fnc_getBloodPressure.sqf b/addons/medical/functions/fnc_getBloodPressure.sqf index f5012c8735..2ba0b7366d 100644 --- a/addons/medical/functions/fnc_getBloodPressure.sqf +++ b/addons/medical/functions/fnc_getBloodPressure.sqf @@ -6,29 +6,28 @@ * 0: The Unit * * ReturnValue: - * Blood Pressuret ,> + * 0: BloodPressure Low + * 1: BloodPressure High * * Public: No */ #include "script_component.hpp" -/* - Value is taken because with cardic output and resistance at default values, it will put blood pressure High at 120. -*/ +// Value is taken because with cardic output and resistance at default values, it will put blood pressure High at 120. #define MODIFIER_BP_HIGH 0.229 -/* - Value is taken because with cardic output and resistance at default values, it will put blood pressure Low at 80. -*/ +// Value is taken because with cardic output and resistance at default values, it will put blood pressure Low at 80. #define MODIFIER_BP_LOW 0.1524 -private ["_unit", "_bloodPressureLow", "_bloodPressureHigh", "_cardiacOutput", "_resistance"]; -_unit = _this select 0; +private ["_bloodPressureLow", "_bloodPressureHigh", "_cardiacOutput", "_resistance"]; + +params ["_unit"]; + _cardiacOutput = [_unit] call FUNC(getCardiacOutput); _resistance = _unit getvariable [QGVAR(peripheralResistance), 100]; _bloodPressureHigh = (_cardiacOutput * MODIFIER_BP_HIGH) * _resistance; _bloodPressureLow = (_cardiacOutput * MODIFIER_BP_LOW) * _resistance; -[_bloodPressureLow, _bloodPressureHigh]; +[_bloodPressureLow, _bloodPressureHigh] diff --git a/addons/medical/functions/fnc_getBloodVolumeChange.sqf b/addons/medical/functions/fnc_getBloodVolumeChange.sqf index 23eba4a0c7..3524e15cb5 100644 --- a/addons/medical/functions/fnc_getBloodVolumeChange.sqf +++ b/addons/medical/functions/fnc_getBloodVolumeChange.sqf @@ -28,10 +28,8 @@ */ #define BLOOD_CHANGE_PER_SECOND 0.0595 - - -private ["_unit","_bloodVolume","_bloodVolumeChange", "_ivVolume"]; -_unit = _this select 0; +private ["_bloodVolume", "_bloodVolumeChange", "_ivVolume"]; +params ["_unit"]; _bloodVolume = _unit getvariable [QGVAR(bloodVolume), 100]; _bloodVolumeChange = -([_unit] call FUNC(getBloodLoss)); @@ -43,13 +41,13 @@ if (_bloodVolume < 100.0) then { _ivVolume = (_unit getvariable [_x, 0]) + IV_CHANGE_PER_SECOND; _unit setvariable [_x,_ivVolume]; }; - }foreach GVAR(IVBags); + } foreach GVAR(IVBags); } else { { if ((_unit getvariable [_x, 0]) > 0) then { _unit setvariable [_x, 0]; // lets get rid of exessive IV volume }; - }foreach GVAR(IVBags); + } foreach GVAR(IVBags); }; _bloodVolumeChange; diff --git a/addons/medical/functions/fnc_getCardiacOutput.sqf b/addons/medical/functions/fnc_getCardiacOutput.sqf index 34d7be33af..f24aa438ca 100644 --- a/addons/medical/functions/fnc_getCardiacOutput.sqf +++ b/addons/medical/functions/fnc_getCardiacOutput.sqf @@ -22,7 +22,6 @@ // to limit the amount of complex calculations necessary, we take a set modifier to calculate Stroke Volume. #define MODIFIER_CARDIAC_OUTPUT 19.04761 -private "_unit"; -_unit = _this select 0; +params ["_unit"]; ((_unit getvariable [QGVAR(bloodVolume), 100])/MODIFIER_CARDIAC_OUTPUT) + ((_unit getvariable [QGVAR(heartRate), 80])/80-1); diff --git a/addons/medical/functions/fnc_getHeartRateChange.sqf b/addons/medical/functions/fnc_getHeartRateChange.sqf index 92a2053737..d46733452a 100644 --- a/addons/medical/functions/fnc_getHeartRateChange.sqf +++ b/addons/medical/functions/fnc_getHeartRateChange.sqf @@ -15,8 +15,9 @@ #define HEART_RATE_MODIFIER 0.02 -private ["_unit", "_heartRate", "_hrIncrease", "_bloodLoss", "_time", "_values", "_adjustment", "_change", "_callBack", "_bloodVolume"]; -_unit = _this select 0; +private ["_heartRate", "_hrIncrease", "_bloodLoss", "_time", "_values", "_adjustment", "_change", "_callBack", "_bloodVolume"]; +params ["_unit"]; + _hrIncrease = 0; if (!(_unit getvariable [QGVAR(inCardiacArrest),false])) then { _heartRate = _unit getvariable [QGVAR(heartRate), 80]; @@ -24,10 +25,8 @@ if (!(_unit getvariable [QGVAR(inCardiacArrest),false])) then { _adjustment = _unit getvariable [QGVAR(heartRateAdjustments), []]; { - _values = (_x select 0); + _x params ["_values", "_time", "_callBack"]; if (abs _values > 0) then { - _time = (_x select 1); - _callBack = _x select 2; if (_time <= 0) then { _time = 1; }; @@ -47,7 +46,7 @@ if (!(_unit getvariable [QGVAR(inCardiacArrest),false])) then { [_unit] call _callBack; }; - }foreach _adjustment; + } foreach _adjustment; _adjustment = _adjustment - [ObjNull]; _unit setvariable [QGVAR(heartRateAdjustments), _adjustment]; diff --git a/addons/medical/functions/fnc_getTriageStatus.sqf b/addons/medical/functions/fnc_getTriageStatus.sqf index 812c20ed2a..4dcef530a3 100644 --- a/addons/medical/functions/fnc_getTriageStatus.sqf +++ b/addons/medical/functions/fnc_getTriageStatus.sqf @@ -6,7 +6,9 @@ * 0: The unit * * Return Value: - * Triage status from the unit. Name, statusID, color > + * 0: Name + * 1: Status ID + * 2: Color > * * Public: Yes */ @@ -14,7 +16,7 @@ #include "script_component.hpp" private ["_unit","_return","_status"]; -_unit = _this select 0; +params ["_unit"]; _status = _unit getvariable [QGVAR(triageLevel), -1]; _return = switch (_status) do { case 1: {[localize LSTRING(Triage_Status_Minor), 1, [0, 0.5, 0, 0.9]]}; @@ -23,4 +25,4 @@ _return = switch (_status) do { case 4: {[localize LSTRING(Triage_Status_Deceased), 4, [0, 0, 0, 0.9]]}; default {[localize LSTRING(Triage_Status_None), 0, [0, 0, 0, 0.9]]}; }; -_return; +_return diff --git a/addons/medical/functions/fnc_getTypeOfDamage.sqf b/addons/medical/functions/fnc_getTypeOfDamage.sqf index d51131ce0c..b8646e485f 100644 --- a/addons/medical/functions/fnc_getTypeOfDamage.sqf +++ b/addons/medical/functions/fnc_getTypeOfDamage.sqf @@ -13,23 +13,19 @@ #include "script_component.hpp" -PARAMS_1(_typeOfProjectile); +params ["_typeOfProjectile"]; -private ["_typeOfDamage"]; - -_typeOfDamage = switch (true) do { - case (_typeOfProjectile isKindOf "BulletBase"): {"bullet"}; - case (_typeOfProjectile isKindOf "GrenadeCore"): {"grenade"}; - case (_typeOfProjectile isKindOf "TimeBombCore"): {"explosive"}; - case (_typeOfProjectile isKindOf "MineCore"): {"explosive"}; - case (_typeOfProjectile isKindOf "FuelExplosion"): {"explosive"}; - case (_typeOfProjectile isKindOf "ShellBase"): {"shell"}; - case (_typeOfProjectile isKindOf "RocketBase"): {"explosive"}; - case (_typeOfProjectile isKindOf "MissileBase"): {"explosive"}; - case (_typeOfProjectile isKindOf "LaserBombCore"): {"explosive"}; - case (_typeOfProjectile isKindOf "BombCore"): {"explosive"}; - case (_typeOfProjectile isKindOf "Grenade"): {"grenade"}; - default {toLower _typeOfProjectile}; +call { + if (_typeOfProjectile isKindOf "BulletBase") exitWith {"bullet"}; + if (_typeOfProjectile isKindOf "GrenadeCore") exitWith {"grenade"}; + if (_typeOfProjectile isKindOf "TimeBombCore") exitWith {"explosive"}; + if (_typeOfProjectile isKindOf "MineCore") exitWith {"explosive"}; + if (_typeOfProjectile isKindOf "FuelExplosion") exitWith {"explosive"}; + if (_typeOfProjectile isKindOf "ShellBase") exitWith {"shell"}; + if (_typeOfProjectile isKindOf "RocketBase") exitWith {"explosive"}; + if (_typeOfProjectile isKindOf "MissileBase") exitWith {"explosive"}; + if (_typeOfProjectile isKindOf "LaserBombCore") exitWith {"explosive"}; + if (_typeOfProjectile isKindOf "BombCore") exitWith {"explosive"}; + if (_typeOfProjectile isKindOf "Grenade") exitWith {"grenade"}; + toLower _typeOfProjectile }; - -_typeOfDamage diff --git a/addons/medical/functions/fnc_getUnconsciousCondition.sqf b/addons/medical/functions/fnc_getUnconsciousCondition.sqf index 19d3bdec1d..c354dd6ebd 100644 --- a/addons/medical/functions/fnc_getUnconsciousCondition.sqf +++ b/addons/medical/functions/fnc_getUnconsciousCondition.sqf @@ -14,7 +14,7 @@ #include "script_component.hpp" private ["_unit","_return"]; -_unit = _this select 0; +params ["_unit"]; if (isnil QGVAR(unconsciousConditions)) then { GVAR(unconsciousConditions) = []; @@ -25,6 +25,6 @@ _return = false; if (typeName _x == typeName {} && {([_unit] call _x)}) exitwith { _return = true; }; -}foreach GVAR(unconsciousConditions); +} foreach GVAR(unconsciousConditions); -_return; +_return diff --git a/addons/medical/functions/fnc_handleBandageOpening.sqf b/addons/medical/functions/fnc_handleBandageOpening.sqf index a86077cb3b..b617d1e64a 100644 --- a/addons/medical/functions/fnc_handleBandageOpening.sqf +++ b/addons/medical/functions/fnc_handleBandageOpening.sqf @@ -18,15 +18,10 @@ #include "script_component.hpp" -private ["_target", "_impact", "_part", "_injuryIndex", "_injury", "_bandage", "_classID", "_className", "_reopeningChance", "_reopeningMinDelay", "_reopeningMaxDelay", "_config", "_woundTreatmentConfig", "_bandagedWounds", "_exist", "_injuryId", "_existingInjury", "_delay", "_openWounds", "_selectedInjury", "_bandagedInjury"]; -_target = _this select 0; -_impact = _this select 1; -_part = _this select 2; -_injuryIndex = _this select 3; -_injury = _this select 4; -_bandage = _this select 5; +private ["_className", "_reopeningChance", "_reopeningMinDelay", "_reopeningMaxDelay", "_config", "_woundTreatmentConfig", "_bandagedWounds", "_exist", "_injuryId", "_existingInjury", "_delay", "_openWounds", "_selectedInjury", "_bandagedInjury"]; +params ["_target", "_impact", "_part", "_injuryIndex", "_injury", "_bandage"]; -_classID = _injury select 1; +_injury parmas ["_classID", "_injuryType"]; _className = GVAR(woundClassNames) select _classID; // default, just in case.. @@ -58,10 +53,10 @@ if (isClass (_config >> _className)) then { _bandagedWounds = _target getvariable [QGVAR(bandagedWounds), []]; _exist = false; -_injuryType = _injury select 1; _bandagedInjury = []; { - if ((_x select 1) == _injuryType && (_x select 2) == (_injury select 2)) exitwith { + _x params ["", "_injuryTypeX", "_injuryX"]; + if (_injuryTypeX == _injuryType && _injuryTypeX == (_injury select 2)) exitwith { _exist = true; _existingInjury = _x; _existingInjury set [3, (_existingInjury select 3) + _impact]; @@ -69,7 +64,7 @@ _bandagedInjury = []; _bandagedInjury = _existingInjury; }; -}foreach _bandagedWounds; +} foreach _bandagedWounds; if !(_exist) then { // [ID, classID, bodypart, percentage treated, bloodloss rate] @@ -83,12 +78,8 @@ _target setvariable [QGVAR(bandagedWounds), _bandagedWounds, true]; 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; + private ["_bandage", "_openWounds", "_selectedInjury","_bandagedWounds","_exist"]; + params ["_target", "_impact", "_part", "_injuryIndex", "_injury"]; //if (alive _target) then { _openWounds = _target getvariable [QGVAR(openWounds), []]; @@ -102,13 +93,14 @@ if (random(1) <= _reopeningChance) then { _exist = false; _injuryId = _injury select 1; { - if ((_x select 1) == _injuryId && (_x select 2) == (_injury select 2)) exitwith { + _x params ["_injuryIdX", "_injuryX"]; + if (_injuryIdX == _injuryId && _injuryX == (_injury select 2)) exitwith { _exist = true; _existingInjury = _x; _existingInjury set [3, ((_existingInjury select 3) - _impact) max 0]; _bandagedWounds set [_foreachIndex, _existingInjury]; }; - }foreach _bandagedWounds; + } foreach _bandagedWounds; if (_exist) then { _target setvariable [QGVAR(bandagedWounds), _bandagedWounds, true]; diff --git a/addons/medical/functions/fnc_handleCreateLitter.sqf b/addons/medical/functions/fnc_handleCreateLitter.sqf index d7595ec439..31e65218c2 100644 --- a/addons/medical/functions/fnc_handleCreateLitter.sqf +++ b/addons/medical/functions/fnc_handleCreateLitter.sqf @@ -1,9 +1,22 @@ -//#define DEBUG_MODE_FULL +/* + * Author: Glowbal + * handle Litter Create + * + * Arguments: + * 0: Litter Class + * 1: Position + * 2: Unit + * + * Return Value: + * None + * + * Public: No + */ #include "script_component.hpp" if(!hasInterface) exitWith { false }; -PARAMS_3(_litterClass,_position,_direction); +params ["_litterClass", "_position", "_unit"]; private["_litterObject", "_maxLitterCount"]; //IGNORE_PRIVATE_WARNING(_values); @@ -16,9 +29,9 @@ _litterObject = _litterClass createVehicleLocal _position; _litterObject setDir _direction; _litterObject setPosATL _position; // Move the litter next frame to get rid of HORRIBLE spacing, fixes #1112 -[{ (_this select 0) setPosATL (_this select 1); }, [_litterObject, _position]] call EFUNC(common,execNextFrame); - -_maxLitterCount = getArray (configFile >> "ACE_Settings" >> QGVAR(litterSimulationDetail) >> "_values") select GVAR(litterSimulationDetail); +[{ params ["_object", "_pos"]; _object setPosATL _pos; }, [_litterObject, _position]] call EFUNC(common,execNextFrame); + +_maxLitterCount = getArray (configFile >> "ACE_Settings" >> QGVAR(litterSimulationDetail) >> "_values") select GVAR(litterSimulationDetail); if((count GVAR(allCreatedLitter)) > _maxLitterCount ) then { // gank the first litter object, and spawn ours. private["_oldLitter"]; @@ -34,10 +47,11 @@ if(!GVAR(litterPFHRunning) && {GVAR(litterCleanUpDelay) > 0}) then { GVAR(litterPFHRunning) = true; [{ { - if (ACE_time - (_x select 0) >= GVAR(litterCleanUpDelay)) then { + _x params ["_time", "_objects"]; + if (ACE_time - _time >= GVAR(litterCleanUpDelay)) then { { deleteVehicle _x; - } forEach (_x select 1); + } forEach _objects; GVAR(allCreatedLitter) set[_foreachIndex, objNull]; }; } forEach GVAR(allCreatedLitter); @@ -46,8 +60,6 @@ if(!GVAR(litterPFHRunning) && {GVAR(litterCleanUpDelay) > 0}) then { if ( (count GVAR(allCreatedLitter)) == 0) exitwith { [(_this select 1)] call CBA_fnc_removePerFrameHandler; GVAR(litterPFHRunning) = false; - }; + }; }, 30, []] call CBA_fnc_addPerFrameHandler; }; - -true \ No newline at end of file diff --git a/addons/medical/functions/fnc_handleDamage.sqf b/addons/medical/functions/fnc_handleDamage.sqf index a4e5525276..a3dea00235 100644 --- a/addons/medical/functions/fnc_handleDamage.sqf +++ b/addons/medical/functions/fnc_handleDamage.sqf @@ -17,12 +17,8 @@ #include "script_component.hpp" -private ["_unit", "_selection", "_damage", "_shooter", "_projectile", "_damageReturn", "_typeOfDamage", "_minLethalDamage", "_newDamage", "_typeIndex", "_preventDeath"]; -_unit = _this select 0; -_selection = _this select 1; -_damage = _this select 2; -_shooter = _this select 3; -_projectile = _this select 4; +private ["_damageReturn", "_typeOfDamage", "_minLethalDamage", "_newDamage", "_typeIndex", "_preventDeath"]; +params ["_unit", "_selection", "_damage", "_shooter", "_projectile"]; if !(local _unit) exitWith {nil}; @@ -53,7 +49,6 @@ if (GVAR(level) < 2) then { }; _newDamage = _this call FUNC(handleDamage_caching); // handleDamage_caching may have modified the projectile string - _projectile = _this select 4; _typeOfDamage = [_projectile] call FUNC(getTypeOfDamage); _typeIndex = (GVAR(allAvailableDamageTypes) find _typeOfDamage); @@ -123,4 +118,4 @@ if (((_unit getVariable [QGVAR(enableRevive), GVAR(enableRevive)]) > 0) && {_dam 0.89; }; -_damageReturn; +_damageReturn diff --git a/addons/medical/functions/fnc_handleDamage_advanced.sqf b/addons/medical/functions/fnc_handleDamage_advanced.sqf index e617738a90..f1ba5cc6f0 100644 --- a/addons/medical/functions/fnc_handleDamage_advanced.sqf +++ b/addons/medical/functions/fnc_handleDamage_advanced.sqf @@ -12,20 +12,15 @@ * 6: Type of Damage * * Return Value: - * Nothing + * None * * Public: No */ #include "script_component.hpp" -private ["_unit","_selectionName","_amountOfDamage","_sourceOfDamage","_typeOfProjectile","_typeOfDamage", "_part", "_damageBodyParts", "_newDamage", "_hitPoints"]; -_unit = _this select 0; -_selectionName = _this select 1; -_amountOfDamage = _this select 2; -_sourceOfDamage = _this select 3; -_typeOfProjectile = _this select 4; -_newDamage = _this select 5; +private ["_typeOfProjectile", "_part", "_damageBodyParts", "_hitPoints"]; +params ["_unit", "_selectionName", "_amountOfDamage", "_sourceOfDamage", "_typeOfDamage", "_newDamage"]; // Most likely taking exessive fire damage. Lets exit. if (isNull _sourceOfDamage && {_typeOfProjectile == ""} && {vehicle _unit == _unit} && {(_selectionName == "head" || isBurning _unit)}) exitwith {}; diff --git a/addons/medical/functions/fnc_handleDamage_advancedSetDamage.sqf b/addons/medical/functions/fnc_handleDamage_advancedSetDamage.sqf index 3df8a5ce0c..dc1e1a6fea 100644 --- a/addons/medical/functions/fnc_handleDamage_advancedSetDamage.sqf +++ b/addons/medical/functions/fnc_handleDamage_advancedSetDamage.sqf @@ -6,14 +6,14 @@ * 0: Unit for which the hitpoint damage will be sorted out * * Return Value: - * nil + * None * * Public: No */ #include "script_component.hpp" -PARAMS_1(_unit); +params ["_unit"]; if (!local _unit) exitwith {}; @@ -22,7 +22,7 @@ private ["_bodyStatus", "_headDamage", "_torsoDamage", "_handsDamage", "_legsDam // ["head", "body", "hand_l", "hand_r", "leg_l", "leg_r"] _bodyStatus = _unit getVariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]]; -EXPLODE_6_PVT(_bodyStatus,_headDamage,_torsoDamage,_handsDamageR,_handsDamageL,_legsDamageR,_legsDamageL); +_bodyStatus params ["_headDamage", "_torsoDamage", "_handsDamageR", "_handsDamageL", "_legsDamageR", "_legsDamageL"] _unit setHitPointDamage ["hitHead", _headDamage min 0.95]; _unit setHitPointDamage ["hitBody", _torsoDamage min 0.95]; diff --git a/addons/medical/functions/fnc_handleDamage_airway.sqf b/addons/medical/functions/fnc_handleDamage_airway.sqf index bc220eaad9..8b627faae1 100644 --- a/addons/medical/functions/fnc_handleDamage_airway.sqf +++ b/addons/medical/functions/fnc_handleDamage_airway.sqf @@ -10,19 +10,15 @@ * 4: Type of the damage done * * Return Value: - * None + * None * * Public: No */ #include "script_component.hpp" -private ["_unit", "_selectionName", "_amountOfDamage", "_sourceOfDamage", "_typeOfDamage", "_bodyPartn"]; -_unit = _this select 0; -_selectionName = _this select 1; -_amountOfDamage = _this select 2; -_sourceOfDamage = _this select 3; -_typeOfDamage = _this select 4; +private "_bodyPartn"; +params ["_unit", "_selectionName", "_amountOfDamage", "_sourceOfDamage", "_typeOfDamage"]; _bodyPartn = [_selectionName] call FUNC(selectionNameToNumber); if (_bodyPartn > 1) exitwith {}; diff --git a/addons/medical/functions/fnc_handleDamage_basic.sqf b/addons/medical/functions/fnc_handleDamage_basic.sqf index 04049cfa7c..83563ad92a 100644 --- a/addons/medical/functions/fnc_handleDamage_basic.sqf +++ b/addons/medical/functions/fnc_handleDamage_basic.sqf @@ -24,13 +24,8 @@ #define ARMDAMAGETRESHOLD2 1.7 #define UNCONSCIOUSNESSTRESHOLD 0.7 -private ["_unit", "_selectionName", "_damage", "_shooter", "_projectile", "_damage", "_armdamage", "_hitPoint", "_index", "_legdamage", "_newDamage", "_otherDamage", "_pain", "_restore"]; - -_unit = _this select 0; -_selectionName = _this select 1; -_damage = _this select 2; -_shooter = _this select 3; -_projectile = _this select 4; +private ["_damage", "_armdamage", "_hitPoint", "_index", "_legdamage", "_newDamage", "_otherDamage", "_pain", "_restore"]; +params ["_unit", "_selectionName", "_damage", "_shooter", "_projectile"]; // Apply damage treshold / coefficient _threshold = [ @@ -52,8 +47,10 @@ if (diag_frameno > (_unit getVariable [QGVAR(basic_frameNo), -3]) + 2) then { if (isnil {_unit getvariable QGVAR(structDamagePFH)}) then { // Assign orphan structural damage to torso [{ - private ["_unit", "_damagesum"]; - _unit = (_this select 0) select 0; + private "_damagesum"; + params ["_args", "_idPFH"]; + _args params ["_unit"]; + if (ACE_diagTime - (_unit getvariable [QGVAR(structDamagePFH),-2]) >= 2) then { _unit setVariable [QGVAR(structDamagePFH), nil]; _damagesum = (_unit getHitPointDamage "HitHead") + @@ -65,7 +62,7 @@ if (diag_frameno > (_unit getVariable [QGVAR(basic_frameNo), -3]) + 2) then { if (_damagesum < 0.06 and damage _unit > 0.06 and alive _unit) then { _unit setHitPointDamage ["HitBody", damage _unit]; }; - [(_this select 1)] call cba_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; }; }, 0, [_unit]] call CBA_fnc_addPerFrameHandler; }; diff --git a/addons/medical/functions/fnc_handleDamage_caching.sqf b/addons/medical/functions/fnc_handleDamage_caching.sqf index 99816ee274..9d31e53b1e 100644 --- a/addons/medical/functions/fnc_handleDamage_caching.sqf +++ b/addons/medical/functions/fnc_handleDamage_caching.sqf @@ -18,12 +18,8 @@ #include "script_component.hpp" -private ["_unit", "_selectionName", "_damage", "_source", "_projectile", "_hitSelections", "_hitPoints", "_impactVelocity", "_newDamage", "_cache_hitpoints", "_cache_projectiles", "_cache_params", "_cache_damages"]; -_unit = _this select 0; -_selectionName = _this select 1; -_damage = _this select 2; -_source = _this select 3; -_projectile = _this select 4; +private ["_hitSelections", "_hitPoints", "_impactVelocity", "_newDamage", "_cache_hitpoints", "_cache_projectiles", "_cache_params", "_cache_damages"]; +params ["_unit", "_selectionName", "_damage", "_source", "_projectile"]; _hitSelections = GVAR(SELECTIONS); _hitPoints = GVAR(HITPOINTS); @@ -78,21 +74,21 @@ if (diag_frameno > (_unit getVariable [QGVAR(frameNo_damageCaching), -3]) + 2) t // handle the cached damages 3 frames later [{ private ["_args", "_params"]; - _args = _this select 0; + params ["_args", "_idPFH"]; + params ["_unit", "_frameno"]; + if (diag_frameno > _frameno + 2) then { + _unit setDamage 0; - if (diag_frameno > (_args select 1) + 2) then { - (_args select 0) setDamage 0; - - _cache_params = (_args select 0) getVariable [QGVAR(cachedHandleDamageParams), []]; - _cache_damages = (_args select 0) getVariable QGVAR(cachedDamages); + _cache_params = _unit getVariable [QGVAR(cachedHandleDamageParams), []]; + _cache_damages = _unit getVariable QGVAR(cachedDamages); { _params = _x + [_cache_damages select _foreachIndex]; _params call FUNC(handleDamage_advanced); - }foreach _cache_params; + } foreach _cache_params; - [(_args select 0)] call FUNC(handleDamage_advancedSetDamage); + [_unit] call FUNC(handleDamage_advancedSetDamage); - [(_this select 1)] call cba_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; }; }, 0, [_unit, diag_frameno] ] call CBA_fnc_addPerFrameHandler; @@ -152,4 +148,4 @@ if (_selectionName != "") then { _unit setVariable [QGVAR(cachedHandleDamageParams), _cache_params]; }; -_newDamage; +_newDamage diff --git a/addons/medical/functions/fnc_handleDamage_fractures.sqf b/addons/medical/functions/fnc_handleDamage_fractures.sqf index 31fa1c8873..46000dbbdf 100644 --- a/addons/medical/functions/fnc_handleDamage_fractures.sqf +++ b/addons/medical/functions/fnc_handleDamage_fractures.sqf @@ -17,12 +17,8 @@ #include "script_component.hpp" -private ["_unit", "_selectionName", "_amountOfDamage", "_sourceOfDamage", "_typeOfDamage", "_bodyPartn", "_fractures", "_fractureType"]; -_unit = _this select 0; -_selectionName = _this select 1; -_amountOfDamage = _this select 2; -_sourceOfDamage = _this select 3; -_typeOfDamage = _this select 4; +private ["_bodyPartn", "_fractures", "_fractureType"]; +params ["_unit", "_selectionName", "_amountOfDamage", "_sourceOfDamage", "_typeOfDamage"]; _bodyPartn = [_selectionName] call FUNC(selectionNameToNumber); _fractureType = 1; diff --git a/addons/medical/functions/fnc_handleDamage_internalInjuries.sqf b/addons/medical/functions/fnc_handleDamage_internalInjuries.sqf index 6ee256a977..d8d9be1506 100644 --- a/addons/medical/functions/fnc_handleDamage_internalInjuries.sqf +++ b/addons/medical/functions/fnc_handleDamage_internalInjuries.sqf @@ -10,19 +10,15 @@ * 4: Type of the damage done * * Return Value: - * None + * None * * Public: No */ #include "script_component.hpp" -private ["_unit", "_selectionName", "_amountOfDamage", "_sourceOfDamage", "_typeOfDamage", "_bodyPartn"]; -_unit = _this select 0; -_selectionName = _this select 1; -_amountOfDamage = _this select 2; -_sourceOfDamage = _this select 3; -_typeOfDamage = _this select 4; +private "_bodyPartn"; +params ["_unit", "_selectionName", "_amountOfDamage", "_sourceOfDamage", "_typeOfDamage"]; _bodyPartn = [_selectionName] call FUNC(selectionNameToNumber); // TODO implement internal injuries diff --git a/addons/medical/functions/fnc_handleDamage_wounds.sqf b/addons/medical/functions/fnc_handleDamage_wounds.sqf index 70eeb74f9d..5711d903de 100644 --- a/addons/medical/functions/fnc_handleDamage_wounds.sqf +++ b/addons/medical/functions/fnc_handleDamage_wounds.sqf @@ -10,19 +10,15 @@ * 4: Type of the damage done * * Return Value: - * None + * None * * Public: No */ #include "script_component.hpp" -private ["_unit", "_selectionName", "_damage", "_typeOfProjectile", "_typeOfDamage", "_bodyPartn", "_injuryTypeInfo", "_allInjuriesForDamageType", "_allPossibleInjuries", "_highestPossibleDamage", "_highestPossibleSpot", "_minDamage", "_openWounds", "_woundID", "_toAddInjury", "_painToAdd", "_bloodLoss", "_bodyPartNToAdd", "_classType", "_damageLevels", "_foundIndex", "_i", "_injury", "_maxDamage", "_pain", "_painLevel", "_selections", "_toAddClassID", "_woundsCreated"]; -_unit = _this select 0; -_selectionName = _this select 1; -_damage = _this select 2; -_typeOfProjectile = _this select 3; -_typeOfDamage = _this select 4; +private ["_bodyPartn", "_injuryTypeInfo", "_allInjuriesForDamageType", "_allPossibleInjuries", "_highestPossibleDamage", "_highestPossibleSpot", "_minDamage", "_openWounds", "_woundID", "_toAddInjury", "_painToAdd", "_bloodLoss", "_bodyPartNToAdd", "_classType", "_damageLevels", "_foundIndex", "_i", "_injury", "_maxDamage", "_pain", "_painLevel", "_selections", "_toAddClassID", "_woundsCreated"]; +params ["_unit", "_selectionName", "_damage", "_typeOfProjectile", "_typeOfDamage"]; // Administration for open wounds and ids _openWounds = _unit getvariable[QGVAR(openWounds), []]; @@ -36,14 +32,13 @@ _woundsCreated = []; call compile _extensionOutput; _foundIndex = -1; { - _toAddClassID = _x select 1; - _bodyPartNToAdd = _x select 2; + _x params ["_toAddClassID", "_bodyPartNToAdd"]; { // Check if we have an id of the given class on the given bodypart already if (_x select 1 == _toAddClassID && {_x select 2 == _bodyPartNToAdd}) exitwith { _foundIndex = _foreachIndex; }; - }foreach _openWounds; + } foreach _openWounds; if (_foundIndex < 0) then { // Since it is a new injury, we will have to add it to the open wounds array to store it @@ -53,7 +48,7 @@ _foundIndex = -1; _injury = _openWounds select _foundIndex; _injury set [3, (_injury select 3) + 1]; }; -}foreach _woundsCreated; +} foreach _woundsCreated; _unit setvariable [QGVAR(openWounds), _openWounds, true]; diff --git a/addons/medical/functions/fnc_handleDamage_woundsOld.sqf b/addons/medical/functions/fnc_handleDamage_woundsOld.sqf index 1034ba9cae..0c08d1e884 100644 --- a/addons/medical/functions/fnc_handleDamage_woundsOld.sqf +++ b/addons/medical/functions/fnc_handleDamage_woundsOld.sqf @@ -17,12 +17,8 @@ #include "script_component.hpp" -private ["_unit", "_selectionName", "_damage", "_typeOfProjectile", "_typeOfDamage", "_bodyPartn", "_injuryTypeInfo", "_allInjuriesForDamageType", "_allPossibleInjuries", "_highestPossibleDamage", "_highestPossibleSpot", "_minDamage", "_openWounds", "_woundID", "_toAddInjury", "_painToAdd", "_bloodLoss", "_bodyPartNToAdd", "_classType", "_damageLevels", "_foundIndex", "_i", "_injury", "_maxDamage", "_pain", "_painLevel", "_selections", "_toAddClassID", "_woundsCreated"]; -_unit = _this select 0; -_selectionName = _this select 1; -_damage = _this select 2; -_typeOfProjectile = _this select 3; -_typeOfDamage = _this select 4; +private ["_bodyPartn", "_injuryTypeInfo", "_allInjuriesForDamageType", "_allPossibleInjuries", "_highestPossibleDamage", "_highestPossibleSpot", "_minDamage", "_openWounds", "_woundID", "_toAddInjury", "_painToAdd", "_bloodLoss", "_bodyPartNToAdd", "_classType", "_damageLevels", "_foundIndex", "_i", "_injury", "_maxDamage", "_pain", "_painLevel", "_selections", "_toAddClassID", "_woundsCreated"]; +params ["_unit", "_selectionName", "_damage", "_typeOfProjectile", "_typeOfDamage"]; // Convert the selectionName to a number and ensure it is a valid selection. _bodyPartn = [_selectionName] call FUNC(selectionNameToNumber); @@ -70,7 +66,7 @@ _allPossibleInjuries = []; _allPossibleInjuries pushback _x; }; }; -}foreach _allInjuriesForDamageType; +} foreach _allInjuriesForDamageType; // No possible wounds available for this damage type or damage amount. if (_highestPossibleSpot < 0) exitwith {}; @@ -98,7 +94,7 @@ _woundsCreated = []; if (_x select 1 == _toAddClassID && {_x select 2 == _bodyPartNToAdd}) exitwith { _foundIndex = _foreachIndex; }; - }foreach _openWounds; + } foreach _openWounds; }; _injury = []; @@ -123,7 +119,7 @@ _woundsCreated = []; _painToAdd = _painToAdd + (_toAddInjury select 3); }; }; -}foreach (_injuryTypeInfo select 0); // foreach damage thresholds +} foreach (_injuryTypeInfo select 0); // foreach damage thresholds _unit setvariable [QGVAR(openWounds), _openWounds, !USE_WOUND_EVENT_SYNC]; diff --git a/addons/medical/functions/fnc_handleKilled.sqf b/addons/medical/functions/fnc_handleKilled.sqf index 5003ec189c..d4fbfee30a 100644 --- a/addons/medical/functions/fnc_handleKilled.sqf +++ b/addons/medical/functions/fnc_handleKilled.sqf @@ -13,8 +13,8 @@ #include "script_component.hpp" -private["_unit", "_openWounds"]; -_unit = _this select 0; +private "_openWounds"; +params ["_unit"]; if (!local _unit) exitwith {}; _unit setvariable [QGVAR(pain), 0]; diff --git a/addons/medical/functions/fnc_handleLocal.sqf b/addons/medical/functions/fnc_handleLocal.sqf index c0f9c15292..50a30e90e8 100644 --- a/addons/medical/functions/fnc_handleLocal.sqf +++ b/addons/medical/functions/fnc_handleLocal.sqf @@ -15,9 +15,7 @@ #include "script_component.hpp" -private["_unit", "_local"]; -_unit = _this select 0; -_local = _this select 1; +params ["_unit", "_local"]; if (_local) then { if (_unit getvariable[QGVAR(addedToUnitLoop),false]) then { [_unit, true] call FUNC(addToInjuredCollection); diff --git a/addons/medical/functions/fnc_handleUnitVitals.sqf b/addons/medical/functions/fnc_handleUnitVitals.sqf index 0c7113f69a..cbb8f6fdcc 100644 --- a/addons/medical/functions/fnc_handleUnitVitals.sqf +++ b/addons/medical/functions/fnc_handleUnitVitals.sqf @@ -13,9 +13,8 @@ #include "script_component.hpp" -private ["_unit", "_heartRate","_bloodPressure","_bloodVolume","_painStatus", "_lastTimeValuesSynced", "_syncValues", "_airwayStatus", "_blood", "_bloodPressureH", "_bloodPressureL", "_interval"]; -_unit = _this select 0; -_interval = _this select 1; +private ["_heartRate","_bloodPressure","_bloodVolume","_painStatus", "_lastTimeValuesSynced", "_syncValues", "_airwayStatus", "_blood"]; +params ["_unit", "_interval"]; if (_interval == 0) exitWith {}; @@ -140,8 +139,7 @@ if (GVAR(level) >= 2) then { // Check vitals for medical status // TODO check for in revive state instead of variable - _bloodPressureL = _bloodPressure select 0; - _bloodPressureH = _bloodPressure select 1; + _bloodPressure params ["_bloodPressureL", "_bloodPressureH"]; if (!(_unit getvariable [QGVAR(inCardiacArrest),false])) then { if (_heartRate < 10 || _bloodPressureH < 30 || _bloodVolume < 20) then { @@ -180,6 +178,6 @@ if (GVAR(level) >= 2) then { if !(isnil "_value") then { _unit setvariable [_x,(_unit getvariable [_x, 0]), true]; }; - }foreach GVAR(IVBags); + } foreach GVAR(IVBags); }; }; diff --git a/addons/medical/functions/fnc_hasItem.sqf b/addons/medical/functions/fnc_hasItem.sqf index cfec633b55..df1a3828f5 100644 --- a/addons/medical/functions/fnc_hasItem.sqf +++ b/addons/medical/functions/fnc_hasItem.sqf @@ -16,19 +16,17 @@ #include "script_component.hpp" private ["_medic", "_patient", "_item", "_return", "_crew"]; -_medic = _this select 0; -_patient = _this select 1; -_item = _this select 2; +params ["_medic", "_patient", "_item"]; if (isnil QGVAR(setting_allowSharedEquipment)) then { GVAR(setting_allowSharedEquipment) = true; }; if (GVAR(setting_allowSharedEquipment) && {[_patient, _item] call EFUNC(common,hasItem)}) exitwith { - true; + true }; if ([_medic, _item] call EFUNC(common,hasItem)) exitwith { - true; + true }; _return = false; @@ -38,7 +36,7 @@ if ((vehicle _medic != _medic) && {[vehicle _medic] call FUNC(isMedicalVehicle)} if ([_medic, _x] call FUNC(canAccessMedicalEquipment) && {([_x, _item] call EFUNC(common,hasItem))}) exitwith { _return = true; }; - }foreach _crew; + } foreach _crew; }; -_return; +_return diff --git a/addons/medical/functions/fnc_hasItems.sqf b/addons/medical/functions/fnc_hasItems.sqf index ea16edebc4..dd53cb3337 100644 --- a/addons/medical/functions/fnc_hasItems.sqf +++ b/addons/medical/functions/fnc_hasItems.sqf @@ -16,9 +16,7 @@ #include "script_component.hpp" private ["_medic", "_patient", "_items", "_return"]; -_medic = _this select 0; -_patient = _this select 1; -_items = _this select 2; +params ["_medic", "_patient", "_items"]; _return = true; { @@ -31,4 +29,4 @@ _return = true; }; }foreach _items; -_return; +_return diff --git a/addons/medical/functions/fnc_hasMedicalEnabled.sqf b/addons/medical/functions/fnc_hasMedicalEnabled.sqf index 63fddd16b4..cbf40078fd 100644 --- a/addons/medical/functions/fnc_hasMedicalEnabled.sqf +++ b/addons/medical/functions/fnc_hasMedicalEnabled.sqf @@ -1,21 +1,27 @@ -/** - * fn_hasMedicalEnabled.sqf - * @Descr: Check if unit has CMS enabled. - * @Author: Glowbal - * - * @Arguments: [unit OBJECT] - * @Return: BOOL - * @PublicAPI: true - */ +/* + * Author: Glowbal + * Check if unit has CMS enabled + * + * Arguments: + * 0: unit + * + * Return Value: + * enabled + * + * Example: + * [Unit] call ace_medical_fnc_hasMedicalEnabled + * + * Public: No + */ #include "script_component.hpp" -private ["_unit", "_medicalEnabled"]; -_unit = _this select 0; +private "_medicalEnabled"; +params ["_unit"]; _medicalEnabled = _unit getvariable QGVAR(enableMedical); if (isnil "_medicalEnabled") exitwith { - (((GVAR(enableFor) == 0 && (isPlayer _unit || (_unit getvariable [QEGVAR(common,isDeadPlayer), false])))) || (GVAR(enableFor) == 1) || GVAR(level) == 1); + (((GVAR(enableFor) == 0 && (isPlayer _unit || (_unit getvariable [QEGVAR(common,isDeadPlayer), false])))) || (GVAR(enableFor) == 1) || GVAR(level) == 1) }; -_medicalEnabled; +_medicalEnabled diff --git a/addons/medical/functions/fnc_hasTourniquetAppliedTo.sqf b/addons/medical/functions/fnc_hasTourniquetAppliedTo.sqf index 6183854e45..955665233a 100644 --- a/addons/medical/functions/fnc_hasTourniquetAppliedTo.sqf +++ b/addons/medical/functions/fnc_hasTourniquetAppliedTo.sqf @@ -14,8 +14,6 @@ #include "script_component.hpp" -private ["_target", "_selectionName"]; -_target = _this select 0; -_selectionName = _this select 1; +params ["_target", "_selectionName"]; (((_target getvariable [QGVAR(tourniquets), [0,0,0,0,0,0]]) select ([_selectionName] call FUNC(selectionNameToNumber))) > 0); diff --git a/addons/medical/functions/fnc_init.sqf b/addons/medical/functions/fnc_init.sqf index 27d80163a5..fe8715c352 100644 --- a/addons/medical/functions/fnc_init.sqf +++ b/addons/medical/functions/fnc_init.sqf @@ -13,9 +13,8 @@ #include "script_component.hpp" -private ["_unit", "_allUsedMedication", "_logs"]; - -_unit = _this select 0; +private ["_allUsedMedication", "_logs"]; +params ["_unit"]; _unit setVariable [QGVAR(pain), 0, true]; _unit setVariable [QGVAR(morphine), 0, true]; diff --git a/addons/medical/functions/fnc_isBeingCarried.sqf b/addons/medical/functions/fnc_isBeingCarried.sqf index 6505f8b51a..b47c5e475f 100644 --- a/addons/medical/functions/fnc_isBeingCarried.sqf +++ b/addons/medical/functions/fnc_isBeingCarried.sqf @@ -15,7 +15,7 @@ */ #include "script_component.hpp" -PARAMS_1(_target); +params ["_target"]; private "_owner"; diff --git a/addons/medical/functions/fnc_isBeingDragged.sqf b/addons/medical/functions/fnc_isBeingDragged.sqf index 4d09ed9e29..929b48ccb7 100644 --- a/addons/medical/functions/fnc_isBeingDragged.sqf +++ b/addons/medical/functions/fnc_isBeingDragged.sqf @@ -15,7 +15,7 @@ */ #include "script_component.hpp" -PARAMS_1(_target); +params ["_target"]; private "_owner"; diff --git a/addons/medical/functions/fnc_isInMedicalFacility.sqf b/addons/medical/functions/fnc_isInMedicalFacility.sqf index bed660a46a..34f1cf4244 100644 --- a/addons/medical/functions/fnc_isInMedicalFacility.sqf +++ b/addons/medical/functions/fnc_isInMedicalFacility.sqf @@ -13,8 +13,8 @@ #include "script_component.hpp" -private ["_unit","_eyePos","_objects","_isInBuilding","_medicalFacility"]; -_unit = _this select 0; +private ["_eyePos", "_objects", "_isInBuilding", "_medicalFacility"]; +params ["_unit"]; _eyePos = eyePos _unit; _isInBuilding = false; @@ -42,13 +42,13 @@ _objects = (lineIntersectsWith [_unit modelToWorldVisual [0, 0, (_eyePos select if (((typeOf _x) in _medicalFacility) || (_x getVariable [QGVAR(isMedicalFacility),false])) exitwith { _isInBuilding = true; }; -}foreach _objects; +} foreach _objects; if (!_isInBuilding) then { _objects = position _unit nearObjects 7.5; { if (((typeOf _x) in _medicalFacility) || (_x getVariable [QGVAR(isMedicalFacility),false])) exitwith { _isInBuilding = true; }; - }foreach _objects; + } foreach _objects; }; _isInBuilding; diff --git a/addons/medical/functions/fnc_isInMedicalVehicle.sqf b/addons/medical/functions/fnc_isInMedicalVehicle.sqf index d376ce3824..1f1ff193fd 100644 --- a/addons/medical/functions/fnc_isInMedicalVehicle.sqf +++ b/addons/medical/functions/fnc_isInMedicalVehicle.sqf @@ -13,9 +13,8 @@ #include "script_component.hpp" -private ["_unit", "_vehicle"]; - -_unit = _this select 0; +private ["_vehicle"]; +params ["_unit"]; _vehicle = vehicle _unit; if (_unit == _vehicle) exitWith {false}; diff --git a/addons/medical/functions/fnc_isInStableCondition.sqf b/addons/medical/functions/fnc_isInStableCondition.sqf index f7c22ed085..763185640c 100644 --- a/addons/medical/functions/fnc_isInStableCondition.sqf +++ b/addons/medical/functions/fnc_isInStableCondition.sqf @@ -13,8 +13,8 @@ #include "script_component.hpp" -private ["_unit"]; -_unit = _this select 0; +private ["_openWounds", "_openWounds"]; +params ["_unit"]; if (GVAR(level) <= 1) exitwith { ([_unit] call FUNC(getBloodloss)) == 0; @@ -25,6 +25,6 @@ _openWounds = _unit getvariable [QGVAR(openWounds), []]; { // total bleeding ratio * percentage of injury left _totalBloodLoss = _totalBloodLoss + ((_x select 4) * (_x select 3)); -}foreach _openWounds; +} foreach _openWounds; (_totalBloodLoss == 0); diff --git a/addons/medical/functions/fnc_isMedic.sqf b/addons/medical/functions/fnc_isMedic.sqf index 122d261238..ca974fb751 100644 --- a/addons/medical/functions/fnc_isMedic.sqf +++ b/addons/medical/functions/fnc_isMedic.sqf @@ -4,7 +4,7 @@ * * Arguments: * 0: The Unit - * 1: Class + * 1: Class (default: 1) * * ReturnValue: * Is in of medic class @@ -15,8 +15,7 @@ #include "script_component.hpp" private ["_unit", "_class", "_medicN"]; -_unit = _this select 0; -_medicN = if (count _this > 1) then {_this select 1} else {1}; +params ["_unit", ["_medicN", 1]]; _class = _unit getVariable [QGVAR(medicClass), getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "attendant")]; diff --git a/addons/medical/functions/fnc_isMedicalVehicle.sqf b/addons/medical/functions/fnc_isMedicalVehicle.sqf index 5e9283852f..14499cb241 100644 --- a/addons/medical/functions/fnc_isMedicalVehicle.sqf +++ b/addons/medical/functions/fnc_isMedicalVehicle.sqf @@ -12,7 +12,6 @@ */ #include "script_component.hpp" -private ["_vehicle"]; -_vehicle = _this select 0; +params ["_vehicle"]; (_vehicle getVariable [QGVAR(medicClass), getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "attendant")]) > 0 diff --git a/addons/medical/functions/fnc_itemCheck.sqf b/addons/medical/functions/fnc_itemCheck.sqf index c903417dfc..d49e04e774 100644 --- a/addons/medical/functions/fnc_itemCheck.sqf +++ b/addons/medical/functions/fnc_itemCheck.sqf @@ -6,15 +6,14 @@ * 0: The unit * * ReturnValue: - * nil + * None * * Public: Yes */ #include "script_component.hpp" -private ["_unit"]; -_unit = _this select 0; +params ["_unit"]; while {({_x == "FirstAidKit"} count items _unit) > 0} do { _unit removeItem "FirstAidKit"; diff --git a/addons/medical/functions/fnc_modifyMedicalAction.sqf b/addons/medical/functions/fnc_modifyMedicalAction.sqf index 268ba8e253..1ac709059f 100644 --- a/addons/medical/functions/fnc_modifyMedicalAction.sqf +++ b/addons/medical/functions/fnc_modifyMedicalAction.sqf @@ -10,14 +10,15 @@ * 3: The action to modify * * ReturnValue: - * nil + * None * * Public: No */ #include "script_component.hpp" -EXPLODE_4_PVT(_this,_target,_player,_selectionN,_actionData); +params ["_target", "_player", "_selectionN", "_actionData"]; + if (GVAR(level) < 2) exitwith { private ["_pointDamage"]; _pointDamage = _target getHitPointDamage (["HitHead", "HitBody", "HitLeftArm", "HitRightArm", "HitLeftLeg", "HitRightLeg"] select _selectionN); @@ -33,8 +34,8 @@ if (GVAR(level) < 2) exitwith { private ["_openWounds", "_amountOf"]; _openWounds = _target getvariable [QGVAR(openWounds), []]; { - _amountOf = _x select 3; - if (_amountOf > 0 && {(_selectionN == (_x select 2))} && {(_x select 4) > 0}) exitwith { + _x params ["", "", "_selectionX", "_amountOf", "_x4"]; + if (_amountOf > 0 && {(_selectionN == _selectionX)} && {_x4 > 0}) exitwith { _actionData set [2, QUOTE(PATHTOF(UI\icons\medical_crossRed.paa))]; }; } foreach _openWounds; diff --git a/addons/medical/functions/fnc_moduleAdvancedMedicalSettings.sqf b/addons/medical/functions/fnc_moduleAdvancedMedicalSettings.sqf index 2960c65b9d..b54196d75f 100644 --- a/addons/medical/functions/fnc_moduleAdvancedMedicalSettings.sqf +++ b/addons/medical/functions/fnc_moduleAdvancedMedicalSettings.sqf @@ -8,17 +8,14 @@ * 2: activated * * Return Value: - * None + * None * * Public: No */ #include "script_component.hpp" -private ["_logic", "_units", "_activated"]; -_logic = _this select 0; -_units = _this select 1; -_activated = _this select 2; +params ["_logic", "_units", "_activated"]; if !(_activated) exitWith {}; diff --git a/addons/medical/functions/fnc_moduleAssignMedicRoles.sqf b/addons/medical/functions/fnc_moduleAssignMedicRoles.sqf index 1c26eb53d4..e295c55a2e 100644 --- a/addons/medical/functions/fnc_moduleAssignMedicRoles.sqf +++ b/addons/medical/functions/fnc_moduleAssignMedicRoles.sqf @@ -8,15 +8,15 @@ * 2: activated * * Return Value: - * None + * None * * Public: No */ #include "script_component.hpp" -private ["_logic","_setting","_objects", "_list", "_splittedList", "_nilCheckPassedList", "_parsedList"]; -_logic = [_this,0,objNull,[objNull]] call BIS_fnc_param; +private ["_setting", "_objects", "_list", "_splittedList", "_nilCheckPassedList", "_parsedList"]; +params [["_logic", objNull, [objNull]]]; if (!isNull _logic) then { _list = _logic getvariable ["EnableList",""]; @@ -32,7 +32,7 @@ if (!isNull _logic) then { _nilCheckPassedList = _nilCheckPassedList + ","+ _x; }; }; - }foreach _splittedList; + } foreach _splittedList; _list = "[" + _nilCheckPassedList + "]"; _parsedList = [] call compile _list; @@ -47,7 +47,7 @@ if (!isNull _logic) then { }; }; }; - }foreach _objects; + } foreach _objects; }; { if (!isnil "_x") then { @@ -57,7 +57,5 @@ if (!isNull _logic) then { }; }; }; - }foreach _parsedList; + } foreach _parsedList; }; - -true \ No newline at end of file diff --git a/addons/medical/functions/fnc_moduleAssignMedicalFacility.sqf b/addons/medical/functions/fnc_moduleAssignMedicalFacility.sqf index c08d737f4b..7a219f2559 100644 --- a/addons/medical/functions/fnc_moduleAssignMedicalFacility.sqf +++ b/addons/medical/functions/fnc_moduleAssignMedicalFacility.sqf @@ -8,15 +8,15 @@ * 2: activated * * Return Value: - * None + * None * * Public: No */ #include "script_component.hpp" -private ["_logic","_setting","_objects"]; -_logic = [_this,0,objNull,[objNull]] call BIS_fnc_param; +private ["_setting", "_objects"]; +params [["_logic", objNull, [objNull]]]; if (!isNull _logic) then { _setting = _logic getvariable ["class",0]; _objects = synchronizedObjects _logic; @@ -24,7 +24,7 @@ if (!isNull _logic) then { if (local _x) then { _x setvariable[QGVAR(isMedicalFacility), true, true]; }; - }foreach _objects; + } foreach _objects; }; true; diff --git a/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf b/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf index af6de73ce1..9744ce5f7b 100644 --- a/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf +++ b/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf @@ -8,7 +8,7 @@ * 2: activated * * Return Value: - * None + * None * * Public: No */ @@ -16,8 +16,8 @@ #include "script_component.hpp" -private ["_logic","_setting","_objects", "_list", "_splittedList", "_nilCheckPassedList", "_parsedList"]; -_logic = [_this,0,objNull,[objNull]] call BIS_fnc_param; +private ["_setting", "_objects", "_list", "_splittedList", "_nilCheckPassedList", "_parsedList"]; +params [["_logic", objNull, [objNull]]]; if (!isNull _logic) then { _list = _logic getvariable ["EnableList",""]; @@ -33,7 +33,7 @@ if (!isNull _logic) then { _nilCheckPassedList = _nilCheckPassedList + ","+ _x; }; }; - }foreach _splittedList; + } foreach _splittedList; _list = "[" + _nilCheckPassedList + "]"; _parsedList = [] call compile _list; @@ -48,7 +48,7 @@ if (!isNull _logic) then { }; }; }; - }foreach _objects; + } foreach _objects; }; { if (!isnil "_x") then { @@ -58,7 +58,5 @@ if (!isNull _logic) then { }; }; }; - }foreach _parsedList; + } foreach _parsedList; }; - -true; diff --git a/addons/medical/functions/fnc_moduleMedicalSettings.sqf b/addons/medical/functions/fnc_moduleMedicalSettings.sqf index 00b7a15fcf..4e1af0e86c 100644 --- a/addons/medical/functions/fnc_moduleMedicalSettings.sqf +++ b/addons/medical/functions/fnc_moduleMedicalSettings.sqf @@ -8,17 +8,14 @@ * 2: activated * * Return Value: - * None + * None * * Public: No */ #include "script_component.hpp" -private ["_logic", "_units", "_activated"]; -_logic = _this select 0; -_units = _this select 1; -_activated = _this select 2; +params ["_logic", "_units", "_activated"]; if !(_activated) exitWith {}; diff --git a/addons/medical/functions/fnc_moduleReviveSettings.sqf b/addons/medical/functions/fnc_moduleReviveSettings.sqf index c96b1eb67c..19aa9579dd 100644 --- a/addons/medical/functions/fnc_moduleReviveSettings.sqf +++ b/addons/medical/functions/fnc_moduleReviveSettings.sqf @@ -8,17 +8,14 @@ * 2: activated * * Return Value: - * None + * None * * Public: No */ #include "script_component.hpp" -private ["_logic", "_units", "_activated"]; -_logic = _this select 0; -_units = _this select 1; -_activated = _this select 2; +params ["_logic", "_units", "_activated"]; if !(_activated) exitWith {}; diff --git a/addons/medical/functions/fnc_onMedicationUsage.sqf b/addons/medical/functions/fnc_onMedicationUsage.sqf index 904ad3ef88..d71896b6f0 100644 --- a/addons/medical/functions/fnc_onMedicationUsage.sqf +++ b/addons/medical/functions/fnc_onMedicationUsage.sqf @@ -11,28 +11,21 @@ * 5: Incompatable medication > * * Return Value: - * NONE + * None * * Public: No */ #include "script_component.hpp" -private ["_target", "_className", "_variable", "_maxDosage", "_timeInSystem", "_incompatabileMeds", "_foundEntry", "_allUsedMedication","_allMedsFromClassname", "_usedMeds", "_hasOverDosed", "_med", "_limit", "_classNamesUsed", "_decreaseAmount", "_viscosityChange", "_viscosityAdjustment", "_medicationConfig", "_onOverDose", "_painReduce"]; -_target = _this select 0; -_className = _this select 1; -_variable = _this select 2; -_maxDosage = _this select 3; -_timeInSystem = _this select 4; -_incompatabileMeds = _this select 5; -_viscosityChange = _this select 6; -_painReduce = _this select 7; +private ["_foundEntry", "_allUsedMedication","_allMedsFromClassname", "_usedMeds", "_hasOverDosed", "_med", "_limit", "_decreaseAmount", "_viscosityAdjustment", "_medicationConfig", "_onOverDose"]; +params ["_target", "_className", "_variable", "_maxDosage", "_timeInSystem", "_incompatabileMeds", "_viscosityChange", "_painReduce"]; _foundEntry = false; _allUsedMedication = _target getvariable [QGVAR(allUsedMedication), []]; { - if (_x select 0 == _variable) exitwith { - _allMedsFromClassname = _x select 1; + _x params ["_variableX", "_allMedsFromClassname"]; + if (_variableX== _variable) exitwith { if !(_className in _allMedsFromClassname) then { _allMedsFromClassname pushback _className; _x set [1, _allMedsFromClassname]; @@ -56,15 +49,14 @@ if (_usedMeds >= floor (_maxDosage + round(random(2))) && _maxDosage >= 1 && GVA _hasOverDosed = 0; { - _med = _x select 0; - _limit = _x select 1; + _x params ["_med", "_limit"]; { - _classNamesUsed = _x select 1; + _x params ["", "_classNamesUsed"]; if ({_x == _med} count _classNamesUsed > _limit) then { _hasOverDosed = _hasOverDosed + 1; }; - }foreach _allUsedMedication; -}foreach _incompatabileMeds; + } foreach _allUsedMedication; +} foreach _incompatabileMeds; if (_hasOverDosed > 0 && GVAR(enableOverdosing)) then { _medicationConfig = (configFile >> "ACE_Medical_Advanced" >> "Treatment" >> "Medication"); @@ -85,16 +77,8 @@ _decreaseAmount = 1 / _timeInSystem; _viscosityAdjustment = _viscosityChange / _timeInSystem; [{ - private ["_args", "_target", "_timeInSystem", "_variable", "_amountDecreased","_decreaseAmount", "_usedMeds", "_viscosityAdjustment", "_painReduce"]; - _args = _this select 0; - _target = _args select 0; - _timeInSystem = _args select 1; - _variable = _args select 2; - _amountDecreased = _args select 3; - _decreaseAmount = _args select 4; - _viscosityAdjustment = _args select 5; - _painReduce = _args select 6; - + params ["_args", "_idPFH"]; + _args params ["_target", "_timeInSystem", "_variable", "_amountDecreased","_decreaseAmount", "_usedMeds", "_viscosityAdjustment", "_painReduce"]; _usedMeds = _target getvariable [_variable, 0]; _usedMeds = _usedMeds - _decreaseAmount; _target setvariable [_variable, _usedMeds]; @@ -106,7 +90,7 @@ _viscosityAdjustment = _viscosityChange / _timeInSystem; _target setvariable [QGVAR(painSuppress), ((_target getvariable [QGVAR(painSuppress), 0]) - _painReduce) max 0]; if (_amountDecreased >= 1 || (_usedMeds <= 0) || !alive _target) then { - [(_this select 1)] call cba_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; }; _args set [3, _amountDecreased]; }, 1, [_target, _timeInSystem, _variable, 0, _decreaseAmount, _viscosityAdjustment, _painReduce / _timeInSystem] ] call CBA_fnc_addPerFrameHandler; diff --git a/addons/medical/functions/fnc_onPropagateWound.sqf b/addons/medical/functions/fnc_onPropagateWound.sqf index 934899eac4..f8b361ad17 100644 --- a/addons/medical/functions/fnc_onPropagateWound.sqf +++ b/addons/medical/functions/fnc_onPropagateWound.sqf @@ -7,7 +7,7 @@ * 1: injury * * Return Value: - * None + * None * * Public: No */ @@ -15,8 +15,7 @@ #include "script_component.hpp" private ["_unit", "_injury", "_openWounds", "_injuryID", "_exists"]; -_unit = _this select 0; -_injury = _this select 1; +params ["_unit", "_injury"]; if (!local _unit) then { _openWounds = _unit getvariable[QGVAR(openWounds), []]; @@ -28,7 +27,7 @@ if (!local _unit) then { _exists = true; _openWounds set [_foreachIndex, _injury]; }; - }foreach _openWounds; + } foreach _openWounds; if (!_exists) then { _openWounds pushback _injury; diff --git a/addons/medical/functions/fnc_onWoundUpdateRequest.sqf b/addons/medical/functions/fnc_onWoundUpdateRequest.sqf index 3c99496d7b..091bea7ef8 100644 --- a/addons/medical/functions/fnc_onWoundUpdateRequest.sqf +++ b/addons/medical/functions/fnc_onWoundUpdateRequest.sqf @@ -7,19 +7,18 @@ * 1: Origin object * * ReturnValue: - * + * None * * Public: Yes */ #include "script_component.hpp" private ["_unit", "_openWounds", "_originOfrequest"]; -_unit = _this select 0; -_originOfrequest = _this select 1; +params ["_unit", "_originOfrequest"]; if (local _unit && !(local _originOfrequest)) then { _openWounds = _unit getvariable [QGVAR(openWounds), []]; { ["medical_propagateWound", [_originOfrequest], [_unit, _x]] call EFUNC(common,targetEvent); - }foreach _openWounds; + } foreach _openWounds; }; diff --git a/addons/medical/functions/fnc_parseConfigForInjuries.sqf b/addons/medical/functions/fnc_parseConfigForInjuries.sqf index 1b2db7c278..e72ec63969 100644 --- a/addons/medical/functions/fnc_parseConfigForInjuries.sqf +++ b/addons/medical/functions/fnc_parseConfigForInjuries.sqf @@ -3,9 +3,9 @@ * Parse the ACE_Medical_Advanced config for all injury types. * * Arguments: - * + * None * ReturnValue: - * + * None * * Public: No */ @@ -110,7 +110,7 @@ _selectionSpecific = getNumber(_damageTypesConfig >> "selectionSpecific"); if (_type in (_x select 5)) then { _woundTypes pushback _x; }; - }foreach _allWoundClasses; + } foreach _allWoundClasses; _typeThresholds = _thresholds; _selectionSpecificType = _selectionSpecific; if (isClass(_damageTypesConfig >> _x)) then { @@ -130,46 +130,41 @@ _selectionSpecific = getNumber(_damageTypesConfig >> "selectionSpecific"); _minDamageThresholds = _minDamageThresholds + ":"; _amountThresholds = _amountThresholds + ":"; }; - }foreach _typeThresholds; + } foreach _typeThresholds; "ace_medical" callExtension format ["addDamageType,%1,%2,%3,%4,%5", _type, GVAR(minLethalDamages) select _foreachIndex, _minDamageThresholds, _amountThresholds, _selectionSpecificType]; -}foreach _allFoundDamageTypes; +} foreach _allFoundDamageTypes; // Extension loading { - private ["_classID", "_className", "_allowedSelections", "_bloodLoss", "_pain", "_minDamage", "_maxDamage", "_causes", "_classDisplayName", "_extensionInput", "_selections", "_causesArray"]; + private ["_className", "_allowedSelections", "_causes"]; // add shit to addInjuryType - _classID = _x select 0; + params ["_classID", "_selections", "_bloodLoss", "_pain", "_damage", "_causesArray", "_classDisplayName"]; + _damage params ["_minDamage", "_maxDamage"]; _className = GVAR(woundClassNames) select _forEachIndex; _allowedSelections = ""; - _selections = _x select 1; { _allowedSelections = _allowedSelections + _x; if (_forEachIndex < (count _selections) - 1) then { _allowedSelections = _allowedSelections + ":"; }; - }foreach _selections; + } foreach _selections; - _bloodLoss = _x select 2; - _pain = _x select 3; - _minDamage = (_x select 4) select 0; - _maxDamage = (_x select 4) select 1; _causes = ""; - _causesArray = (_x select 5); + { _causes = _causes + _x; if (_forEachIndex < (count _causesArray) - 1) then { _causes = _causes + ":"; }; - }foreach _causesArray; - _classDisplayName = _x select 6; + } foreach _causesArray; "ace_medical" callExtension format["addInjuryType,%1,%2,%3,%4,%5,%6,%7,%8,%9", _classID, _className, _allowedSelections, _bloodLoss, _pain, _minDamage, _maxDamage, _causes, _classDisplayName]; -}foreach _allWoundClasses; +} foreach _allWoundClasses; "ace_medical" callExtension "ConfigComplete"; diff --git a/addons/medical/functions/fnc_playInjuredSound.sqf b/addons/medical/functions/fnc_playInjuredSound.sqf index 3d41ec70db..ddf107c840 100644 --- a/addons/medical/functions/fnc_playInjuredSound.sqf +++ b/addons/medical/functions/fnc_playInjuredSound.sqf @@ -6,9 +6,10 @@ * * Arguments: * 0: The Unit + * 1: Amount of Pain * * ReturnValue: - * + * None * * Public: No */ @@ -16,8 +17,7 @@ #include "script_component.hpp" private ["_unit","_availableSounds_A","_availableSounds_B","_availableSounds_C","_sound", "_pain"]; -_unit = _this select 0; -_pain = _this select 1; +params ["_unit", "_pain"]; if (!local _unit || !GVAR(enableScreams)) exitwith{}; // Lock if the unit is already playing a sound. diff --git a/addons/medical/functions/fnc_setCardiacArrest.sqf b/addons/medical/functions/fnc_setCardiacArrest.sqf index c33d83bb40..b28e1cd679 100644 --- a/addons/medical/functions/fnc_setCardiacArrest.sqf +++ b/addons/medical/functions/fnc_setCardiacArrest.sqf @@ -35,11 +35,11 @@ _timeInCardiacArrest = 120 + round(random(600)); _heartRate = _unit getvariable [QGVAR(heartRate), 80]; if (_heartRate > 0 || !alive _unit) exitwith { - [(_this select 1)] call cba_fnc_removePerFrameHandler; + [(_this select 1)] call CBA_fnc_removePerFrameHandler; _unit setvariable [QGVAR(inCardiacArrest), nil,true]; }; if (ACE_time - _startTime >= _timeInCardiacArrest) exitwith { - [(_this select 1)] call cba_fnc_removePerFrameHandler; + [(_this select 1)] call CBA_fnc_removePerFrameHandler; _unit setvariable [QGVAR(inCardiacArrest), nil,true]; [_unit] call FUNC(setDead); }; diff --git a/addons/medical/functions/fnc_setDead.sqf b/addons/medical/functions/fnc_setDead.sqf index c29edcd5e3..e2884da391 100644 --- a/addons/medical/functions/fnc_setDead.sqf +++ b/addons/medical/functions/fnc_setDead.sqf @@ -50,7 +50,7 @@ if (((_reviveVal == 1 && {[_unit] call EFUNC(common,isPlayer)} || _reviveVal == _startTime = _unit getvariable [QGVAR(reviveStartTime), 0]; if (GVAR(maxReviveTime) > 0 && {ACE_time - _startTime > GVAR(maxReviveTime)}) exitwith { - [(_this select 1)] call cba_fnc_removePerFrameHandler; + [(_this select 1)] call CBA_fnc_removePerFrameHandler; _unit setvariable [QGVAR(inReviveState), nil, true]; _unit setvariable [QGVAR(reviveStartTime), nil]; [_unit, true] call FUNC(setDead); @@ -64,7 +64,7 @@ if (((_reviveVal == 1 && {[_unit] call EFUNC(common,isPlayer)} || _reviveVal == }; _unit setvariable [QGVAR(reviveStartTime), nil]; - [(_this select 1)] call cba_fnc_removePerFrameHandler; + [(_this select 1)] call CBA_fnc_removePerFrameHandler; }; if (GVAR(level) >= 2) then { if (_unit getvariable [QGVAR(heartRate), 60] > 0) then { diff --git a/addons/medical/functions/fnc_treatmentTourniquetLocal.sqf b/addons/medical/functions/fnc_treatmentTourniquetLocal.sqf index 5108bf8433..ceabb80587 100644 --- a/addons/medical/functions/fnc_treatmentTourniquetLocal.sqf +++ b/addons/medical/functions/fnc_treatmentTourniquetLocal.sqf @@ -36,13 +36,13 @@ _target setvariable [QGVAR(tourniquets), _tourniquets, true]; _part = _args select 2; _time = _args select 3; if (!alive _target) exitwith { - [(_this select 1)] call cba_fnc_removePerFrameHandler; + [(_this select 1)] call CBA_fnc_removePerFrameHandler; }; _tourniquets = _target getvariable [QGVAR(tourniquets), [0,0,0,0,0,0]]; if !((_tourniquets select _part) == _applyingTo) exitwith { // Tourniquet has been removed - [(_this select 1)] call cba_fnc_removePerFrameHandler; + [(_this select 1)] call CBA_fnc_removePerFrameHandler; }; if (ACE_time - _time > 120) then { _target setvariable [QGVAR(pain), (_target getvariable [QGVAR(pain), 0]) + 0.005]; diff --git a/addons/medical/functions/fnc_unconsciousPFH.sqf b/addons/medical/functions/fnc_unconsciousPFH.sqf index 5b1ca04d2d..c66f6863c8 100644 --- a/addons/medical/functions/fnc_unconsciousPFH.sqf +++ b/addons/medical/functions/fnc_unconsciousPFH.sqf @@ -45,7 +45,7 @@ if (!alive _unit) exitwith { [_unit, "isUnconscious"] call EFUNC(common,unmuteUnit); ["medical_onUnconscious", [_unit, false]] call EFUNC(common,globalEvent); - [(_this select 1)] call cba_fnc_removePerFrameHandler; + [(_this select 1)] call CBA_fnc_removePerFrameHandler; }; // In case the unit is no longer in an unconscious state, we are going to check if we can already reset the animation @@ -99,7 +99,7 @@ if !(_unit getvariable ["ACE_isUnconscious",false]) exitwith { ["medical_onUnconscious", [_unit, false]] call EFUNC(common,globalEvent); // EXIT PFH - [(_this select 1)] call cba_fnc_removePerFrameHandler; + [(_this select 1)] call CBA_fnc_removePerFrameHandler; }; if (!_hasMovedOut) then { // Reset the unit back to the previous captive state. @@ -132,7 +132,7 @@ if (_parachuteCheck) then { if (!local _unit) exitwith { _args set [3, _minWaitingTime - (ACE_time - _startingTime)]; _unit setvariable [QGVAR(unconsciousArguments), _args, true]; - [(_this select 1)] call cba_fnc_removePerFrameHandler; + [(_this select 1)] call CBA_fnc_removePerFrameHandler; }; // Ensure we are waiting at least a minimum period before checking if we can wake up the unit again, allows for temp knock outs From c2d94239a2dc4ecd6b0897f1a763ef82c7a995d2 Mon Sep 17 00:00:00 2001 From: jokoho48 Date: Sat, 22 Aug 2015 16:26:53 +0200 Subject: [PATCH 013/132] Code Cleanup Medical Module (Part 2). --- addons/medical/XEH_init.sqf | 3 +-- addons/medical/XEH_postInit.sqf | 13 +++++-------- addons/medical/XEH_respawn.sqf | 4 +--- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/addons/medical/XEH_init.sqf b/addons/medical/XEH_init.sqf index 0ded7d471f..0b86a927b2 100644 --- a/addons/medical/XEH_init.sqf +++ b/addons/medical/XEH_init.sqf @@ -1,7 +1,6 @@ #include "script_component.hpp" -private ["_unit"]; -_unit = _this select 0; +params ["_unit"]; _unit addEventHandler ["HandleDamage", {_this call FUNC(handleDamage)}]; diff --git a/addons/medical/XEH_postInit.sqf b/addons/medical/XEH_postInit.sqf index f9f821eeb3..6ce81d396d 100644 --- a/addons/medical/XEH_postInit.sqf +++ b/addons/medical/XEH_postInit.sqf @@ -11,10 +11,9 @@ GVAR(heartBeatSounds_Slow) = ["ACE_heartbeat_slow_1", "ACE_heartbeat_slow_2"]; ["interactMenuClosed", {[objNull, false] call FUNC(displayPatientInformation); }] call EFUNC(common,addEventHandler); ["medical_onUnconscious", { - if (local (_this select 0)) then { - private ["_unit"]; - _unit = _this select 0; - if (_this select 1) then { + params ["_unit", "_status"]; + if (local _unit) then { + if (_status) then { _unit setVariable ["tf_globalVolume", 0.4]; _unit setVariable ["tf_voiceVolume", 0, true]; _unit setVariable ["tf_unable_to_use_radio", true, true]; @@ -35,10 +34,8 @@ GVAR(heartBeatSounds_Slow) = ["ACE_heartbeat_slow_1", "ACE_heartbeat_slow_2"]; // Initialize all effects _fnc_createEffect = { - private ["_type", "_layer", "_default", "_effect"]; - _type = _this select 0; - _layer = _this select 1; - _default = _this select 2; + private "_effect"; + params ["_type", "_layer", "_default"]; _effect = ppEffectCreate [_type, _layer]; _effect ppEffectForceInNVG true; diff --git a/addons/medical/XEH_respawn.sqf b/addons/medical/XEH_respawn.sqf index 44060fa15c..bd8a7a105b 100644 --- a/addons/medical/XEH_respawn.sqf +++ b/addons/medical/XEH_respawn.sqf @@ -1,8 +1,6 @@ #include "script_component.hpp" -private ["_unit"]; - -_unit = _this select 0; +params ["_unit"]; if !(local _unit) exitWith {}; From 10127ed9573239ad4230fd4d2daff96687d7bd6e Mon Sep 17 00:00:00 2001 From: jokoho48 Date: Sat, 22 Aug 2015 17:10:19 +0200 Subject: [PATCH 014/132] Fix Typo --- addons/medical/functions/fnc_addToTriageCard.sqf | 2 +- addons/medical/functions/fnc_handleBandageOpening.sqf | 9 ++++----- .../functions/fnc_handleDamage_advancedSetDamage.sqf | 4 ++-- addons/medical/functions/fnc_handleDamage_wounds.sqf | 3 ++- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/addons/medical/functions/fnc_addToTriageCard.sqf b/addons/medical/functions/fnc_addToTriageCard.sqf index 1869340ad8..56b2042bc9 100644 --- a/addons/medical/functions/fnc_addToTriageCard.sqf +++ b/addons/medical/functions/fnc_addToTriageCard.sqf @@ -13,7 +13,7 @@ */ #include "script_component.hpp" -d + private ["_log", "_inList", "_amount"]; params ["_unit", "_newItem"]; diff --git a/addons/medical/functions/fnc_handleBandageOpening.sqf b/addons/medical/functions/fnc_handleBandageOpening.sqf index b617d1e64a..4a32adb9e5 100644 --- a/addons/medical/functions/fnc_handleBandageOpening.sqf +++ b/addons/medical/functions/fnc_handleBandageOpening.sqf @@ -21,7 +21,7 @@ private ["_className", "_reopeningChance", "_reopeningMinDelay", "_reopeningMaxDelay", "_config", "_woundTreatmentConfig", "_bandagedWounds", "_exist", "_injuryId", "_existingInjury", "_delay", "_openWounds", "_selectedInjury", "_bandagedInjury"]; params ["_target", "_impact", "_part", "_injuryIndex", "_injury", "_bandage"]; -_injury parmas ["_classID", "_injuryType"]; +_classID = _injury select 1; _className = GVAR(woundClassNames) select _classID; // default, just in case.. @@ -52,11 +52,11 @@ if (isClass (_config >> _className)) then { }; _bandagedWounds = _target getvariable [QGVAR(bandagedWounds), []]; +_injuryType = _injury select 1; _exist = false; _bandagedInjury = []; { - _x params ["", "_injuryTypeX", "_injuryX"]; - if (_injuryTypeX == _injuryType && _injuryTypeX == (_injury select 2)) exitwith { + if ((_x select 1) == _injuryType && (_x select 2) == (_injury select 2)) exitwith { _exist = true; _existingInjury = _x; _existingInjury set [3, (_existingInjury select 3) + _impact]; @@ -93,8 +93,7 @@ if (random(1) <= _reopeningChance) then { _exist = false; _injuryId = _injury select 1; { - _x params ["_injuryIdX", "_injuryX"]; - if (_injuryIdX == _injuryId && _injuryX == (_injury select 2)) exitwith { + if ((_x select 1) == _injuryId && (_x select 2) == (_injury select 2)) exitwith { _exist = true; _existingInjury = _x; _existingInjury set [3, ((_existingInjury select 3) - _impact) max 0]; diff --git a/addons/medical/functions/fnc_handleDamage_advancedSetDamage.sqf b/addons/medical/functions/fnc_handleDamage_advancedSetDamage.sqf index dc1e1a6fea..bac5a32976 100644 --- a/addons/medical/functions/fnc_handleDamage_advancedSetDamage.sqf +++ b/addons/medical/functions/fnc_handleDamage_advancedSetDamage.sqf @@ -17,12 +17,12 @@ params ["_unit"]; if (!local _unit) exitwith {}; -private ["_bodyStatus", "_headDamage", "_torsoDamage", "_handsDamage", "_legsDamage"]; +private "_bodyStatus"; // ["head", "body", "hand_l", "hand_r", "leg_l", "leg_r"] _bodyStatus = _unit getVariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]]; -_bodyStatus params ["_headDamage", "_torsoDamage", "_handsDamageR", "_handsDamageL", "_legsDamageR", "_legsDamageL"] +_bodyStatus params ["_headDamage", "_torsoDamage", "_handsDamageR", "_handsDamageL", "_legsDamageR", "_legsDamageL"]; _unit setHitPointDamage ["hitHead", _headDamage min 0.95]; _unit setHitPointDamage ["hitBody", _torsoDamage min 0.95]; diff --git a/addons/medical/functions/fnc_handleDamage_wounds.sqf b/addons/medical/functions/fnc_handleDamage_wounds.sqf index 5711d903de..4438e9bb90 100644 --- a/addons/medical/functions/fnc_handleDamage_wounds.sqf +++ b/addons/medical/functions/fnc_handleDamage_wounds.sqf @@ -32,7 +32,8 @@ _woundsCreated = []; call compile _extensionOutput; _foundIndex = -1; { - _x params ["_toAddClassID", "_bodyPartNToAdd"]; + _toAddClassID = _x select 1; + _bodyPartNToAdd = _x select 2; { // Check if we have an id of the given class on the given bodypart already if (_x select 1 == _toAddClassID && {_x select 2 == _bodyPartNToAdd}) exitwith { From ff6c8a31bec90b34f0d78fb32fceead2c487b394 Mon Sep 17 00:00:00 2001 From: jokoho48 Date: Sat, 22 Aug 2015 18:33:06 +0200 Subject: [PATCH 015/132] Code Cleanup Medical Module (Part 3). --- .../medical/functions/fnc_actionCheckBloodPressure.sqf | 4 ++-- .../functions/fnc_actionCheckBloodPressureLocal.sqf | 7 ++++--- addons/medical/functions/fnc_actionCheckPulse.sqf | 4 ++-- addons/medical/functions/fnc_actionLoadUnit.sqf | 9 ++++----- addons/medical/functions/fnc_actionRemoveTourniquet.sqf | 2 +- addons/medical/functions/fnc_addToLog.sqf | 6 +++--- addons/medical/functions/fnc_addUnloadPatientActions.sqf | 2 +- addons/medical/functions/fnc_getTypeOfDamage.sqf | 2 +- addons/medical/functions/fnc_handleDamage_caching.sqf | 2 +- addons/medical/stringtable.xml | 7 ++++++- 10 files changed, 25 insertions(+), 20 deletions(-) diff --git a/addons/medical/functions/fnc_actionCheckBloodPressure.sqf b/addons/medical/functions/fnc_actionCheckBloodPressure.sqf index 96c9740b5d..ceab369a4e 100644 --- a/addons/medical/functions/fnc_actionCheckBloodPressure.sqf +++ b/addons/medical/functions/fnc_actionCheckBloodPressure.sqf @@ -13,5 +13,5 @@ */ #include "script_component.hpp" - -[_this, QUOTE(DFUNC(actionCheckBloodPressureLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ +params ["_caller", "_target"]; +[[_caller, _target], QUOTE(DFUNC(actionCheckBloodPressureLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ diff --git a/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf b/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf index c7b444de73..c4c90845fd 100644 --- a/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf +++ b/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf @@ -17,9 +17,10 @@ private ["_bloodPressure", "_logOutPut", "_output"]; params ["_caller", "_target"]; -_bloodPressure = [_target] call FUNC(getBloodPressure); -if (!alive _target) then { - _bloodPressure = [0,0]; +_bloodPressure = if (!alive _target) then { + [0,0] +} else { + [_target] call FUNC(getBloodPressure) }; _bloodPressure params ["_bloodPressureLow", "_bloodPressureLow"]; _output = ""; diff --git a/addons/medical/functions/fnc_actionCheckPulse.sqf b/addons/medical/functions/fnc_actionCheckPulse.sqf index 1861195a04..58bac2e0ab 100644 --- a/addons/medical/functions/fnc_actionCheckPulse.sqf +++ b/addons/medical/functions/fnc_actionCheckPulse.sqf @@ -13,5 +13,5 @@ */ #include "script_component.hpp" - -[_this, QUOTE(DFUNC(actionCheckPulseLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ +params ["_caller","_target"]; +[[_caller, _target], QUOTE(DFUNC(actionCheckPulseLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ diff --git a/addons/medical/functions/fnc_actionLoadUnit.sqf b/addons/medical/functions/fnc_actionLoadUnit.sqf index f4b941383f..0340da2e20 100644 --- a/addons/medical/functions/fnc_actionLoadUnit.sqf +++ b/addons/medical/functions/fnc_actionLoadUnit.sqf @@ -18,14 +18,13 @@ private "_vehicle"; params ["_caller", "_target"]; if ([_target] call EFUNC(common,isAwake)) exitwith { - // TODO localization - ["displayTextStructured", [_caller], [["This person (%1) is awake and cannot be loaded", [_target] call EFUNC(common,getName)], 1.5, _caller]] call EFUNC(common,targetEvent); + ["displayTextStructured", [_caller], [[localize LSTRING(CanNotLoaded), [_target] call EFUNC(common,getName)], 1.5, _caller]] call EFUNC(common,targetEvent); }; if ([_target] call FUNC(isBeingCarried)) then { - _this call EFUNC(dragging,dropObject_carry); + ["_caller", "_target"] call EFUNC(dragging,dropObject_carry); }; if ([_target] call FUNC(isBeingDragged)) then { - _this call EFUNC(dragging,dropObject); + ["_caller", "_target"] call EFUNC(dragging,dropObject); }; -_vehicle = _this call EFUNC(common,loadPerson); +_vehicle = ["_caller", "_target"] call EFUNC(common,loadPerson); diff --git a/addons/medical/functions/fnc_actionRemoveTourniquet.sqf b/addons/medical/functions/fnc_actionRemoveTourniquet.sqf index 778042e9a6..2a39b63095 100644 --- a/addons/medical/functions/fnc_actionRemoveTourniquet.sqf +++ b/addons/medical/functions/fnc_actionRemoveTourniquet.sqf @@ -24,7 +24,7 @@ _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 { - _output = "There is no tourniquet on this body part!"; + _output = localize LSTRING(noTourniquetOnBodyPart); ["displayTextStructured", [_caller], [_output, 1.5, _caller]] call EFUNC(common,targetEvent); }; diff --git a/addons/medical/functions/fnc_addToLog.sqf b/addons/medical/functions/fnc_addToLog.sqf index 54a685611a..fff615a5b3 100644 --- a/addons/medical/functions/fnc_addToLog.sqf +++ b/addons/medical/functions/fnc_addToLog.sqf @@ -17,13 +17,13 @@ #include "script_component.hpp" private ["_moment", "_logVarName", "_log","_newLog", "_logs"]; -params ["_unit", "_type", "_allMapMarkers", "_arguments"]; +params ["_unit", "_type", "_message", "_arguments"]; if (!local _unit) exitwith { - [_this, QUOTE(DFUNC(addToLog)), _unit] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ + [_this, QFUNC(addToLog), _unit] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ }; -date params ["_minute", "_hour"]; +date params ["", "", "", "_minute", "_hour"]; _moment = if (_minute < 10) then { format["%1:0%2", _hour, _minute] diff --git a/addons/medical/functions/fnc_addUnloadPatientActions.sqf b/addons/medical/functions/fnc_addUnloadPatientActions.sqf index 11e0463328..f29b3923f1 100644 --- a/addons/medical/functions/fnc_addUnloadPatientActions.sqf +++ b/addons/medical/functions/fnc_addUnloadPatientActions.sqf @@ -27,7 +27,7 @@ _actions = []; str(_unit), [_unit, true] call EFUNC(common,getName), "", - {[_player, _parameters select 0] call FUNC(actionUnloadUnit);}, + {[_player, (_this select 2) select 0] call FUNC(actionUnloadUnit);}, {true}, {}, [_unit] diff --git a/addons/medical/functions/fnc_getTypeOfDamage.sqf b/addons/medical/functions/fnc_getTypeOfDamage.sqf index b8646e485f..d0aff19cc4 100644 --- a/addons/medical/functions/fnc_getTypeOfDamage.sqf +++ b/addons/medical/functions/fnc_getTypeOfDamage.sqf @@ -28,4 +28,4 @@ call { if (_typeOfProjectile isKindOf "BombCore") exitWith {"explosive"}; if (_typeOfProjectile isKindOf "Grenade") exitWith {"grenade"}; toLower _typeOfProjectile -}; +} diff --git a/addons/medical/functions/fnc_handleDamage_caching.sqf b/addons/medical/functions/fnc_handleDamage_caching.sqf index 9d31e53b1e..a9825a5c88 100644 --- a/addons/medical/functions/fnc_handleDamage_caching.sqf +++ b/addons/medical/functions/fnc_handleDamage_caching.sqf @@ -75,7 +75,7 @@ if (diag_frameno > (_unit getVariable [QGVAR(frameNo_damageCaching), -3]) + 2) t [{ private ["_args", "_params"]; params ["_args", "_idPFH"]; - params ["_unit", "_frameno"]; + _args params ["_unit", "_frameno"]; if (diag_frameno > _frameno + 2) then { _unit setDamage 0; diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index a81f43848d..be30382226 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -3617,5 +3617,10 @@ Distance to %1 has become to far for treatment %1 odszedł zbyt daleko, nie można kontynuować leczenia + + This person (%1) is awake and cannot be loaded + + + There is no tourniquet on this body part! - \ No newline at end of file + From 2d4ef164296f8b37b607a72da133be9ab2eb0818 Mon Sep 17 00:00:00 2001 From: jokoho48 Date: Sat, 22 Aug 2015 18:54:51 +0200 Subject: [PATCH 016/132] fix CTD --- addons/medical/functions/fnc_parseConfigForInjuries.sqf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/medical/functions/fnc_parseConfigForInjuries.sqf b/addons/medical/functions/fnc_parseConfigForInjuries.sqf index e72ec63969..764d0bf591 100644 --- a/addons/medical/functions/fnc_parseConfigForInjuries.sqf +++ b/addons/medical/functions/fnc_parseConfigForInjuries.sqf @@ -9,7 +9,6 @@ * * Public: No */ - #include "script_component.hpp" private ["_injuriesRootConfig", "_woundsConfig", "_allWoundClasses", "_amountOf", "_entry","_classType", "_selections", "_bloodLoss", "_pain","_minDamage","_causes", "_damageTypesConfig", "_thresholds", "_typeThresholds", "_selectionSpecific", "_selectionSpecificType", "_classDisplayName", "_subClassDisplayName", "_maxDamage", "_subClassmaxDamage", "_defaultMinLethalDamage", "_minLethalDamage", "_allFoundDamageTypes", "_classID", "_configDamageTypes", "_i", "_parseForSubClassWounds", "_subClass", "_subClassConfig", "_subClassbloodLoss", "_subClasscauses", "_subClassminDamage", "_subClasspain", "_subClassselections", "_subClasstype", "_type", "_varName", "_woundTypes"]; @@ -140,9 +139,9 @@ _selectionSpecific = getNumber(_damageTypesConfig >> "selectionSpecific"); // Extension loading { - private ["_className", "_allowedSelections", "_causes"]; + private ["_classID", "_className", "_allowedSelections", "_bloodLoss", "_pain", "_minDamage", "_maxDamage", "_causes", "_classDisplayName", "_extensionInput", "_selections", "_causesArray"]; // add shit to addInjuryType - params ["_classID", "_selections", "_bloodLoss", "_pain", "_damage", "_causesArray", "_classDisplayName"]; + _x params ["_classID", "_selections", "_bloodLoss", "_pain", "_damage", "_causesArray", "_classDisplayName"]; _damage params ["_minDamage", "_maxDamage"]; _className = GVAR(woundClassNames) select _forEachIndex; _allowedSelections = ""; @@ -162,6 +161,7 @@ _selectionSpecific = getNumber(_damageTypesConfig >> "selectionSpecific"); _causes = _causes + ":"; }; } foreach _causesArray; + _classDisplayName = _x select 6; "ace_medical" callExtension format["addInjuryType,%1,%2,%3,%4,%5,%6,%7,%8,%9", _classID, _className, _allowedSelections, _bloodLoss, _pain, _minDamage, _maxDamage, _causes, _classDisplayName]; From 19dd55147ae813dc6e0de515bc9290147236dce5 Mon Sep 17 00:00:00 2001 From: jokoho48 Date: Sat, 22 Aug 2015 19:47:23 +0200 Subject: [PATCH 017/132] Code Cleanup Medical Module (Part 4). --- .../functions/fnc_requestWoundSync.sqf | 6 +-- .../functions/fnc_setCardiacArrest.sqf | 17 ++++----- addons/medical/functions/fnc_setDead.sqf | 18 ++++----- .../functions/fnc_setHitPointDamage.sqf | 11 ++---- .../medical/functions/fnc_setUnconscious.sqf | 18 ++++----- addons/medical/functions/fnc_treatment.sqf | 11 ++---- .../functions/fnc_treatmentAdvanced_CPR.sqf | 7 +--- .../fnc_treatmentAdvanced_CPRLocal.sqf | 5 +-- .../fnc_treatmentAdvanced_bandage.sqf | 13 ++----- .../fnc_treatmentAdvanced_bandageLocal.sqf | 17 ++++----- .../fnc_treatmentAdvanced_fullHeal.sqf | 7 +--- .../fnc_treatmentAdvanced_fullHealLocal.sqf | 7 ++-- ...reatmentAdvanced_fullHealTreatmentTime.sqf | 6 +-- .../fnc_treatmentAdvanced_medication.sqf | 9 +---- .../fnc_treatmentAdvanced_medicationLocal.sqf | 5 +-- ...eatmentAdvanced_surgicalKit_onProgress.sqf | 27 +++++++++----- .../functions/fnc_treatmentBasic_bandage.sqf | 9 ++--- .../functions/fnc_treatmentBasic_bloodbag.sqf | 7 +--- .../fnc_treatmentBasic_bloodbagLocal.sqf | 2 +- .../functions/fnc_treatmentBasic_epipen.sqf | 8 +--- .../functions/fnc_treatmentBasic_morphine.sqf | 6 +-- .../fnc_treatmentBasic_morphineLocal.sqf | 6 +-- addons/medical/functions/fnc_treatmentIV.sqf | 15 +++----- .../functions/fnc_treatmentIVLocal.sqf | 7 ++-- .../functions/fnc_treatmentTourniquet.sqf | 6 +-- .../fnc_treatmentTourniquetLocal.sqf | 23 +++++------- .../functions/fnc_treatment_failure.sqf | 37 +++++++++---------- .../functions/fnc_treatment_success.sqf | 23 +++++------- .../medical/functions/fnc_unconsciousPFH.sqf | 20 ++++------ addons/medical/functions/fnc_useItem.sqf | 13 +++---- addons/medical/functions/fnc_useItems.sqf | 10 ++--- 31 files changed, 150 insertions(+), 226 deletions(-) diff --git a/addons/medical/functions/fnc_requestWoundSync.sqf b/addons/medical/functions/fnc_requestWoundSync.sqf index 74fd3e230d..31cf726214 100644 --- a/addons/medical/functions/fnc_requestWoundSync.sqf +++ b/addons/medical/functions/fnc_requestWoundSync.sqf @@ -7,16 +7,14 @@ * 1: object belonging to the caller * * ReturnValue: - * + * None * * Public: Yes */ #include "script_component.hpp" -private [ "_target", "_caller"]; -_target = _this select 0; -_caller = _this select 1; +params [ "_target", "_caller"]; if (local _target || GVAR(level) < 2) exitwith {}; // if the target is local, we already got the most update to date information if (_target getvariable [QGVAR(isWoundSynced), false]) exitwith {}; diff --git a/addons/medical/functions/fnc_setCardiacArrest.sqf b/addons/medical/functions/fnc_setCardiacArrest.sqf index b28e1cd679..017befcaad 100644 --- a/addons/medical/functions/fnc_setCardiacArrest.sqf +++ b/addons/medical/functions/fnc_setCardiacArrest.sqf @@ -7,15 +7,15 @@ * 0: The unit that will be put in cardiac arrest state * * ReturnValue: - * + * None * * Public: yes */ #include "script_component.hpp" -private ["_unit", "_timeInCardiacArrest"]; -_unit = _this select 0; +private "_timeInCardiacArrest"; +params ["_unit"]; if (_unit getvariable [QGVAR(inCardiacArrest),false]) exitwith {}; _unit setvariable [QGVAR(inCardiacArrest), true,true]; @@ -28,20 +28,17 @@ _timeInCardiacArrest = 120 + round(random(600)); [{ private ["_args","_unit","_startTime","_timeInCardiacArrest","_heartRate"]; - _args = _this select 0; - _unit = _args select 0; - _startTime = _args select 1; - _timeInCardiacArrest = _args select 2; + params ["_args", "_idPFH"]; + _args params ["_unit", "_startTime", "_timeInCardiacArrest"]; _heartRate = _unit getvariable [QGVAR(heartRate), 80]; if (_heartRate > 0 || !alive _unit) exitwith { - [(_this select 1)] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; _unit setvariable [QGVAR(inCardiacArrest), nil,true]; }; if (ACE_time - _startTime >= _timeInCardiacArrest) exitwith { - [(_this select 1)] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; _unit setvariable [QGVAR(inCardiacArrest), nil,true]; [_unit] call FUNC(setDead); }; }, 1, [_unit, ACE_time, _timeInCardiacArrest] ] call CBA_fnc_addPerFrameHandler; - diff --git a/addons/medical/functions/fnc_setDead.sqf b/addons/medical/functions/fnc_setDead.sqf index e2884da391..db84ff72c5 100644 --- a/addons/medical/functions/fnc_setDead.sqf +++ b/addons/medical/functions/fnc_setDead.sqf @@ -6,7 +6,7 @@ * 0: The unit that will be killed * * ReturnValue: - * + * None * * Public: yes */ @@ -14,11 +14,7 @@ #include "script_component.hpp" private ["_unit", "_force", "_reviveVal", "_lifesLeft"]; -_unit = _this select 0; -_force = false; -if (count _this >= 2) then { - _force = _this select 1; -}; +params ["_unit", ["_force", false]]; if (!alive _unit) exitwith{true}; if (!local _unit) exitwith { @@ -44,13 +40,13 @@ if (((_reviveVal == 1 && {[_unit] call EFUNC(common,isPlayer)} || _reviveVal == [_unit, true] call FUNC(setUnconscious); [{ - private ["_args","_unit","_startTime"]; - _args = _this select 0; - _unit = _args select 0; + private "_startTime"; + params ["_args", "_idPFH"]; + _args params ["_unit"]; _startTime = _unit getvariable [QGVAR(reviveStartTime), 0]; if (GVAR(maxReviveTime) > 0 && {ACE_time - _startTime > GVAR(maxReviveTime)}) exitwith { - [(_this select 1)] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; _unit setvariable [QGVAR(inReviveState), nil, true]; _unit setvariable [QGVAR(reviveStartTime), nil]; [_unit, true] call FUNC(setDead); @@ -64,7 +60,7 @@ if (((_reviveVal == 1 && {[_unit] call EFUNC(common,isPlayer)} || _reviveVal == }; _unit setvariable [QGVAR(reviveStartTime), nil]; - [(_this select 1)] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; }; if (GVAR(level) >= 2) then { if (_unit getvariable [QGVAR(heartRate), 60] > 0) then { diff --git a/addons/medical/functions/fnc_setHitPointDamage.sqf b/addons/medical/functions/fnc_setHitPointDamage.sqf index 18d4fc616e..1713c02243 100644 --- a/addons/medical/functions/fnc_setHitPointDamage.sqf +++ b/addons/medical/functions/fnc_setHitPointDamage.sqf @@ -7,10 +7,10 @@ * 0: Unit * 1: HitPoint * 2: Damage - * 3: Disable overall damage adjustment (optional) + * 3: Disable overall damage adjustment (default: false) * * Return Value: - * nil + * None * * Public: Yes */ @@ -22,10 +22,7 @@ #define ARMDAMAGETRESHOLD2 1.7 private ["_unit", "_selection", "_damage", "_selections", "_damages", "_damageOld", "_damageSumOld", "_damageNew", "_damageSumNew", "_damageFinal", "_armdamage", "_legdamage"]; - -_unit = _this select 0; -_selection = _this select 1; -_damage = _this select 2; +params ["_unit", "_selection", "_damage", ["_disalbed", false]]; // Unit isn't local, give function to machine where it is. if !(local _unit) exitWith { @@ -33,7 +30,7 @@ if !(local _unit) exitWith { }; // Check if overall damage adjustment is disabled -if (count _this > 3 && {_this select 3}) exitWith { +if (_disalbed) exitWith { _unit setHitPointDamage [_selection, _damage]; }; diff --git a/addons/medical/functions/fnc_setUnconscious.sqf b/addons/medical/functions/fnc_setUnconscious.sqf index 7e5cd8c1b7..3de62db974 100644 --- a/addons/medical/functions/fnc_setUnconscious.sqf +++ b/addons/medical/functions/fnc_setUnconscious.sqf @@ -4,9 +4,9 @@ * * Arguments: * 0: The unit that will be put in an unconscious state - * 1: Set unconsciouns - * 2: Minimum unconscious ACE_time - * 3: Force AI Unconscious (skip random death chance) + * 1: Set unconsciouns (default: true) + * 2: Minimum unconscious ACE_time (default: (round(random(10)+5))) + * 3: Force AI Unconscious (skip random death chance) (default: false) * * ReturnValue: * nil @@ -19,13 +19,10 @@ #include "script_component.hpp" -#define DEFAULT_DELAY (round(random(10)+5)) +#define DEFAULT_DELAY (round(random(10)+5)) -private ["_unit", "_set", "_animState", "_originalPos", "_startingTime","_minWaitingTime", "_force", "_isDead"]; -_unit = _this select 0; -_set = if (count _this > 1) then {_this select 1} else {true}; -_minWaitingTime = if (count _this > 2) then {_this select 2} else {DEFAULT_DELAY}; -_force = if (count _this > 3) then {_this select 3} else {false}; +private ["_animState", "_originalPos", "_startingTime", "_isDead"]; +params ["_unit", ["_set", true], ["_minWaitingTime", DEFAULT_DELAY], ["_force", false]]; // No change, fuck off. (why is there no xor?) if (_set isEqualTo (_unit getVariable ["ACE_isUnconscious", false])) exitWith {}; @@ -97,8 +94,7 @@ if (GVAR(moveUnitsFromGroupOnUnconscious)) then { _anim = [_unit] call EFUNC(common,getDeathAnim); [_unit, _anim, 1, true] call EFUNC(common,doAnimation); [{ - _unit = _this select 0; - _anim = _this select 1; + params ["_unit", "_anim"]; if ((_unit getVariable "ACE_isUnconscious") and (animationState _unit != _anim)) then { [_unit, _anim, 2, true] call EFUNC(common,doAnimation); }; diff --git a/addons/medical/functions/fnc_treatment.sqf b/addons/medical/functions/fnc_treatment.sqf index a319d50440..a39375a05e 100644 --- a/addons/medical/functions/fnc_treatment.sqf +++ b/addons/medical/functions/fnc_treatment.sqf @@ -16,11 +16,8 @@ #include "script_component.hpp" -private ["_caller", "_target", "_selectionName", "_className", "_config", "_medicRequired", "_items", "_locations", "_return", "_callbackProgress", "_treatmentTime", "_callerAnim", "_patientAnim", "_iconDisplayed", "_return", "_usersOfItems", "_consumeItems", "_condition", "_displayText", "_wpn", "_treatmentTimeConfig", "_patientStateCondition", "_allowedSelections"]; -_caller = _this select 0; -_target = _this select 1; -_selectionName = _this select 2; -_className = _this select 3; +private ["_config", "_medicRequired", "_items", "_locations", "_return", "_callbackProgress", "_treatmentTime", "_callerAnim", "_patientAnim", "_iconDisplayed", "_return", "_usersOfItems", "_consumeItems", "_condition", "_displayText", "_wpn", "_treatmentTimeConfig", "_patientStateCondition", "_allowedSelections"]; +params ["_caller", "_target", "_selectionName", "_className"]; // If the cursorMenu is open, the loading bar will fail. If we execute the function one frame later, it will work fine if (uiNamespace getVariable [QEGVAR(interact_menu,cursorMenuOpened),false]) exitwith { @@ -107,7 +104,7 @@ if ("All" in _locations) then { }; }; }; - }foreach _locations; + } foreach _locations; }; if !(_return) exitwith {false}; @@ -180,7 +177,7 @@ if (vehicle _caller == _caller && {_callerAnim != ""}) then { TRACE_1("Weapon Deployed, breaking out first",(stance _caller)); [_caller, "", 0] call EFUNC(common,doAnimation); }; - + if ((stance _caller) == "STAND") then { switch (_wpn) do {//If standing, end in a crouched animation based on their current weapon case ("rfl"): {_caller setvariable [QGVAR(treatmentPrevAnimCaller), "AmovPknlMstpSrasWrflDnon"];}; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_CPR.sqf b/addons/medical/functions/fnc_treatmentAdvanced_CPR.sqf index ade74a6ccb..f09de600ae 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_CPR.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_CPR.sqf @@ -16,12 +16,7 @@ #include "script_component.hpp" -private ["_caller", "_target", "_selectionName", "_className", "_items"]; -_caller = _this select 0; -_target = _this select 1; -_selectionName = _this select 2; -_className = _this select 3; -_items = _this select 4; +params ["_caller", "_target", "_selectionName", "_className", "_items"]; if (alive _target && {(_target getvariable [QGVAR(inCardiacArrest), false] || _target getvariable [QGVAR(inReviveState), false])}) then { [[_caller, _target], QUOTE(DFUNC(treatmentAdvanced_CPRLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ diff --git a/addons/medical/functions/fnc_treatmentAdvanced_CPRLocal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_CPRLocal.sqf index a7c8ea6744..cd943fc8d0 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_CPRLocal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_CPRLocal.sqf @@ -14,9 +14,8 @@ #include "script_component.hpp" -private ["_caller","_target", "_reviveStartTime"]; -_caller = _this select 0; -_target = _this select 1; +private "_reviveStartTime"; +param ["_caller","_target"]; if (_target getvariable [QGVAR(inReviveState), false]) then { _reviveStartTime = _target getvariable [QGVAR(reviveStartTime),0]; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf b/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf index 1278994a11..f2159c37ef 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf @@ -7,7 +7,8 @@ * 1: The patient * 2: SelectionName * 3: Treatment classname - * + * 4: Item + * 5: specific Spot (default: -1) * * Return Value: * Succesful treatment started @@ -16,15 +17,7 @@ */ #include "script_component.hpp" - -private ["_caller", "_target", "_selectionName", "_className", "_items", "_specificSpot"]; -_caller = _this select 0; -_target = _this select 1; -_selectionName = _this select 2; -_className = _this select 3; -_items = _this select 4; - -_specificSpot = if (count _this > 6) then {_this select 6} else {-1}; +params ["_caller", "_target", "_selectionName", "_className", "_items", ["_specificSpot", -1]]; if !([_target] call FUNC(hasMedicalEnabled)) exitwith { _this call FUNC(treatmentBasic_bandage); diff --git a/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf index d6c490d3c6..b36a551458 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf @@ -15,19 +15,16 @@ #include "script_component.hpp" -private ["_target", "_bandage", "_part", "_selectionName", "_openWounds", "_config", "_effectiveness","_mostEffectiveInjury", "_mostEffectiveSpot", "_woundEffectivenss", "_mostEffectiveInjury", "_impact", "_exit", "_specificClass", "_classID", "_effectivenessFound", "_className", "_hitPoints", "_hitSelections", "_point", "_woundTreatmentConfig"]; -_target = _this select 0; -_bandage = _this select 1; -_selectionName = _this select 2; -_specificClass = if (count _this > 3) then {_this select 3} else { -1 }; +private ["_openWounds", "_config", "_effectiveness","_mostEffectiveInjury", "_mostEffectiveSpot", "_woundEffectivenss", "_mostEffectiveInjury", "_impact", "_exit", "_classID", "_effectivenessFound", "_className", "_hitPoints", "_hitSelections", "_point", "_woundTreatmentConfig"]; +params ["_target", "_bandage", "_selectionName", ["_specificClass", -1]]; // Ensure it is a valid bodypart _part = [_selectionName] call FUNC(selectionNameToNumber); -if (_part < 0) exitwith {}; +if (_part < 0) exitwith {false}; // Get the open wounds for this unit _openWounds = _target getvariable [QGVAR(openWounds), []]; -if (count _openWounds == 0) exitwith {}; // nothing to do here! +if (count _openWounds == 0) exitwith {false}; // nothing to do here! // Get the default effectiveness for the used bandage _config = (ConfigFile >> "ACE_Medical_Advanced" >> "Treatment" >> "Bandaging"); @@ -43,10 +40,10 @@ _effectivenessFound = -1; _mostEffectiveInjury = _openWounds select 0; _exit = false; { + params ["", "_classID", "_partX"]; // Only parse injuries that are for the selected bodypart. - if (_x select 2 == _part) then { + if (_partX == _part) then { _woundEffectivenss = _effectiveness; - _classID = (_x select 1); // Select the classname from the wound classname storage _className = GVAR(woundClassNames) select _classID; @@ -74,7 +71,7 @@ _exit = false; }; }; if (_exit) exitwith {}; -}foreach _openWounds; +} foreach _openWounds; if (_effectivenessFound == -1) exitwith {}; // Seems everything is patched up on this body part already.. diff --git a/addons/medical/functions/fnc_treatmentAdvanced_fullHeal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_fullHeal.sqf index 37627a8c5d..64ce319341 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_fullHeal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_fullHeal.sqf @@ -10,12 +10,7 @@ #include "script_component.hpp" -private ["_target", "_caller", "_selectionName", "_className", "_items"]; -_caller = _this select 0; -_target = _this select 1; -_selectionName = _this select 2; -_className = _this select 3; -_items = _this select 4; +params ["_target", "_caller", "_selectionName", "_className", "_items"]; // TODO replace by event system [[_caller, _target], QUOTE(DFUNC(treatmentAdvanced_fullHealLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ diff --git a/addons/medical/functions/fnc_treatmentAdvanced_fullHealLocal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_fullHealLocal.sqf index df7594921d..ed5eb0858d 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_fullHealLocal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_fullHealLocal.sqf @@ -10,9 +10,8 @@ #include "script_component.hpp" -private ["_target", "_caller", "_allUsedMedication"]; -_caller = _this select 0; -_target = _this select 1; +private "_allUsedMedication"; +params ["_caller", "_target"]; if (alive _target) exitwith { @@ -64,7 +63,7 @@ if (alive _target) exitwith { _allUsedMedication = _target getVariable [QGVAR(allUsedMedication), []]; { _target setvariable [_x select 0, nil]; - }foreach _allUsedMedication; + } foreach _allUsedMedication; // Resetting damage _target setDamage 0; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_fullHealTreatmentTime.sqf b/addons/medical/functions/fnc_treatmentAdvanced_fullHealTreatmentTime.sqf index 108bdd4a5d..a0539948ea 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_fullHealTreatmentTime.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_fullHealTreatmentTime.sqf @@ -15,12 +15,12 @@ */ #include "script_component.hpp" -private ["_target", "_totalDamage"]; -_target = _this; +private "_totalDamage"; + _totalDamage = 0; { _totalDamage = _totalDamage + _x; -} forEach (_target getVariable [QGVAR(bodyPartStatus), []]); +} forEach (_this getVariable [QGVAR(bodyPartStatus), []]); (10 max (_totalDamage * 10) min 120) diff --git a/addons/medical/functions/fnc_treatmentAdvanced_medication.sqf b/addons/medical/functions/fnc_treatmentAdvanced_medication.sqf index 0b401a73cc..b5b0af1401 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_medication.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_medication.sqf @@ -17,12 +17,7 @@ #include "script_component.hpp" -private ["_caller", "_target", "_selectionName", "_className", "_items"]; -_caller = _this select 0; -_target = _this select 1; -_selectionName = _this select 2; -_className = _this select 3; -_items = _this select 4; +params ["_caller", "_target", "_selectionName", "_className", "_items"]; [[_target, _className], QUOTE(DFUNC(treatmentAdvanced_medicationLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ @@ -32,7 +27,7 @@ _items = _this select 4; [_target, "activity", LSTRING(Activity_usedItem), [[_caller] call EFUNC(common,getName), getText (configFile >> "CfgWeapons" >> _x >> "displayName")]] call FUNC(addToLog); [_target, "activity_view", LSTRING(Activity_usedItem), [[_caller] call EFUNC(common,getName), getText (configFile >> "CfgWeapons" >> _x >> "displayName")]] call FUNC(addToLog); }; -}foreach _items; +} foreach _items; true; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_medicationLocal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_medicationLocal.sqf index c4ba840398..00a4fae8d9 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_medicationLocal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_medicationLocal.sqf @@ -15,9 +15,8 @@ #include "script_component.hpp" -private ["_target", "_className", "_currentInSystem", "_medicationConfig", "_painReduce", "_hrIncreaseLow", "_hrIncreaseNorm", "_hrIncreaseHigh", "_maxDose", "_inCompatableMedication", "_timeInSystem", "_heartRate", "_pain", "_resistance", "_hrCallback", "_varName", "_viscosityChange"]; -_target = _this select 0; -_className = _this select 1; +private ["_currentInSystem", "_medicationConfig", "_painReduce", "_hrIncreaseLow", "_hrIncreaseNorm", "_hrIncreaseHigh", "_maxDose", "_inCompatableMedication", "_timeInSystem", "_heartRate", "_pain", "_resistance", "_hrCallback", "_varName", "_viscosityChange"]; +params ["_target", "_className"]; // We have added a new dose of this medication to our system, so let's increase it _varName = format[QGVAR(%1_inSystem), _className]; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_surgicalKit_onProgress.sqf b/addons/medical/functions/fnc_treatmentAdvanced_surgicalKit_onProgress.sqf index c0e1037027..aadcb40d45 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_surgicalKit_onProgress.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_surgicalKit_onProgress.sqf @@ -1,23 +1,30 @@ /* * Author: BaerMitUmlaut - * Handles treatment via surgical kit per frame. + * Handles treatment via surgical kit per frame + * + * Arguments: + * 0: Arguments + * 0: Caller + * 1: Target + * 1: Elapsed Time + * 2: Total Time + * + * Return Value: + * Succesful treatment started * * Public: No */ - #include "script_component.hpp" -private ["_args", "_target", "_caller", "_elapsedTime", "_totalTime", "_bandagedWounds"]; -_args = _this select 0; -_caller = _args select 0; -_target = _args select 1; -_elapsedTime = _this select 1; -_totalTime = _this select 2; + +private "_bandagedWounds"; +params ["_args", "_elapsedTime", "_totalTime"]; +_args params ["_caller", "_target"]; _bandagedWounds = _target getVariable [QGVAR(bandagedWounds), []]; //In case two people stitch up one patient and the last wound has already been closed we can stop already -if (count _bandagedWounds == 0) exitWith {false}; +if (count _bandagedWounds == 0) exitWith { false }; //Has enough time elapsed that we can close another wound? if ((_totalTime - _elapsedTime) <= (((count _bandagedWounds) - 1) * 5)) then { @@ -25,4 +32,4 @@ if ((_totalTime - _elapsedTime) <= (((count _bandagedWounds) - 1) * 5)) then { _target setVariable [QGVAR(bandagedWounds), _bandagedWounds, true]; }; -true \ No newline at end of file +true diff --git a/addons/medical/functions/fnc_treatmentBasic_bandage.sqf b/addons/medical/functions/fnc_treatmentBasic_bandage.sqf index 75b0b6bfdd..c0ebc35472 100644 --- a/addons/medical/functions/fnc_treatmentBasic_bandage.sqf +++ b/addons/medical/functions/fnc_treatmentBasic_bandage.sqf @@ -9,7 +9,7 @@ * 3: Treatment classname * * Return Value: - * nil + * None * * Public: No */ @@ -17,11 +17,8 @@ #include "script_component.hpp" #define BANDAGEHEAL 0.8 -private ["_caller", "_target","_selection","_className","_target","_hitSelections","_hitPoints","_point", "_damage"]; -_caller = _this select 0; -_target = _this select 1; -_selection = _this select 2; -_className = _this select 3; +private ["_hitSelections", "_hitPoints", "_point", "_damage"]; +params ["_caller", "_target", "_selection", "_className"]; if (_selection == "all") then { _target setDamage ((damage _target - BANDAGEHEAL) max 0); diff --git a/addons/medical/functions/fnc_treatmentBasic_bloodbag.sqf b/addons/medical/functions/fnc_treatmentBasic_bloodbag.sqf index 7cfb65a909..5700d351cb 100644 --- a/addons/medical/functions/fnc_treatmentBasic_bloodbag.sqf +++ b/addons/medical/functions/fnc_treatmentBasic_bloodbag.sqf @@ -9,16 +9,13 @@ * 3: Treatment classname * * Return Value: - * nil + * None * * Public: No */ #include "script_component.hpp" -private ["_caller", "_target", "_treatmentClassname"]; -_caller = _this select 0; -_target = _this select 1; -_treatmentClassname = _this select 3; +params ["_caller", "_target", "_treatmentClassname"]; [[_target, _treatmentClassname], QUOTE(DFUNC(treatmentBasic_bloodbagLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ diff --git a/addons/medical/functions/fnc_treatmentBasic_bloodbagLocal.sqf b/addons/medical/functions/fnc_treatmentBasic_bloodbagLocal.sqf index 08057c9492..64ba6e031b 100644 --- a/addons/medical/functions/fnc_treatmentBasic_bloodbagLocal.sqf +++ b/addons/medical/functions/fnc_treatmentBasic_bloodbagLocal.sqf @@ -15,7 +15,7 @@ #include "script_component.hpp" #define BLOODBAGHEAL 70 -PARAMS_2(_target,_treatmentClassname); +params ["_target", "_treatmentClassname"]; private ["_blood", "_bloodAdded"]; diff --git a/addons/medical/functions/fnc_treatmentBasic_epipen.sqf b/addons/medical/functions/fnc_treatmentBasic_epipen.sqf index bdfb95fb2a..d387e91f89 100644 --- a/addons/medical/functions/fnc_treatmentBasic_epipen.sqf +++ b/addons/medical/functions/fnc_treatmentBasic_epipen.sqf @@ -9,17 +9,13 @@ * 3: Treatment classname * * Return Value: - * nil + * None * * Public: No */ - #include "script_component.hpp" -private ["_caller", "_target","_className"]; -_caller = _this select 0; -_target = _this select 1; -_className = _this select 3; +params ["_caller", "_target","_className"]; [_target, false] call FUNC(setUnconscious); diff --git a/addons/medical/functions/fnc_treatmentBasic_morphine.sqf b/addons/medical/functions/fnc_treatmentBasic_morphine.sqf index 048b314781..87559d0dd2 100644 --- a/addons/medical/functions/fnc_treatmentBasic_morphine.sqf +++ b/addons/medical/functions/fnc_treatmentBasic_morphine.sqf @@ -9,7 +9,7 @@ * 3: Treatment classname * * Return Value: - * nil + * None * * Public: No */ @@ -17,8 +17,6 @@ #include "script_component.hpp" #define MORPHINEHEAL 0.4 -private ["_caller", "_target"]; -_caller = _this select 0; -_target = _this select 1; +params ["_caller", "_target"]; [[_target], QUOTE(DFUNC(treatmentBasic_morphineLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ diff --git a/addons/medical/functions/fnc_treatmentBasic_morphineLocal.sqf b/addons/medical/functions/fnc_treatmentBasic_morphineLocal.sqf index 9dddf743e2..780196819b 100644 --- a/addons/medical/functions/fnc_treatmentBasic_morphineLocal.sqf +++ b/addons/medical/functions/fnc_treatmentBasic_morphineLocal.sqf @@ -7,7 +7,7 @@ * 1: The patient * * Return Value: - * nil + * None * * Public: No */ @@ -15,8 +15,8 @@ #include "script_component.hpp" #define MORPHINEHEAL 0.4 -private ["_target", "_morphine", "_pain"]; -_target = _this select 0; +private ["_morphine", "_pain"]; +params ["_target"]; // reduce pain, pain sensitivity _morphine = ((_target getVariable [QGVAR(morphine), 0]) + MORPHINEHEAL) min 1; diff --git a/addons/medical/functions/fnc_treatmentIV.sqf b/addons/medical/functions/fnc_treatmentIV.sqf index e0c4d20ed6..2a7bbc6adf 100644 --- a/addons/medical/functions/fnc_treatmentIV.sqf +++ b/addons/medical/functions/fnc_treatmentIV.sqf @@ -8,26 +8,23 @@ * 2: SelectionName * 3: Treatment classname * - * * Return Value: - * + * Succesful treatment started * * Public: Yes */ #include "script_component.hpp" -private ["_caller", "_target", "_selectionName", "_className", "_items", "_removeItem"]; -_caller = _this select 0; -_target = _this select 1; -_selectionName = _this select 2; -_className = _this select 3; -_items = _this select 4; +private "_removeItem"; +params ["_caller", "_target", "_selectionName", "_className", "_items"]; -if (count _items == 0) exitwith {}; +if (count _items == 0) exitwith {false}; _removeItem = _items select 0; [[_target, _className], QUOTE(DFUNC(treatmentIVLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ [_target, _removeItem] call FUNC(addToTriageCard); [_target, "activity", LSTRING(Activity_gaveIV), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); [_target, "activity_view", LSTRING(Activity_gaveIV), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message + +true diff --git a/addons/medical/functions/fnc_treatmentIVLocal.sqf b/addons/medical/functions/fnc_treatmentIVLocal.sqf index 9abb5fda2f..37cba2ad1b 100644 --- a/addons/medical/functions/fnc_treatmentIVLocal.sqf +++ b/addons/medical/functions/fnc_treatmentIVLocal.sqf @@ -8,16 +8,15 @@ * * * Return Value: - * nil + * None * * Public: Yes */ #include "script_component.hpp" -private ["_target", "_treatmentClassname", "_config", "_volumeAdded", "_typeOf", "_varName", "_bloodVolume"]; -_target = _this select 0; -_treatmentClassname = _this select 1; +private ["_config", "_volumeAdded", "_typeOf", "_varName", "_bloodVolume"]; +params ["_target", "_treatmentClassname"]; _bloodVolume = _target getvariable [QGVAR(bloodVolume), 100]; if (_bloodVolume >= 100) exitwith {}; diff --git a/addons/medical/functions/fnc_treatmentTourniquet.sqf b/addons/medical/functions/fnc_treatmentTourniquet.sqf index 148ed06252..2a169a50d0 100644 --- a/addons/medical/functions/fnc_treatmentTourniquet.sqf +++ b/addons/medical/functions/fnc_treatmentTourniquet.sqf @@ -10,7 +10,7 @@ * * * Return Value: - * + * Succesful treatment started * * Public: No */ @@ -24,7 +24,7 @@ _selectionName = _this select 2; _className = _this select 3; _items = _this select 4; -if (count _items == 0) exitwith {}; +if (count _items == 0) exitwith {false}; _part = [_selectionName] call FUNC(selectionNameToNumber); if (_part == 0 || _part == 1) exitwith { @@ -47,4 +47,4 @@ _removeItem = _items select 0; [_target, "activity_view", LSTRING(Activity_appliedTourniquet), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message -true; +true diff --git a/addons/medical/functions/fnc_treatmentTourniquetLocal.sqf b/addons/medical/functions/fnc_treatmentTourniquetLocal.sqf index ceabb80587..fb7394866e 100644 --- a/addons/medical/functions/fnc_treatmentTourniquetLocal.sqf +++ b/addons/medical/functions/fnc_treatmentTourniquetLocal.sqf @@ -7,16 +7,14 @@ * 1: Item used classname * * Return Value: - * nil + * None * * Public: No */ #include "script_component.hpp" -private ["_target", "_tourniquetItem", "_part", "_tourniquets", "_applyingTo", "_selectionName"]; -_target = _this select 0; -_tourniquetItem = _this select 1; -_selectionName = _this select 2; +private ["_tourniquetItem", "_part", "_applyingTo"]; +params ["_target", "_tourniquets", "_selectionName"]; [_target] call FUNC(addToInjuredCollection); @@ -29,24 +27,21 @@ _tourniquets set[_part, _applyingTo]; _target setvariable [QGVAR(tourniquets), _tourniquets, true]; [{ - private ["_args","_target","_applyingTo","_part", "_tourniquets", "_time"]; - _args = _this select 0; - _target = _args select 0; - _applyingTo = _args select 1; - _part = _args select 2; - _time = _args select 3; + params ["_args", "_idPFH"]; + _args params ["_target", "_applyingTo", "_part", "_time"]; + if (!alive _target) exitwith { - [(_this select 1)] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; }; _tourniquets = _target getvariable [QGVAR(tourniquets), [0,0,0,0,0,0]]; if !((_tourniquets select _part) == _applyingTo) exitwith { // Tourniquet has been removed - [(_this select 1)] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; }; if (ACE_time - _time > 120) then { _target setvariable [QGVAR(pain), (_target getvariable [QGVAR(pain), 0]) + 0.005]; }; }, 5, [_target, _applyingTo, _part, ACE_time] ] call CBA_fnc_addPerFrameHandler; -true; +true diff --git a/addons/medical/functions/fnc_treatment_failure.sqf b/addons/medical/functions/fnc_treatment_failure.sqf index 8a5d784301..483a8923eb 100644 --- a/addons/medical/functions/fnc_treatment_failure.sqf +++ b/addons/medical/functions/fnc_treatment_failure.sqf @@ -10,21 +10,16 @@ * 4: Items available > * * Return Value: - * nil + * None * * Public: No */ #include "script_component.hpp" -private ["_args", "_caller", "_target","_selectionName","_className","_config","_callback", "_usersOfItems", "_weaponSelect", "_lastAnim"]; - -_args = _this select 0; -_caller = _args select 0; -_target = _args select 1; -_selectionName = _args select 2; -_className = _args select 3; -_usersOfItems = _args select 5; +private ["_config", "_callback", "_weaponSelect", "_lastAnim"]; +params ["_args"]; +_args params ["_caller", "_target", "_selectionName", "_className", "_usersOfItems"]; if (primaryWeapon _caller == "ACE_FakePrimaryWeapon") then { _caller removeWeapon "ACE_FakePrimaryWeapon"; @@ -33,14 +28,15 @@ if (vehicle _caller == _caller) then { _lastAnim = _caller getvariable [QGVAR(treatmentPrevAnimCaller), ""]; //Don't play another medic animation (when player is rapidily treating) TRACE_2("Reseting to old animation", animationState player, _lastAnim); - switch (true) do { - case (_lastAnim == "AinvPknlMstpSlayWrflDnon_medic"): {_lastAnim = "AmovPknlMstpSrasWrflDnon"}; - case (_lastAnim == "AinvPpneMstpSlayWrflDnon_medic"): {_lastAnim = "AmovPpneMstpSrasWrflDnon"}; - case (_lastAnim == "AinvPknlMstpSlayWnonDnon_medic"): {_lastAnim = "AmovPknlMstpSnonWnonDnon"}; - case (_lastAnim == "AinvPpneMstpSlayWpstDnon_medic"): {_lastAnim = "AinvPpneMstpSlayWpstDnon"}; - case (_lastAnim == "AinvPknlMstpSlayWpstDnon_medic"): {_lastAnim = "AmovPknlMstpSrasWpstDnon"}; + switch _lastAnim do { + case "AinvPknlMstpSlayWrflDnon_medic": {_lastAnim = "AmovPknlMstpSrasWrflDnon"}; + case "AinvPpneMstpSlayWrflDnon_medic": {_lastAnim = "AmovPpneMstpSrasWrflDnon"}; + case "AinvPknlMstpSlayWnonDnon_medic": {_lastAnim = "AmovPknlMstpSnonWnonDnon"}; + case "AinvPpneMstpSlayWpstDnon_medic": {_lastAnim = "AinvPpneMstpSlayWpstDnon"}; + case "AinvPknlMstpSlayWpstDnon_medic": {_lastAnim = "AmovPknlMstpSrasWpstDnon"}; }; [_caller, _lastAnim, 1] call EFUNC(common,doAnimation); + [_caller, _lastAnim, 1] call EFUNC(common,doAnimation); }; _caller setvariable [QGVAR(treatmentPrevAnimCaller), nil]; @@ -57,8 +53,9 @@ if ((_weaponSelect params [["_previousWeapon", ""]]) && {(_previousWeapon != "") }; { - (_x select 0) addItem (_x select 1); -}foreach _usersOfItems; + _x params ["_unit", "_item"]; + _unit addItem _item; +} foreach _usersOfItems; // Record specific callback _config = (configFile >> "ACE_Medical_Actions" >> "Basic" >> _className); @@ -67,10 +64,10 @@ if (GVAR(level) >= 2) then { }; _callback = getText (_config >> "callbackFailure"); -if (isNil _callback) then { - _callback = compile _callback; +_callback = if (isNil _callback) then { + compile _callback } else { - _callback = missionNamespace getvariable _callback; + missionNamespace getvariable _callback }; _args call _callback; diff --git a/addons/medical/functions/fnc_treatment_success.sqf b/addons/medical/functions/fnc_treatment_success.sqf index f5cb9baf71..0ba34d5a85 100644 --- a/addons/medical/functions/fnc_treatment_success.sqf +++ b/addons/medical/functions/fnc_treatment_success.sqf @@ -10,19 +10,16 @@ * 4: Items available > * * Return Value: - * nil + * None * * Public: No */ #include "script_component.hpp" -private ["_args", "_caller", "_target","_selectionName","_className","_config","_callback", "_weaponSelect", "_lastAnim"]; -_args = _this select 0; -_caller = _args select 0; -_target = _args select 1; -_selectionName = _args select 2; -_className = _args select 3; +private ["_config", "_callback", "_weaponSelect", "_lastAnim"]; +params ["_args"]; +_args params ["_caller", "_target","_selectionName","_className"]; if (primaryWeapon _caller == "ACE_FakePrimaryWeapon") then { _caller removeWeapon "ACE_FakePrimaryWeapon"; @@ -31,12 +28,12 @@ if (vehicle _caller == _caller) then { _lastAnim = _caller getvariable [QGVAR(treatmentPrevAnimCaller), ""]; //Don't play another medic animation (when player is rapidily treating) TRACE_2("Reseting to old animation", animationState player, _lastAnim); - switch (true) do { - case (_lastAnim == "AinvPknlMstpSlayWrflDnon_medic"): {_lastAnim = "AmovPknlMstpSrasWrflDnon"}; - case (_lastAnim == "AinvPpneMstpSlayWrflDnon_medic"): {_lastAnim = "AmovPpneMstpSrasWrflDnon"}; - case (_lastAnim == "AinvPknlMstpSlayWnonDnon_medic"): {_lastAnim = "AmovPknlMstpSnonWnonDnon"}; - case (_lastAnim == "AinvPpneMstpSlayWpstDnon_medic"): {_lastAnim = "AinvPpneMstpSlayWpstDnon"}; - case (_lastAnim == "AinvPknlMstpSlayWpstDnon_medic"): {_lastAnim = "AmovPknlMstpSrasWpstDnon"}; + switch _lastAnim do { + case "AinvPknlMstpSlayWrflDnon_medic": {_lastAnim = "AmovPknlMstpSrasWrflDnon"}; + case "AinvPpneMstpSlayWrflDnon_medic": {_lastAnim = "AmovPpneMstpSrasWrflDnon"}; + case "AinvPknlMstpSlayWnonDnon_medic": {_lastAnim = "AmovPknlMstpSnonWnonDnon"}; + case "AinvPpneMstpSlayWpstDnon_medic": {_lastAnim = "AinvPpneMstpSlayWpstDnon"}; + case "AinvPknlMstpSlayWpstDnon_medic": {_lastAnim = "AmovPknlMstpSrasWpstDnon"}; }; [_caller, _lastAnim, 1] call EFUNC(common,doAnimation); }; diff --git a/addons/medical/functions/fnc_unconsciousPFH.sqf b/addons/medical/functions/fnc_unconsciousPFH.sqf index c66f6863c8..f230b9dbf8 100644 --- a/addons/medical/functions/fnc_unconsciousPFH.sqf +++ b/addons/medical/functions/fnc_unconsciousPFH.sqf @@ -13,21 +13,15 @@ * 1: PFEH ID * * ReturnValue: - * nil + * None * * Public: yes */ - #include "script_component.hpp" private ["_unit", "_minWaitingTime", "_slotInfo", "_hasMovedOut", "_parachuteCheck", "_args", "_originalPos", "_startingTime", "_awakeInVehicleAnimation", "_oldVehicleAnimation", "_vehicle"]; -_args = _this select 0; -_unit = _args select 0; -_originalPos = _args select 1; -_startingTime = _args select 2; -_minWaitingTime = _args select 3; -_hasMovedOut = _args select 4; -_parachuteCheck = _args select 5; +params ["_args", "_idPFH"]; +_args params ["_unit", "_originalPos", "_startingTime", "_minWaitingTime", "_hasMovedOut", "_parachuteCheck"]; if (!alive _unit) exitwith { if ("ACE_FakePrimaryWeapon" in (weapons _unit)) then { @@ -45,7 +39,7 @@ if (!alive _unit) exitwith { [_unit, "isUnconscious"] call EFUNC(common,unmuteUnit); ["medical_onUnconscious", [_unit, false]] call EFUNC(common,globalEvent); - [(_this select 1)] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; }; // In case the unit is no longer in an unconscious state, we are going to check if we can already reset the animation @@ -57,7 +51,7 @@ if !(_unit getvariable ["ACE_isUnconscious",false]) exitwith { TRACE_1("Removing fake weapon [on wakeup]",_unit); _unit removeWeapon "ACE_FakePrimaryWeapon"; }; - + if (vehicle _unit == _unit) then { if (animationState _unit == "AinjPpneMstpSnonWrflDnon") then { [_unit,"AinjPpneMstpSnonWrflDnon_rolltofront", 2] call EFUNC(common,doAnimation); @@ -99,7 +93,7 @@ if !(_unit getvariable ["ACE_isUnconscious",false]) exitwith { ["medical_onUnconscious", [_unit, false]] call EFUNC(common,globalEvent); // EXIT PFH - [(_this select 1)] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; }; if (!_hasMovedOut) then { // Reset the unit back to the previous captive state. @@ -132,7 +126,7 @@ if (_parachuteCheck) then { if (!local _unit) exitwith { _args set [3, _minWaitingTime - (ACE_time - _startingTime)]; _unit setvariable [QGVAR(unconsciousArguments), _args, true]; - [(_this select 1)] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; }; // Ensure we are waiting at least a minimum period before checking if we can wake up the unit again, allows for temp knock outs diff --git a/addons/medical/functions/fnc_useItem.sqf b/addons/medical/functions/fnc_useItem.sqf index 750ea0452f..770d8b6ea7 100644 --- a/addons/medical/functions/fnc_useItem.sqf +++ b/addons/medical/functions/fnc_useItem.sqf @@ -8,17 +8,16 @@ * 2: Item * * ReturnValue: - * + * 0: success + * 1: Unit * * Public: Yes */ #include "script_component.hpp" -private ["_medic", "_patient", "_item", "_return","_crew"]; -_medic = _this select 0; -_patient = _this select 1; -_item = _this select 2; +private ["_return","_crew"]; +params ["_medic", "_patient", "_item"]; if (isnil QGVAR(setting_allowSharedEquipment)) then { GVAR(setting_allowSharedEquipment) = true; @@ -42,7 +41,7 @@ if ([vehicle _medic] call FUNC(isMedicalVehicle) && {vehicle _medic != _medic}) _return = [true, _x]; [[_x, _item], QUOTE(EFUNC(common,useItem)), _x] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ }; - }foreach _crew; + } foreach _crew; }; -_return; +_return diff --git a/addons/medical/functions/fnc_useItems.sqf b/addons/medical/functions/fnc_useItems.sqf index fbaa324022..0d937c0938 100644 --- a/addons/medical/functions/fnc_useItems.sqf +++ b/addons/medical/functions/fnc_useItems.sqf @@ -8,7 +8,7 @@ * 2: Items > * * ReturnValue: - * + * None * * Public: Yes */ @@ -16,9 +16,7 @@ #include "script_component.hpp" private ["_medic", "_patient", "_items", "_itemUsedInfo", "_itemsUsedBy"]; -_medic = _this select 0; -_patient = _this select 1; -_items = _this select 2; +params ["_medic", "_patient", "_items"]; _itemsUsedBy = []; { @@ -27,7 +25,7 @@ _itemsUsedBy = []; { _itemUsedInfo = [_medic, _patient, _x] call FUNC(useItem); if (_itemUsedInfo select 0) exitwith { _itemsUsedBy pushback [(_itemUsedInfo select 1), _x]}; - }foreach _x; + } foreach _x; }; // handle required item @@ -35,6 +33,6 @@ _itemsUsedBy = []; _itemUsedInfo = [_medic, _patient, _x] call FUNC(useItem); if (_itemUsedInfo select 0) exitwith { _itemsUsedBy pushback [(_itemUsedInfo select 1), _x]}; }; -}foreach _items; +} foreach _items; [count _items == count _itemsUsedBy, _itemsUsedBy]; From fab4c6a67f8a462684e77e45cfbde79750e52f0e Mon Sep 17 00:00:00 2001 From: jokoho48 Date: Sat, 22 Aug 2015 21:32:36 +0200 Subject: [PATCH 018/132] fix Spelling Issues --- addons/medical/functions/fnc_actionLoadUnit.sqf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/medical/functions/fnc_actionLoadUnit.sqf b/addons/medical/functions/fnc_actionLoadUnit.sqf index 0340da2e20..9dc711a5a7 100644 --- a/addons/medical/functions/fnc_actionLoadUnit.sqf +++ b/addons/medical/functions/fnc_actionLoadUnit.sqf @@ -21,10 +21,10 @@ if ([_target] call EFUNC(common,isAwake)) exitwith { ["displayTextStructured", [_caller], [[localize LSTRING(CanNotLoaded), [_target] call EFUNC(common,getName)], 1.5, _caller]] call EFUNC(common,targetEvent); }; if ([_target] call FUNC(isBeingCarried)) then { - ["_caller", "_target"] call EFUNC(dragging,dropObject_carry); + [_caller, _target] call EFUNC(dragging,dropObject_carry); }; if ([_target] call FUNC(isBeingDragged)) then { - ["_caller", "_target"] call EFUNC(dragging,dropObject); + [_caller, _target] call EFUNC(dragging,dropObject); }; -_vehicle = ["_caller", "_target"] call EFUNC(common,loadPerson); +_vehicle = [_caller, _target] call EFUNC(common,loadPerson); From 260b048da4e179923b537a9445e0b9ac36753a90 Mon Sep 17 00:00:00 2001 From: jokoho48 Date: Sun, 23 Aug 2015 14:13:55 +0200 Subject: [PATCH 019/132] some more Improvements --- addons/medical/functions/fnc_actionCheckResponse.sqf | 6 +----- addons/medical/functions/fnc_setHitPointDamage.sqf | 4 ++-- addons/medical/functions/fnc_treatment_failure.sqf | 12 ++++++------ addons/medical/functions/fnc_treatment_success.sqf | 12 ++++++------ 4 files changed, 15 insertions(+), 19 deletions(-) diff --git a/addons/medical/functions/fnc_actionCheckResponse.sqf b/addons/medical/functions/fnc_actionCheckResponse.sqf index 7db4fe0a5d..6910545a9d 100644 --- a/addons/medical/functions/fnc_actionCheckResponse.sqf +++ b/addons/medical/functions/fnc_actionCheckResponse.sqf @@ -17,11 +17,7 @@ private ["_output"]; params ["_caller", "_target"]; -_output = if ([_target] call EFUNC(common,isAwake)) then { - LSTRING(Check_Response_Responsive) -} else { - LSTRING(Check_Response_Unresponsive) -}; +_output = [LSTRING(Check_Response_Unresponsive), LSTRING(Check_Response_Responsive)] select ([_target] call EFUNC(common,isAwake)); ["displayTextStructured", [_caller], [[_output, [_target] call EFUNC(common,getName)], 2, _caller]] call EFUNC(common,targetEvent); diff --git a/addons/medical/functions/fnc_setHitPointDamage.sqf b/addons/medical/functions/fnc_setHitPointDamage.sqf index 1713c02243..f8698a7fe0 100644 --- a/addons/medical/functions/fnc_setHitPointDamage.sqf +++ b/addons/medical/functions/fnc_setHitPointDamage.sqf @@ -22,7 +22,7 @@ #define ARMDAMAGETRESHOLD2 1.7 private ["_unit", "_selection", "_damage", "_selections", "_damages", "_damageOld", "_damageSumOld", "_damageNew", "_damageSumNew", "_damageFinal", "_armdamage", "_legdamage"]; -params ["_unit", "_selection", "_damage", ["_disalbed", false]]; +params ["_unit", "_selection", "_damage", ["_disabled", false]]; // Unit isn't local, give function to machine where it is. if !(local _unit) exitWith { @@ -30,7 +30,7 @@ if !(local _unit) exitWith { }; // Check if overall damage adjustment is disabled -if (_disalbed) exitWith { +if (_disabled) exitWith { _unit setHitPointDamage [_selection, _damage]; }; diff --git a/addons/medical/functions/fnc_treatment_failure.sqf b/addons/medical/functions/fnc_treatment_failure.sqf index 483a8923eb..84526daa88 100644 --- a/addons/medical/functions/fnc_treatment_failure.sqf +++ b/addons/medical/functions/fnc_treatment_failure.sqf @@ -28,12 +28,12 @@ if (vehicle _caller == _caller) then { _lastAnim = _caller getvariable [QGVAR(treatmentPrevAnimCaller), ""]; //Don't play another medic animation (when player is rapidily treating) TRACE_2("Reseting to old animation", animationState player, _lastAnim); - switch _lastAnim do { - case "AinvPknlMstpSlayWrflDnon_medic": {_lastAnim = "AmovPknlMstpSrasWrflDnon"}; - case "AinvPpneMstpSlayWrflDnon_medic": {_lastAnim = "AmovPpneMstpSrasWrflDnon"}; - case "AinvPknlMstpSlayWnonDnon_medic": {_lastAnim = "AmovPknlMstpSnonWnonDnon"}; - case "AinvPpneMstpSlayWpstDnon_medic": {_lastAnim = "AinvPpneMstpSlayWpstDnon"}; - case "AinvPknlMstpSlayWpstDnon_medic": {_lastAnim = "AmovPknlMstpSrasWpstDnon"}; + switch (toLower _lastAnim) do { + case "ainvpknlmstpslaywrfldnon_medic": {_lastAnim = "AmovPknlMstpSrasWrflDnon"}; + case "ainvppnemstpslaywrfldnon_medic": {_lastAnim = "AmovPpneMstpSrasWrflDnon"}; + case "ainvpknlmstpslaywnondnon_medic": {_lastAnim = "AmovPknlMstpSnonWnonDnon"}; + case "ainvppnemstpslaywpstdnon_medic": {_lastAnim = "AinvPpneMstpSlayWpstDnon"}; + case "ainvpknlmstpslaywpstdnon_medic": {_lastAnim = "AmovPknlMstpSrasWpstDnon"}; }; [_caller, _lastAnim, 1] call EFUNC(common,doAnimation); [_caller, _lastAnim, 1] call EFUNC(common,doAnimation); diff --git a/addons/medical/functions/fnc_treatment_success.sqf b/addons/medical/functions/fnc_treatment_success.sqf index 0ba34d5a85..f21f027ee7 100644 --- a/addons/medical/functions/fnc_treatment_success.sqf +++ b/addons/medical/functions/fnc_treatment_success.sqf @@ -28,12 +28,12 @@ if (vehicle _caller == _caller) then { _lastAnim = _caller getvariable [QGVAR(treatmentPrevAnimCaller), ""]; //Don't play another medic animation (when player is rapidily treating) TRACE_2("Reseting to old animation", animationState player, _lastAnim); - switch _lastAnim do { - case "AinvPknlMstpSlayWrflDnon_medic": {_lastAnim = "AmovPknlMstpSrasWrflDnon"}; - case "AinvPpneMstpSlayWrflDnon_medic": {_lastAnim = "AmovPpneMstpSrasWrflDnon"}; - case "AinvPknlMstpSlayWnonDnon_medic": {_lastAnim = "AmovPknlMstpSnonWnonDnon"}; - case "AinvPpneMstpSlayWpstDnon_medic": {_lastAnim = "AinvPpneMstpSlayWpstDnon"}; - case "AinvPknlMstpSlayWpstDnon_medic": {_lastAnim = "AmovPknlMstpSrasWpstDnon"}; + switch (tolower _lastAnim) do { + case "ainvpknlmstpslaywrfldnon_medic": {_lastAnim = "AmovPknlMstpSrasWrflDnon"}; + case "ainvppnemstpslaywrfldnon_medic": {_lastAnim = "AmovPpneMstpSrasWrflDnon"}; + case "ainvpknlmstpslaywnondnon_medic": {_lastAnim = "AmovPknlMstpSnonWnonDnon"}; + case "ainvppnemstpslaywpstdnon_medic": {_lastAnim = "AinvPpneMstpSlayWpstDnon"}; + case "ainvpknlmstpslaywpstdnon_medic": {_lastAnim = "AmovPknlMstpSrasWpstDnon"}; }; [_caller, _lastAnim, 1] call EFUNC(common,doAnimation); }; From ca1b47beb5e52b3c35e0073d0ae2227c977d8a24 Mon Sep 17 00:00:00 2001 From: jonpas Date: Sun, 23 Aug 2015 19:54:55 +0200 Subject: [PATCH 020/132] Use correct module group --- addons/repair/CfgVehicles.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/repair/CfgVehicles.hpp b/addons/repair/CfgVehicles.hpp index 53f1aa7a46..d0f3645678 100644 --- a/addons/repair/CfgVehicles.hpp +++ b/addons/repair/CfgVehicles.hpp @@ -224,7 +224,7 @@ class CfgVehicles { scope = 2; displayName = CSTRING(AddSpareParts_Module_DisplayName); icon = QUOTE(PATHTOF(ui\Icon_Module_Repair_ca.paa)); - category = "ACE"; + category = "ACE_Logistics"; function = QFUNC(moduleAddSpareParts); functionPriority = 10; isGlobal = 0; From f1e5ca24bfdacd7102c577d83b1dced11249e4a9 Mon Sep 17 00:00:00 2001 From: jonpas Date: Wed, 26 Aug 2015 06:11:52 +0200 Subject: [PATCH 021/132] Updated required CBA files --- .../cba/addons/main/script_macros_common.hpp | 1159 ++++++++++------- tools/cba/addons/xeh/init_pre.sqf | 310 ++--- tools/cba/addons/xeh/script_xeh.hpp | 45 +- 3 files changed, 839 insertions(+), 675 deletions(-) diff --git a/tools/cba/addons/main/script_macros_common.hpp b/tools/cba/addons/main/script_macros_common.hpp index 1385d7b389..78893db662 100644 --- a/tools/cba/addons/main/script_macros_common.hpp +++ b/tools/cba/addons/main/script_macros_common.hpp @@ -1,11 +1,11 @@ /* - Header: script_macros_common.hpp + Header: script_macros_common.hpp - Description: - A general set of useful macro functions for use by CBA itself or by any module that uses CBA. + Description: + A general set of useful macro functions for use by CBA itself or by any module that uses CBA. - Authors: - Sickboy and Spooner + Authors: + Sickboy and Spooner */ /* **************************************************** @@ -40,27 +40,27 @@ */ #ifndef MAINPREFIX - #define MAINPREFIX x + #define MAINPREFIX x #endif #ifndef SUBPREFIX - #define SUBPREFIX addons + #define SUBPREFIX addons #endif #ifndef MAINLOGIC - #define MAINLOGIC main + #define MAINLOGIC main #endif #ifndef VERSION - #define VERSION 0 + #define VERSION 0 #endif #ifndef VERSION_AR - #define VERSION_AR VERSION + #define VERSION_AR VERSION #endif #ifndef VERSION_CONFIG - #define VERSION_CONFIG version = VERSION; versionStr = QUOTE(VERSION); versionAr[] = {VERSION_AR} + #define VERSION_CONFIG version = VERSION; versionStr = QUOTE(VERSION); versionAr[] = {VERSION_AR} #endif #define ADDON DOUBLES(PREFIX,COMPONENT) @@ -72,50 +72,50 @@ Group: Debugging /* ------------------------------------------- Macros: DEBUG_MODE_x - Managing debugging based on debug level. + Managing debugging based on debug level. - According to the *highest* level of debugging that has been defined *before* script_macros_common.hpp is included, - only the appropriate debugging commands will be functional. With no level explicitely defined, assume DEBUG_MODE_NORMAL. + According to the *highest* level of debugging that has been defined *before* script_macros_common.hpp is included, + only the appropriate debugging commands will be functional. With no level explicitely defined, assume DEBUG_MODE_NORMAL. - DEBUG_MODE_FULL - Full debugging output. - DEBUG_MODE_NORMAL - All debugging except and (Default setting if none specified). - DEBUG_MODE_MINIMAL - Only and enabled. + DEBUG_MODE_FULL - Full debugging output. + DEBUG_MODE_NORMAL - All debugging except and (Default setting if none specified). + DEBUG_MODE_MINIMAL - Only and enabled. Examples: - In order to turn on full debugging for a single file, - (begin example) - // Top of individual script file. - #define DEBUG_MODE_FULL - #include "script_component.hpp" - (end) + In order to turn on full debugging for a single file, + (begin example) + // Top of individual script file. + #define DEBUG_MODE_FULL + #include "script_component.hpp" + (end) - In order to force minimal debugging for a single component, - (begin example) - // Top of addons\\script_component.hpp - // Ensure that any FULL and NORMAL setting from the individual files are undefined and MINIMAL is set. - #ifdef DEBUG_MODE_FULL - #undef DEBUG_MODE_FULL - #endif - #ifdef DEBUG_MODE_NORMAL - #undef DEBUG_MODE_NORMAL - #endif - #ifndef DEBUG_MODE_MINIMAL - #define DEBUG_MODE_MINIMAL - #endif - #include "script_macros.hpp" - (end) + In order to force minimal debugging for a single component, + (begin example) + // Top of addons\\script_component.hpp + // Ensure that any FULL and NORMAL setting from the individual files are undefined and MINIMAL is set. + #ifdef DEBUG_MODE_FULL + #undef DEBUG_MODE_FULL + #endif + #ifdef DEBUG_MODE_NORMAL + #undef DEBUG_MODE_NORMAL + #endif + #ifndef DEBUG_MODE_MINIMAL + #define DEBUG_MODE_MINIMAL + #endif + #include "script_macros.hpp" + (end) - In order to turn on full debugging for a whole addon, - (begin example) - // Top of addons\main\script_macros.hpp - #ifndef DEBUG_MODE_FULL - #define DEBUG_MODE_FULL - #endif - #include "\x\cba\addons\main\script_macros_common.hpp" - (end) + In order to turn on full debugging for a whole addon, + (begin example) + // Top of addons\main\script_macros.hpp + #ifndef DEBUG_MODE_FULL + #define DEBUG_MODE_FULL + #endif + #include "\x\cba\addons\main\script_macros_common.hpp" + (end) Author: - Spooner + Spooner ------------------------------------------- */ // If DEBUG_MODE_FULL, then also enable DEBUG_MODE_NORMAL. @@ -142,20 +142,20 @@ Author: /* ------------------------------------------- Macro: LOG() - Log a timestamped message into the RPT log. + Log a timestamped message into the RPT log. - Only run if or higher is defined. + Only run if or higher is defined. Parameters: - MESSAGE - Message to record [String] + MESSAGE - Message to record [String] Example: - (begin example) - LOG("Initiated clog-dancing simulator."); - (end) + (begin example) + LOG("Initiated clog-dancing simulator."); + (end) Author: - Spooner + Spooner ------------------------------------------- */ #ifdef DEBUG_MODE_FULL #define LOG(MESSAGE) [THIS_FILE_, __LINE__, MESSAGE] call CBA_fnc_log @@ -165,20 +165,20 @@ Author: /* ------------------------------------------- Macro: WARNING() - Record a timestamped, non-critical error in the RPT log. + Record a timestamped, non-critical error in the RPT log. - Only run if or higher is defined. + Only run if or higher is defined. Parameters: - MESSAGE - Message to record [String] + MESSAGE - Message to record [String] Example: - (begin example) - WARNING("This function has been deprecated. Please don't use it in future!"); - (end) + (begin example) + WARNING("This function has been deprecated. Please don't use it in future!"); + (end) Author: - Spooner + Spooner ------------------------------------------- */ #ifdef DEBUG_MODE_NORMAL #define WARNING(MESSAGE) [THIS_FILE_, __LINE__, ('WARNING: ' + MESSAGE)] call CBA_fnc_log @@ -188,152 +188,171 @@ Author: /* ------------------------------------------- Macro: ERROR() - Record a timestamped, critical error in the RPT log. + Record a timestamped, critical error in the RPT log. - The heading is "ERROR" (use for a specific title). + The heading is "ERROR" (use for a specific title). - TODO: Popup an error dialog & throw an exception. + TODO: Popup an error dialog & throw an exception. Parameters: - MESSAGE - Message to record [String] + MESSAGE - Message to record [String] Example: - (begin example) - ERROR("Value not found","value of frog not found in config ...yada...yada..."); - (end) + (begin example) + ERROR("Value not found","value of frog not found in config ...yada...yada..."); + (end) Author: - Spooner + Spooner ------------------------------------------- */ #define ERROR(MESSAGE) \ - [THIS_FILE_, __LINE__, "ERROR", MESSAGE] call CBA_fnc_error; + [THIS_FILE_, __LINE__, "ERROR", MESSAGE] call CBA_fnc_error; /* ------------------------------------------- Macro: ERROR_WITH_TITLE() - Record a timestamped, critical error in the RPT log. + Record a timestamped, critical error in the RPT log. - The title can be specified (in the heading is always just "ERROR") - Newlines (\n) in the MESSAGE will be put on separate lines. + The title can be specified (in the heading is always just "ERROR") + Newlines (\n) in the MESSAGE will be put on separate lines. - TODO: Popup an error dialog & throw an exception. + TODO: Popup an error dialog & throw an exception. Parameters: - TITLE - Title of error message [String] - MESSAGE - Body of error message [String] + TITLE - Title of error message [String] + MESSAGE - Body of error message [String] Example: - (begin example) - ERROR_WITH_TITLE("Value not found","Value of frog not found in config ...yada...yada..."); - (end) + (begin example) + ERROR_WITH_TITLE("Value not found","Value of frog not found in config ...yada...yada..."); + (end) Author: - Spooner + Spooner ------------------------------------------- */ #define ERROR_WITH_TITLE(TITLE,MESSAGE) \ - [THIS_FILE_, __LINE__, TITLE, MESSAGE] call CBA_fnc_error; + [THIS_FILE_, __LINE__, TITLE, MESSAGE] call CBA_fnc_error; + +/* ------------------------------------------- +Macro: MESSAGE_WITH_TITLE() + Record a single line, timestamped log entry in the RPT log. + +Parameters: + TITLE - Title of log message [String] + MESSAGE - Body of message [String] + +Example: + (begin example) + MESSAGE_WITH_TITLE("Value found","Value of frog found in config "); + (end) + +Author: + Killswitch +------------------------------------------- */ +#define MESSAGE_WITH_TITLE(TITLE,MESSAGE) \ + [THIS_FILE_, __LINE__, TITLE + ': ' + (MESSAGE)] call CBA_fnc_log; /* ------------------------------------------- Macro: RETNIL() - If a variable is undefined, return the value nil. Otherwise, return the - variable itself. + If a variable is undefined, return the value nil. Otherwise, return the + variable itself. Parameters: - VARIABLE - the variable to check + VARIABLE - the variable to check Example: - (begin example) - // _var is undefined - hintSilent format ["_var=%1", RETNIL(_var) ]; // "_var=any" - (end example) + (begin example) + // _var is undefined + hintSilent format ["_var=%1", RETNIL(_var) ]; // "_var=any" + (end example) Author: - Alef (see CBA issue #8514) + Alef (see CBA issue #8514) ------------------------------------------- */ #define RETNIL(VARIABLE) if (isNil{VARIABLE}) then {nil} else {VARIABLE} /* ------------------------------------------- Macros: TRACE_n() - Log a message and 1-8 variables to the RPT log. + Log a message and 1-8 variables to the RPT log. - Only run if is defined. + Only run if is defined. - TRACE_1(MESSAGE,A) - Log 1 variable. - TRACE_2(MESSAGE,A,B) - Log 2 variables. - TRACE_3(MESSAGE,A,B,C) - Log 3 variables. - TRACE_4(MESSAGE,A,B,C,D) - Log 4 variables. - TRACE_5(MESSAGE,A,B,C,D,E) - Log 5 variables. - TRACE_6(MESSAGE,A,B,C,D,E,F) - Log 6 variables. - TRACE_7(MESSAGE,A,B,C,D,E,F,G) - Log 7 variables. - TRACE_8(MESSAGE,A,B,C,D,E,F,G,H) - Log 8 variables. - TRACE_9(MESSAGE,A,B,C,D,E,F,G,H,I) - Log 9 variables. + TRACE_1(MESSAGE,A) - Log 1 variable. + TRACE_2(MESSAGE,A,B) - Log 2 variables. + TRACE_3(MESSAGE,A,B,C) - Log 3 variables. + TRACE_4(MESSAGE,A,B,C,D) - Log 4 variables. + TRACE_5(MESSAGE,A,B,C,D,E) - Log 5 variables. + TRACE_6(MESSAGE,A,B,C,D,E,F) - Log 6 variables. + TRACE_7(MESSAGE,A,B,C,D,E,F,G) - Log 7 variables. + TRACE_8(MESSAGE,A,B,C,D,E,F,G,H) - Log 8 variables. + TRACE_9(MESSAGE,A,B,C,D,E,F,G,H,I) - Log 9 variables. Parameters: - MESSAGE - Message to add to the trace [String] - A..H - Variable names to log values of [Any] + MESSAGE - Message to add to the trace [String] + A..H - Variable names to log values of [Any] Example: - (begin example) - TRACE_3("After takeoff",_vehicle player,getPos (_vehicle player), getPosASL (_vehicle player)); - (end) + (begin example) + TRACE_3("After takeoff",_vehicle player,getPos (_vehicle player), getPosASL (_vehicle player)); + (end) Author: - Spooner + Spooner ------------------------------------------- */ #define PFORMAT_1(MESSAGE,A) \ - format ['%1: A=%2', MESSAGE, RETNIL(A)] + format ['%1: A=%2', MESSAGE, RETNIL(A)] #define PFORMAT_2(MESSAGE,A,B) \ - format ['%1: A=%2, B=%3', MESSAGE, RETNIL(A), RETNIL(B)] + format ['%1: A=%2, B=%3', MESSAGE, RETNIL(A), RETNIL(B)] #define PFORMAT_3(MESSAGE,A,B,C) \ - format ['%1: A=%2, B=%3, C=%4', MESSAGE, RETNIL(A), RETNIL(B), RETNIL(C)] + format ['%1: A=%2, B=%3, C=%4', MESSAGE, RETNIL(A), RETNIL(B), RETNIL(C)] #define PFORMAT_4(MESSAGE,A,B,C,D) \ - format ['%1: A=%2, B=%3, C=%4, D=%5', MESSAGE, RETNIL(A), RETNIL(B), RETNIL(C), RETNIL(D)] + format ['%1: A=%2, B=%3, C=%4, D=%5', MESSAGE, RETNIL(A), RETNIL(B), RETNIL(C), RETNIL(D)] #define PFORMAT_5(MESSAGE,A,B,C,D,E) \ - format ['%1: A=%2, B=%3, C=%4, D=%5, E=%6', MESSAGE, RETNIL(A), RETNIL(B), RETNIL(C), RETNIL(D), RETNIL(E)] + format ['%1: A=%2, B=%3, C=%4, D=%5, E=%6', MESSAGE, RETNIL(A), RETNIL(B), RETNIL(C), RETNIL(D), RETNIL(E)] #define PFORMAT_6(MESSAGE,A,B,C,D,E,F) \ - format ['%1: A=%2, B=%3, C=%4, D=%5, E=%6, F=%7', MESSAGE, RETNIL(A), RETNIL(B), RETNIL(C), RETNIL(D), RETNIL(E), RETNIL(F)] + format ['%1: A=%2, B=%3, C=%4, D=%5, E=%6, F=%7', MESSAGE, RETNIL(A), RETNIL(B), RETNIL(C), RETNIL(D), RETNIL(E), RETNIL(F)] #define PFORMAT_7(MESSAGE,A,B,C,D,E,F,G) \ - format ['%1: A=%2, B=%3, C=%4, D=%5, E=%6, F=%7, G=%8', MESSAGE, RETNIL(A), RETNIL(B), RETNIL(C), RETNIL(D), RETNIL(E), RETNIL(F), RETNIL(G)] + format ['%1: A=%2, B=%3, C=%4, D=%5, E=%6, F=%7, G=%8', MESSAGE, RETNIL(A), RETNIL(B), RETNIL(C), RETNIL(D), RETNIL(E), RETNIL(F), RETNIL(G)] #define PFORMAT_8(MESSAGE,A,B,C,D,E,F,G,H) \ - format ['%1: A=%2, B=%3, C=%4, D=%5, E=%6, F=%7, G=%8, H=%9', MESSAGE, RETNIL(A), RETNIL(B), RETNIL(C), RETNIL(D), RETNIL(E), RETNIL(F), RETNIL(G), RETNIL(H)] + format ['%1: A=%2, B=%3, C=%4, D=%5, E=%6, F=%7, G=%8, H=%9', MESSAGE, RETNIL(A), RETNIL(B), RETNIL(C), RETNIL(D), RETNIL(E), RETNIL(F), RETNIL(G), RETNIL(H)] #define PFORMAT_9(MESSAGE,A,B,C,D,E,F,G,H,I) \ - format ['%1: A=%2, B=%3, C=%4, D=%5, E=%6, F=%7, G=%8, H=%9, I=%10', MESSAGE, RETNIL(A), RETNIL(B), RETNIL(C), RETNIL(D), RETNIL(E), RETNIL(F), RETNIL(G), RETNIL(H), RETNIL(I)] + format ['%1: A=%2, B=%3, C=%4, D=%5, E=%6, F=%7, G=%8, H=%9, I=%10', MESSAGE, RETNIL(A), RETNIL(B), RETNIL(C), RETNIL(D), RETNIL(E), RETNIL(F), RETNIL(G), RETNIL(H), RETNIL(I)] #ifdef DEBUG_MODE_FULL #define TRACE_1(MESSAGE,A) \ - [THIS_FILE_, __LINE__, PFORMAT_1(MESSAGE,A)] call CBA_fnc_log + [THIS_FILE_, __LINE__, PFORMAT_1(MESSAGE,A)] call CBA_fnc_log #define TRACE_2(MESSAGE,A,B) \ - [THIS_FILE_, __LINE__, PFORMAT_2(MESSAGE,A,B)] call CBA_fnc_log + [THIS_FILE_, __LINE__, PFORMAT_2(MESSAGE,A,B)] call CBA_fnc_log #define TRACE_3(MESSAGE,A,B,C) \ - [THIS_FILE_, __LINE__, PFORMAT_3(MESSAGE,A,B,C)] call CBA_fnc_log + [THIS_FILE_, __LINE__, PFORMAT_3(MESSAGE,A,B,C)] call CBA_fnc_log #define TRACE_4(MESSAGE,A,B,C,D) \ - [THIS_FILE_, __LINE__, PFORMAT_4(MESSAGE,A,B,C,D)] call CBA_fnc_log + [THIS_FILE_, __LINE__, PFORMAT_4(MESSAGE,A,B,C,D)] call CBA_fnc_log #define TRACE_5(MESSAGE,A,B,C,D,E) \ - [THIS_FILE_, __LINE__, PFORMAT_5(MESSAGE,A,B,C,D,E)] call CBA_fnc_log + [THIS_FILE_, __LINE__, PFORMAT_5(MESSAGE,A,B,C,D,E)] call CBA_fnc_log #define TRACE_6(MESSAGE,A,B,C,D,E,F) \ - [THIS_FILE_, __LINE__, PFORMAT_6(MESSAGE,A,B,C,D,E,F)] call CBA_fnc_log + [THIS_FILE_, __LINE__, PFORMAT_6(MESSAGE,A,B,C,D,E,F)] call CBA_fnc_log #define TRACE_7(MESSAGE,A,B,C,D,E,F,G) \ - [THIS_FILE_, __LINE__, PFORMAT_7(MESSAGE,A,B,C,D,E,F,G)] call CBA_fnc_log + [THIS_FILE_, __LINE__, PFORMAT_7(MESSAGE,A,B,C,D,E,F,G)] call CBA_fnc_log #define TRACE_8(MESSAGE,A,B,C,D,E,F,G,H) \ - [THIS_FILE_, __LINE__, PFORMAT_8(MESSAGE,A,B,C,D,E,F,G,H)] call CBA_fnc_log + [THIS_FILE_, __LINE__, PFORMAT_8(MESSAGE,A,B,C,D,E,F,G,H)] call CBA_fnc_log #define TRACE_9(MESSAGE,A,B,C,D,E,F,G,H,I) \ - [THIS_FILE_, __LINE__, PFORMAT_9(MESSAGE,A,B,C,D,E,F,G,H,I)] call CBA_fnc_log + [THIS_FILE_, __LINE__, PFORMAT_9(MESSAGE,A,B,C,D,E,F,G,H,I)] call CBA_fnc_log #else @@ -360,37 +379,37 @@ Group: General #define QUOTE(var1) #var1 #ifdef MODULAR - #define COMPONENT_T DOUBLES(t,COMPONENT) - #define COMPONENT_M DOUBLES(m,COMPONENT) - #define COMPONENT_S DOUBLES(s,COMPONENT) - #define COMPONENT_C DOUBLES(c,COMPONENT) - #define COMPONENT_F COMPONENT_C + #define COMPONENT_T DOUBLES(t,COMPONENT) + #define COMPONENT_M DOUBLES(m,COMPONENT) + #define COMPONENT_S DOUBLES(s,COMPONENT) + #define COMPONENT_C DOUBLES(c,COMPONENT) + #define COMPONENT_F COMPONENT_C #else - #define COMPONENT_T COMPONENT - #define COMPONENT_M COMPONENT - #define COMPONENT_S COMPONENT - #define COMPONENT_F COMPONENT - #define COMPONENT_C COMPONENT + #define COMPONENT_T COMPONENT + #define COMPONENT_M COMPONENT + #define COMPONENT_S COMPONENT + #define COMPONENT_F COMPONENT + #define COMPONENT_C COMPONENT #endif /* ------------------------------------------- Macro: INC() Description: - Increase a number by one. + Increase a number by one. Parameters: - VAR - Variable to increment [Number] + VAR - Variable to increment [Number] Example: - (begin example) - _counter = 0; - INC(_counter); - // _counter => 1 - (end) + (begin example) + _counter = 0; + INC(_counter); + // _counter => 1 + (end) Author: - Spooner + Spooner ------------------------------------------- */ #define INC(var) var = (var) + 1 @@ -398,20 +417,20 @@ Author: Macro: DEC() Description: - Decrease a number by one. + Decrease a number by one. Parameters: - VAR - Variable to decrement [Number] + VAR - Variable to decrement [Number] Example: - (begin example) - _counter = 99; - DEC(_counter); - // _counter => 98 - (end) + (begin example) + _counter = 99; + DEC(_counter); + // _counter => 98 + (end) Author: - Spooner + Spooner ------------------------------------------- */ #define DEC(var) var = (var) - 1 @@ -419,27 +438,27 @@ Author: Macro: ADD() Description: - Add a value to a variable. Variable and value should be both Numbers or both Strings. + Add a value to a variable. Variable and value should be both Numbers or both Strings. Parameters: - VAR - Variable to add to [Number or String] - VALUE - Value to add [Number or String] + VAR - Variable to add to [Number or String] + VALUE - Value to add [Number or String] Examples: - (begin example) - _counter = 2; - ADD(_counter,3); - // _counter => 5 - (end) - (begin example) - _str = "hello"; - ADD(_str," "); - ADD(_str,"Fred"); - // _str => "hello Fred" - (end) + (begin example) + _counter = 2; + ADD(_counter,3); + // _counter => 5 + (end) + (begin example) + _str = "hello"; + ADD(_str," "); + ADD(_str,"Fred"); + // _str => "hello Fred" + (end) Author: - Sickboy + Sickboy ------------------------------------------- */ #define ADD(var1,var2) var1 = (var1) + (var2) @@ -447,18 +466,18 @@ Author: Macro: SUB() Description: - Subtract a value from a number variable. VAR and VALUE should both be Numbers. + Subtract a value from a number variable. VAR and VALUE should both be Numbers. Parameters: - VAR - Variable to subtract from [Number] - VALUE - Value to subtract [Number] + VAR - Variable to subtract from [Number] + VALUE - Value to subtract [Number] Examples: - (begin example) - _numChickens = 2; - SUB(_numChickens,3); - // _numChickens => -1 - (end) + (begin example) + _numChickens = 2; + SUB(_numChickens,3); + // _numChickens => -1 + (end) ------------------------------------------- */ #define SUB(var1,var2) var1 = (var1) - (var2) @@ -466,24 +485,24 @@ Examples: Macro: REM() Description: - Remove an element from an array each time it occurs. + Remove an element from an array each time it occurs. - This recreates the entire array, so use BIS_fnc_removeIndex if modification of the original array is required - or if only one of the elements that matches ELEMENT needs to be removed. + This recreates the entire array, so use BIS_fnc_removeIndex if modification of the original array is required + or if only one of the elements that matches ELEMENT needs to be removed. Parameters: - ARRAY - Array to modify [Array] - ELEMENT - Element to remove [Any] + ARRAY - Array to modify [Array] + ELEMENT - Element to remove [Any] Examples: - (begin example) - _array = [1, 2, 3, 4, 3, 8]; - REM(_array,3); - // _array = [1, 2, 4, 8]; - (end) + (begin example) + _array = [1, 2, 3, 4, 3, 8]; + REM(_array,3); + // _array = [1, 2, 4, 8]; + (end) Author: - Spooner + Spooner ------------------------------------------- */ #define REM(var1,var2) SUB(var1,[var2]) @@ -491,21 +510,21 @@ Author: Macro: PUSH() Description: - Appends a single value onto the end of an ARRAY. Change is made to the ARRAY itself, not creating a new array. + Appends a single value onto the end of an ARRAY. Change is made to the ARRAY itself, not creating a new array. Parameters: - ARRAY - Array to push element onto [Array] - ELEMENT - Element to push [Any] + ARRAY - Array to push element onto [Array] + ELEMENT - Element to push [Any] Examples: - (begin example) - _fish = ["blue", "green", "smelly"]; - PUSH(_fish,"monkey-flavoured"); - // _fish => ["blue", "green", "smelly", "monkey-flavoured"] - (end) + (begin example) + _fish = ["blue", "green", "smelly"]; + PUSH(_fish,"monkey-flavoured"); + // _fish => ["blue", "green", "smelly", "monkey-flavoured"] + (end) Author: - Spooner + Spooner ------------------------------------------- */ #define PUSH(var1,var2) (var1) pushBack (var2) @@ -513,27 +532,27 @@ Author: Macro: ISNILS() Description: - Sets a variable with a value, but only if it is undefined. + Sets a variable with a value, but only if it is undefined. Parameters: - VARIABLE - Variable to set [Any, not nil] - DEFAULT_VALUE - Value to set VARIABLE to if it is undefined [Any, not nil] + VARIABLE - Variable to set [Any, not nil] + DEFAULT_VALUE - Value to set VARIABLE to if it is undefined [Any, not nil] Examples: - (begin example) - // _fish is undefined - ISNILS(_fish,0); - // _fish => 0 - (end) - (begin example) - _fish = 12; - // ...later... - ISNILS(_fish,0); - // _fish => 12 - (end) + (begin example) + // _fish is undefined + ISNILS(_fish,0); + // _fish => 0 + (end) + (begin example) + _fish = 12; + // ...later... + ISNILS(_fish,0); + // _fish => 12 + (end) Author: - Sickboy + Sickboy ------------------------------------------- */ #define ISNILS(VARIABLE,DEFAULT_VALUE) if (isNil #VARIABLE) then { ##VARIABLE = ##DEFAULT_VALUE } #define ISNILS2(var1,var2,var3,var4) ISNILS(TRIPLES(var1,var2,var3),var4) @@ -550,14 +569,14 @@ Author: #define GETVARMAINS(var1,var2) GETVARS(var1,MAINLOGIC,var2) #ifndef PATHTO_SYS - #define PATHTO_SYS(var1,var2,var3) \MAINPREFIX\##var1\SUBPREFIX\##var2\##var3.sqf + #define PATHTO_SYS(var1,var2,var3) \MAINPREFIX\##var1\SUBPREFIX\##var2\##var3.sqf #endif #ifndef PATHTOF_SYS - #define PATHTOF_SYS(var1,var2,var3) \MAINPREFIX\##var1\SUBPREFIX\##var2\##var3 + #define PATHTOF_SYS(var1,var2,var3) \MAINPREFIX\##var1\SUBPREFIX\##var2\##var3 #endif #ifndef PATHTOF2_SYS - #define PATHTOF2_SYS(var1,var2,var3) MAINPREFIX\##var1\SUBPREFIX\##var2\##var3 + #define PATHTOF2_SYS(var1,var2,var3) MAINPREFIX\##var1\SUBPREFIX\##var2\##var3 #endif #define PATHTO_R(var1) PATHTOF2_SYS(PREFIX,COMPONENT_C,var1) @@ -606,7 +625,7 @@ Author: #define CACHE_DIS(var1) (!isNil "CBA_RECOMPILE" || CACHE_DIS_SYS(configFile,var1) || CACHE_DIS_SYS(missionConfigFile,var1)) #ifndef DEBUG_SETTINGS - #define DEBUG_SETTINGS [false, true, false] + #define DEBUG_SETTINGS [false, true, false] #endif #define MSG_INIT QUOTE(Initializing: ADDON version: VERSION) @@ -625,34 +644,34 @@ Author: #define VERSIONING_SYS(var1) class CfgSettings \ { \ - class CBA \ - { \ - class Versioning \ - { \ - class var1 \ - { \ - }; \ - }; \ - }; \ + class CBA \ + { \ + class Versioning \ + { \ + class var1 \ + { \ + }; \ + }; \ + }; \ }; #define VERSIONING VERSIONING_SYS(PREFIX) /* ------------------------------------------- Macro: GVAR() - Get full variable identifier for a global variable owned by this component. + Get full variable identifier for a global variable owned by this component. Parameters: - VARIABLE - Partial name of global variable owned by this component [Any]. + VARIABLE - Partial name of global variable owned by this component [Any]. Example: - (begin example) - GVAR(frog) = 12; - // In SPON_FrogDancing component, equivalent to SPON_FrogDancing_frog = 12 - (end) + (begin example) + GVAR(frog) = 12; + // In SPON_FrogDancing component, equivalent to SPON_FrogDancing_frog = 12 + (end) Author: - Sickboy + Sickboy ------------------------------------------- */ #define GVAR(var1) DOUBLES(ADDON,var1) #define EGVAR(var1,var2) DOUBLES(DOUBLES(PREFIX,var1),var2) @@ -660,19 +679,19 @@ Author: /* ------------------------------------------- Macro: GVARMAIN() - Get full variable identifier for a global variable owned by this addon. + Get full variable identifier for a global variable owned by this addon. Parameters: - VARIABLE - Partial name of global variable owned by this addon [Any]. + VARIABLE - Partial name of global variable owned by this addon [Any]. Example: - (begin example) - GVARMAIN(frog) = 12; - // In SPON_FrogDancing component, equivalent to SPON_frog = 12 - (end) + (begin example) + GVARMAIN(frog) = 12; + // In SPON_FrogDancing component, equivalent to SPON_frog = 12 + (end) Author: - Sickboy + Sickboy ------------------------------------------- */ #define GVARMAIN(var1) GVARMAINS(PREFIX,var1) // TODO: What's this? @@ -693,7 +712,7 @@ Author: #define PREP(var1) TRIPLES(ADDON,fnc,var1) = compile preProcessFileLineNumbers 'PATHTO_SYS(PREFIX,COMPONENT_F,DOUBLES(fnc,var1))' #define PREPMAIN(var1) TRIPLES(PREFIX,fnc,var1) = compile preProcessFileLineNumbers 'PATHTO_SYS(PREFIX,COMPONENT_F,DOUBLES(fnc,var1))' #else - #define PREP(var1) ['PATHTO_SYS(PREFIX,COMPONENT_F,DOUBLES(fnc,var1))', 'TRIPLES(ADDON,fnc,var1)'] call SLX_XEH_COMPILE_NEW + #define PREP(var1) ['PATHTO_SYS(PREFIX,COMPONENT_F,DOUBLES(fnc,var1))', 'TRIPLES(ADDON,fnc,var1)'] call SLX_XEH_COMPILE_NEW #define PREPMAIN(var1) ['PATHTO_SYS(PREFIX,COMPONENT_F,DOUBLES(fnc,var1))', 'TRIPLES(PREFIX,fnc,var1)'] call SLX_XEH_COMPILE_NEW #endif @@ -703,27 +722,27 @@ Author: #define EFUNC(var1,var2) FUNC_INNER(var1,var2) #ifndef PRELOAD_ADDONS - #define PRELOAD_ADDONS class CfgAddons \ + #define PRELOAD_ADDONS class CfgAddons \ { \ - class PreloadAddons \ - { \ - class ADDON \ - { \ - list[]={ QUOTE(ADDON) }; \ - }; \ - }; \ + class PreloadAddons \ + { \ + class ADDON \ + { \ + list[]={ QUOTE(ADDON) }; \ + }; \ + }; \ } #endif /* ------------------------------------------- Macros: ARG_#() - Select from list of array arguments + Select from list of array arguments Parameters: - VARIABLE(1-8) - elements for the list + VARIABLE(1-8) - elements for the list Author: - Rommel + Rommel ------------------------------------------- */ #define ARG_1(A,B) ((A) select (B)) #define ARG_2(A,B,C) (ARG_1(ARG_1(A,B),C)) @@ -736,14 +755,14 @@ Author: /* ------------------------------------------- Macros: ARR_#() - Create list from arguments. Useful for working around , in macro parameters. - 1-8 arguments possible. + Create list from arguments. Useful for working around , in macro parameters. + 1-8 arguments possible. Parameters: - VARIABLE(1-8) - elements for the list + VARIABLE(1-8) - elements for the list Author: - Nou + Nou ------------------------------------------- */ #define ARR_1(ARG1) ARG1 #define ARR_2(ARG1,ARG2) ARG1, ARG2 @@ -756,15 +775,15 @@ Author: /* ------------------------------------------- Macros: FORMAT_#(STR, ARG1) - Format - Useful for working around , in macro parameters. - 1-8 arguments possible. + Format - Useful for working around , in macro parameters. + 1-8 arguments possible. Parameters: - STRING - string used by format - VARIABLE(1-8) - elements for usage in format + STRING - string used by format + VARIABLE(1-8) - elements for usage in format Author: - Nou & Sickboy + Nou & Sickboy ------------------------------------------- */ #define FORMAT_1(STR,ARG1) format[STR, ARG1] #define FORMAT_2(STR,ARG1,ARG2) format[STR, ARG1, ARG2] @@ -781,32 +800,32 @@ Author: /* ------------------------------------------- Macros: IS_x() - Checking the data types of variables. + Checking the data types of variables. - IS_ARRAY() - Array - IS_BOOL() - Boolean - IS_BOOLEAN() - UI display handle(synonym for ) - IS_CODE() - Code block (i.e a compiled function) - IS_CONFIG() - Configuration - IS_CONTROL() - UI control handle. - IS_DISPLAY() - UI display handle. - IS_FUNCTION() - A compiled function (synonym for ) - IS_GROUP() - Group. - IS_INTEGER() - Is a number a whole number? - IS_LOCATION() - World location. - IS_NUMBER() - A floating point number (synonym for ) - IS_OBJECT() - World object. - IS_SCALAR() - Floating point number. - IS_SCRIPT() - A script handle (as returned by execVM and spawn commands). - IS_SIDE() - Game side. - IS_STRING() - World object. - IS_TEXT() - Structured text. + IS_ARRAY() - Array + IS_BOOL() - Boolean + IS_BOOLEAN() - UI display handle(synonym for ) + IS_CODE() - Code block (i.e a compiled function) + IS_CONFIG() - Configuration + IS_CONTROL() - UI control handle. + IS_DISPLAY() - UI display handle. + IS_FUNCTION() - A compiled function (synonym for ) + IS_GROUP() - Group. + IS_INTEGER() - Is a number a whole number? + IS_LOCATION() - World location. + IS_NUMBER() - A floating point number (synonym for ) + IS_OBJECT() - World object. + IS_SCALAR() - Floating point number. + IS_SCRIPT() - A script handle (as returned by execVM and spawn commands). + IS_SIDE() - Game side. + IS_STRING() - World object. + IS_TEXT() - Structured text. Parameters: - VARIABLE - Variable to check if it is of a particular type [Any, not nil] + VARIABLE - Variable to check if it is of a particular type [Any, not nil] Author: - Spooner + Spooner ------------------------------------------- */ #define IS_META_SYS(VAR,TYPE) (if (isNil {VAR}) then { false } else { (typeName (VAR)) == TYPE }) #define IS_ARRAY(VAR) IS_META_SYS(VAR,"ARRAY") @@ -829,107 +848,120 @@ Author: #define IS_INTEGER(VAR) if ( IS_SCALAR(VAR) ) then { (floor(VAR) == (VAR)) } else { false } #define IS_NUMBER(VAR) IS_SCALAR(VAR) +#define FLOAT_TO_STRING(num) (str parseNumber (str (_this%_this) + str floor abs _this) + "." + (str (abs _this-floor abs _this) select [2]) + "0") + /* ------------------------------------------- Macro: SCRIPT() - Sets name of script (relies on PREFIX and COMPONENT values being #defined). + Sets name of script (relies on PREFIX and COMPONENT values being #defined). Parameters: - NAME - Name of script [Indentifier] + NAME - Name of script [Indentifier] Example: - (begin example) - SCRIPT(eradicateMuppets); - (end) + (begin example) + SCRIPT(eradicateMuppets); + (end) Author: - Spooner + Spooner ------------------------------------------- */ #define SCRIPT(NAME) \ - scriptName 'PREFIX\COMPONENT\NAME' + scriptName 'PREFIX\COMPONENT\NAME' /* ------------------------------------------- Macros: EXPLODE_n() - Splitting an ARRAY into a number of variables (A, B, C, etc). + DEPRECATED - Use param/params commands added in Arma 3 1.48 - Note that this NOT does make the created variables private. - _PVT variants do. + Splitting an ARRAY into a number of variables (A, B, C, etc). - EXPLODE_1(ARRAY,A,B) - Split a 1-element array into separate variable. - EXPLODE_2(ARRAY,A,B) - Split a 2-element array into separate variables. - EXPLODE_3(ARRAY,A,B,C) - Split a 3-element array into separate variables. - EXPLODE_4(ARRAY,A,B,C,D) - Split a 4-element array into separate variables. - EXPLODE_5(ARRAY,A,B,C,D,E) - Split a 5-element array into separate variables. - EXPLODE_6(ARRAY,A,B,C,D,E,F) - Split a 6-element array into separate variables. - EXPLODE_7(ARRAY,A,B,C,D,E,F,G) - Split a 7-element array into separate variables. - EXPLODE_8(ARRAY,A,B,C,D,E,F,G,H) - Split a 8-element array into separate variables. - EXPLODE_9(ARRAY,A,B,C,D,E,F,G,H,I) - Split a 9-element array into separate variables. + Note that this NOT does make the created variables private. + _PVT variants do. + + EXPLODE_1(ARRAY,A,B) - Split a 1-element array into separate variable. + EXPLODE_2(ARRAY,A,B) - Split a 2-element array into separate variables. + EXPLODE_3(ARRAY,A,B,C) - Split a 3-element array into separate variables. + EXPLODE_4(ARRAY,A,B,C,D) - Split a 4-element array into separate variables. + EXPLODE_5(ARRAY,A,B,C,D,E) - Split a 5-element array into separate variables. + EXPLODE_6(ARRAY,A,B,C,D,E,F) - Split a 6-element array into separate variables. + EXPLODE_7(ARRAY,A,B,C,D,E,F,G) - Split a 7-element array into separate variables. + EXPLODE_8(ARRAY,A,B,C,D,E,F,G,H) - Split a 8-element array into separate variables. + EXPLODE_9(ARRAY,A,B,C,D,E,F,G,H,I) - Split a 9-element array into separate variables. Parameters: - ARRAY - Array to read from [Array] - A..H - Names of variables to set from array [Identifier] + ARRAY - Array to read from [Array] + A..H - Names of variables to set from array [Identifier] Example: - (begin example) - _array = ["fred", 156.8, 120.9]; - EXPLODE_3(_array,_name_height,_weight); - (end) + (begin example) + _array = ["fred", 156.8, 120.9]; + EXPLODE_3(_array,_name,_height,_weight); + (end) Author: - Spooner + Spooner ------------------------------------------- */ -#define EXPLODE_1_SYS(ARRAY,A) A = if (IS_ARRAY((ARRAY))) then { (ARRAY) select 0 } else { ARRAY } +#define EXPLODE_1_SYS(ARRAY,A) A = ARRAY param [0] #define EXPLODE_1(ARRAY,A) EXPLODE_1_SYS(ARRAY,A); TRACE_1("EXPLODE_1, " + QUOTE(ARRAY),A) -#define EXPLODE_1_PVT(ARRAY,A) \ - private #A; \ - EXPLODE_1(ARRAY,A) +#define EXPLODE_1_PVT(ARRAY,A) ARRAY params [#A]; TRACE_1("EXPLODE_1, " + QUOTE(ARRAY),A) -#define EXPLODE_2_SYS(ARRAY,A,B) EXPLODE_1_SYS(ARRAY,A); B = (ARRAY) select 1 +#define EXPLODE_2_SYS(ARRAY,A,B) EXPLODE_1_SYS(ARRAY,A); B = ARRAY param [1] #define EXPLODE_2(ARRAY,A,B) EXPLODE_2_SYS(ARRAY,A,B); TRACE_2("EXPLODE_2, " + QUOTE(ARRAY),A,B) -#define EXPLODE_2_PVT(ARRAY,A,B) \ - private [#A,#B]; \ - EXPLODE_2(ARRAY,A,B) +#define EXPLODE_2_PVT(ARRAY,A,B) ARRAY params [#A,#B]; TRACE_2("EXPLODE_2, " + QUOTE(ARRAY),A,B) -#define EXPLODE_3_SYS(ARRAY,A,B,C) EXPLODE_2_SYS(ARRAY,A,B); C = (ARRAY) select 2 +#define EXPLODE_3_SYS(ARRAY,A,B,C) EXPLODE_2_SYS(ARRAY,A,B); C = ARRAY param [2] #define EXPLODE_3(ARRAY,A,B,C) EXPLODE_3_SYS(ARRAY,A,B,C); TRACE_3("EXPLODE_3, " + QUOTE(ARRAY),A,B,C) -#define EXPLODE_3_PVT(ARRAY,A,B,C) \ - private [#A,#B,#C]; \ - EXPLODE_3(ARRAY,A,B,C) - -#define EXPLODE_4_SYS(ARRAY,A,B,C,D) EXPLODE_3_SYS(ARRAY,A,B,C); D = (ARRAY) select 3 +#define EXPLODE_3_PVT(ARRAY,A,B,C) ARRAY params [#A,#B,#C]; TRACE_3("EXPLODE_3, " + QUOTE(ARRAY),A,B,C) + +#define EXPLODE_4_SYS(ARRAY,A,B,C,D) EXPLODE_3_SYS(ARRAY,A,B,C); D = ARRAY param [3] #define EXPLODE_4(ARRAY,A,B,C,D) EXPLODE_4_SYS(ARRAY,A,B,C,D); TRACE_4("EXPLODE_4, " + QUOTE(ARRAY),A,B,C,D) -#define EXPLODE_4_PVT(ARRAY,A,B,C,D) \ - private [#A,#B,#C,#D]; \ - EXPLODE_4(ARRAY,A,B,C,D) +#define EXPLODE_4_PVT(ARRAY,A,B,C,D) ARRAY params [#A,#B,#C,#D]; TRACE_4("EXPLODE_4, " + QUOTE(ARRAY),A,B,C,D) -#define EXPLODE_5_SYS(ARRAY,A,B,C,D,E) EXPLODE_4_SYS(ARRAY,A,B,C,D); E = (ARRAY) select 4 +#define EXPLODE_5_SYS(ARRAY,A,B,C,D,E) EXPLODE_4_SYS(ARRAY,A,B,C,D); E = ARRAY param [4] #define EXPLODE_5(ARRAY,A,B,C,D,E) EXPLODE_5_SYS(ARRAY,A,B,C,D,E); TRACE_5("EXPLODE_5, " + QUOTE(ARRAY),A,B,C,D,E) -#define EXPLODE_5_PVT(ARRAY,A,B,C,D,E) \ - private [#A,#B,#C,#D,#E]; \ - EXPLODE_5(ARRAY,A,B,C,D,E) +#define EXPLODE_5_PVT(ARRAY,A,B,C,D,E) ARRAY params [#A,#B,#C,#D,#E]; TRACE_5("EXPLODE_5, " + QUOTE(ARRAY),A,B,C,D,E) -#define EXPLODE_6_SYS(ARRAY,A,B,C,D,E,F) EXPLODE_5_SYS(ARRAY,A,B,C,D,E); F = (ARRAY) select 5 +#define EXPLODE_6_SYS(ARRAY,A,B,C,D,E,F) EXPLODE_5_SYS(ARRAY,A,B,C,D,E); F = ARRAY param [5] #define EXPLODE_6(ARRAY,A,B,C,D,E,F) EXPLODE_6_SYS(ARRAY,A,B,C,D,E,F); TRACE_6("EXPLODE_6, " + QUOTE(ARRAY),A,B,C,D,E,F) -#define EXPLODE_6_PVT(ARRAY,A,B,C,D,E,F) \ - private [#A,#B,#C,#D,#E,#F]; \ - EXPLODE_6(ARRAY,A,B,C,D,E,F) +#define EXPLODE_6_PVT(ARRAY,A,B,C,D,E,F) ARRAY params [#A,#B,#C,#D,#E,#F]; TRACE_6("EXPLODE_6, " + QUOTE(ARRAY),A,B,C,D,E,F) -#define EXPLODE_7_SYS(ARRAY,A,B,C,D,E,F,G) EXPLODE_6_SYS(ARRAY,A,B,C,D,E,F); G = (ARRAY) select 6 +#define EXPLODE_7_SYS(ARRAY,A,B,C,D,E,F,G) EXPLODE_6_SYS(ARRAY,A,B,C,D,E,F); G = ARRAY param [6] #define EXPLODE_7(ARRAY,A,B,C,D,E,F,G) EXPLODE_7_SYS(ARRAY,A,B,C,D,E,F,G); TRACE_7("EXPLODE_7, " + QUOTE(ARRAY),A,B,C,D,E,F,G) -#define EXPLODE_7_PVT(ARRAY,A,B,C,D,E,F,G) \ - private [#A,#B,#C,#D,#E,#F,#G]; \ - EXPLODE_7(ARRAY,A,B,C,D,E,F,G) +#define EXPLODE_7_PVT(ARRAY,A,B,C,D,E,F,G) ARRAY params [#A,#B,#C,#D,#E,#F,#G]; TRACE_7("EXPLODE_7, " + QUOTE(ARRAY),A,B,C,D,E,F,G) -#define EXPLODE_8_SYS(ARRAY,A,B,C,D,E,F,G,H) EXPLODE_7_SYS(ARRAY,A,B,C,D,E,F,G); H = (ARRAY) select 7 +#define EXPLODE_8_SYS(ARRAY,A,B,C,D,E,F,G,H) EXPLODE_7_SYS(ARRAY,A,B,C,D,E,F,G); H = ARRAY param [7] #define EXPLODE_8(ARRAY,A,B,C,D,E,F,G,H) EXPLODE_8_SYS(ARRAY,A,B,C,D,E,F,G,H); TRACE_8("EXPLODE_8, " + QUOTE(ARRAY),A,B,C,D,E,F,G,H) -#define EXPLODE_8_PVT(ARRAY,A,B,C,D,E,F,G,H) \ - private [#A,#B,#C,#D,#E,#F,#G,#H]; \ - EXPLODE_8(ARRAY,A,B,C,D,E,F,G,H) +#define EXPLODE_8_PVT(ARRAY,A,B,C,D,E,F,G,H) ARRAY params [#A,#B,#C,#D,#E,#F,#G,#H]; TRACE_8("EXPLODE_8, " + QUOTE(ARRAY),A,B,C,D,E,F,G,H) -#define EXPLODE_9_SYS(ARRAY,A,B,C,D,E,F,G,H,I) EXPLODE_8_SYS(ARRAY,A,B,C,D,E,F,G,H); I = (ARRAY) select 8 +#define EXPLODE_9_SYS(ARRAY,A,B,C,D,E,F,G,H,I) EXPLODE_8_SYS(ARRAY,A,B,C,D,E,F,G,H); I = ARRAY param [8] #define EXPLODE_9(ARRAY,A,B,C,D,E,F,G,H,I) EXPLODE_9_SYS(ARRAY,A,B,C,D,E,F,G,H,I); TRACE_9("EXPLODE_9, " + QUOTE(ARRAY),A,B,C,D,E,F,G,H,I) -#define EXPLODE_9_PVT(ARRAY,A,B,C,D,E,F,G,H,I) \ - private [#A,#B,#C,#D,#E,#F,#G,#H,#I]; \ - EXPLODE_9(ARRAY,A,B,C,D,E,F,G,H,I) +#define EXPLODE_9_PVT(ARRAY,A,B,C,D,E,F,G,H,I) ARRAY params [#A,#B,#C,#D,#E,#F,#G,#H,#I]; TRACE_9("EXPLODE_9, " + QUOTE(ARRAY),A,B,C,D,E,F,G,H,I) + +/* ------------------------------------------- +Macro: xSTRING() + Get full string identifier from a stringtable owned by this component. + +Parameters: + VARIABLE - Partial name of global variable owned by this component [Any]. + +Example: + ADDON is CBA_Balls. + (begin example) + // Localized String (localize command must still be used with it) + LSTRING(Example); // STR_CBA_Balls_Example; + // Config String (note the $) + CSTRING(Example); // $STR_CBA_Balls_Example; + (end) + +Author: + Jonpas +------------------------------------------- */ +#ifndef STRING_MACROS_GUARD +#define STRING_MACROS_GUARD + #define LSTRING(var1) QUOTE(TRIPLES(STR,ADDON,var1)) + #define ELSTRING(var1,var2) QUOTE(TRIPLES(STR,DOUBLES(PREFIX,var1),var2)) + #define CSTRING(var1) QUOTE(TRIPLES($STR,ADDON,var1)) + #define ECSTRING(var1,var2) QUOTE(TRIPLES($STR,DOUBLES(PREFIX,var1),var2)) +#endif /* ------------------------------------------- @@ -938,37 +970,39 @@ Group: Managing Function Parameters /* ------------------------------------------- Macros: PARAMS_n() - Setting variables based on parameters passed to a function. + DEPRECATED - Use param/params commands added in Arma 3 1.48 - Each parameter is defines as private and set to the appropriate value from _this. + Setting variables based on parameters passed to a function. - PARAMS_1(A) - Get 1 parameter from the _this array (or _this if it's not an array). - PARAMS_2(A,B) - Get 2 parameters from the _this array. - PARAMS_3(A,B,C) - Get 3 parameters from the _this array. - PARAMS_4(A,B,C,D) - Get 4 parameters from the _this array. - PARAMS_5(A,B,C,D,E) - Get 5 parameters from the _this array. - PARAMS_6(A,B,C,D,E,F) - Get 6 parameters from the _this array. - PARAMS_7(A,B,C,D,E,F,G) - Get 7 parameters from the _this array. - PARAMS_8(A,B,C,D,E,F,G,H) - Get 8 parameters from the _this array. + Each parameter is defines as private and set to the appropriate value from _this. + + PARAMS_1(A) - Get 1 parameter from the _this array (or _this if it's not an array). + PARAMS_2(A,B) - Get 2 parameters from the _this array. + PARAMS_3(A,B,C) - Get 3 parameters from the _this array. + PARAMS_4(A,B,C,D) - Get 4 parameters from the _this array. + PARAMS_5(A,B,C,D,E) - Get 5 parameters from the _this array. + PARAMS_6(A,B,C,D,E,F) - Get 6 parameters from the _this array. + PARAMS_7(A,B,C,D,E,F,G) - Get 7 parameters from the _this array. + PARAMS_8(A,B,C,D,E,F,G,H) - Get 8 parameters from the _this array. Parameters: - A..H - Name of variable to read from _this [Identifier] + A..H - Name of variable to read from _this [Identifier] Example: - A function called like this: - (begin example) - [_name,_address,_telephone] call recordPersonalDetails; - (end) - expects 3 parameters and those variables could be initialised at the start of the function definition with: - (begin example) - recordPersonalDetails = { - PARAMS_3(_name,_address,_telephone); - // Rest of function follows... - }; - (end) + A function called like this: + (begin example) + [_name,_address,_telephone] call recordPersonalDetails; + (end) + expects 3 parameters and those variables could be initialised at the start of the function definition with: + (begin example) + recordPersonalDetails = { + PARAMS_3(_name,_address,_telephone); + // Rest of function follows... + }; + (end) Author: - Spooner + Spooner ------------------------------------------- */ #define PARAMS_1(A) EXPLODE_1_PVT(_this,A) #define PARAMS_2(A,B) EXPLODE_2_PVT(_this,A,B) @@ -982,59 +1016,62 @@ Author: /* ------------------------------------------- Macro: DEFAULT_PARAM() - Getting a default function parameter. This may be used together with to have a mix of required and - optional parameters. + DEPRECATED - Use param/params commands added in Arma 3 1.48 + + Getting a default function parameter. This may be used together with to have a mix of required and + optional parameters. Parameters: - INDEX - Index of parameter in _this [Integer, 0+] - NAME - Name of the variable to set [Identifier] - DEF_VALUE - Default value to use in case the array is too short or the value at INDEX is nil [Any] + INDEX - Index of parameter in _this [Integer, 0+] + NAME - Name of the variable to set [Identifier] + DEF_VALUE - Default value to use in case the array is too short or the value at INDEX is nil [Any] Example: - A function called with optional parameters: - (begin example) - [_name] call myFunction; - [_name, _numberOfLegs] call myFunction; - [_name, _numberOfLegs, _hasAHead] call myFunction; - (end) - 1 required parameter and 2 optional parameters. Those variables could be initialised at the start of the function - definition with: - (begin example) - myFunction = { - PARAMS_1(_name); - DEFAULT_PARAM(1,_numberOfLegs,2); - DEFAULT_PARAM(2,_hasAHead,true); - // Rest of function follows... - }; - (end) + A function called with optional parameters: + (begin example) + [_name] call myFunction; + [_name, _numberOfLegs] call myFunction; + [_name, _numberOfLegs, _hasAHead] call myFunction; + (end) + 1 required parameter and 2 optional parameters. Those variables could be initialised at the start of the function + definition with: + (begin example) + myFunction = { + PARAMS_1(_name); + DEFAULT_PARAM(1,_numberOfLegs,2); + DEFAULT_PARAM(2,_hasAHead,true); + // Rest of function follows... + }; + (end) Author: - Spooner + Spooner ------------------------------------------- */ #define DEFAULT_PARAM(INDEX,NAME,DEF_VALUE) \ - private #NAME; \ - NAME = [RETNIL(_this), INDEX, DEF_VALUE] call CBA_fnc_defaultParam; \ - TRACE_3("DEFAULT_PARAM",INDEX,NAME,DEF_VALUE) + private [#NAME,"_this"]; \ + ISNILS(_this,[]); \ + NAME = _this param [INDEX, DEF_VALUE]; \ + TRACE_3("DEFAULT_PARAM",INDEX,NAME,DEF_VALUE) /* ------------------------------------------- Macro: KEY_PARAM() - Get value from key in _this list, return default when key is not included in list. + Get value from key in _this list, return default when key is not included in list. Parameters: - KEY - Key name [String] - NAME - Name of the variable to set [Identifier] - DEF_VALUE - Default value to use in case key not found [ANY] + KEY - Key name [String] + NAME - Name of the variable to set [Identifier] + DEF_VALUE - Default value to use in case key not found [ANY] Example: Author: - Muzzleflash + Muzzleflash ------------------------------------------- */ #define KEY_PARAM(KEY,NAME,DEF_VALUE) \ - private #NAME; \ - NAME = [toLower KEY, toUpper KEY, DEF_VALUE, RETNIL(_this)] call CBA_fnc_getArg; \ - TRACE_3("KEY_PARAM",KEY,NAME,DEF_VALUE) + private #NAME; \ + NAME = [toLower KEY, toUpper KEY, DEF_VALUE, RETNIL(_this)] call CBA_fnc_getArg; \ + TRACE_3("KEY_PARAM",KEY,NAME,DEF_VALUE) /* ------------------------------------------- Group: Assertions @@ -1044,94 +1081,210 @@ Group: Assertions /* ------------------------------------------- Macro: ASSERT_TRUE() - Asserts that a CONDITION is true. When an assertion fails, an error is raised with the given MESSAGE. + Asserts that a CONDITION is true. When an assertion fails, an error is raised with the given MESSAGE. Parameters: - CONDITION - Condition to assert as true [Boolean] - MESSSAGE - Message to display if (A OPERATOR B) is false [String] + CONDITION - Condition to assert as true [Boolean] + MESSSAGE - Message to display if (A OPERATOR B) is false [String] Example: - (begin example) - ASSERT_TRUE(_frogIsDead,"The frog is alive"); - (end) + (begin example) + ASSERT_TRUE(_frogIsDead,"The frog is alive"); + (end) Author: - Spooner + Spooner ------------------------------------------- */ #define ASSERT_TRUE(CONDITION,MESSAGE) \ - if (not (CONDITION)) then \ - { \ - ASSERTION_ERROR('Assertion (CONDITION) failed!\n\n' + (MESSAGE)); \ - } + if (not (CONDITION)) then \ + { \ + ASSERTION_ERROR('Assertion (CONDITION) failed!\n\n' + (MESSAGE)); \ + } /* ------------------------------------------- Macro: ASSERT_FALSE() - Asserts that a CONDITION is false. When an assertion fails, an error is raised with the given MESSAGE. + Asserts that a CONDITION is false. When an assertion fails, an error is raised with the given MESSAGE. Parameters: - CONDITION - Condition to assert as false [Boolean] - MESSSAGE - Message to display if (A OPERATOR B) is true [String] + CONDITION - Condition to assert as false [Boolean] + MESSSAGE - Message to display if (A OPERATOR B) is true [String] Example: - (begin example) - ASSERT_FALSE(_frogIsDead,"The frog died"); - (end) + (begin example) + ASSERT_FALSE(_frogIsDead,"The frog died"); + (end) Author: - Spooner + Spooner ------------------------------------------- */ #define ASSERT_FALSE(CONDITION,MESSAGE) \ - if (CONDITION) then \ - { \ - ASSERTION_ERROR('Assertion (not (CONDITION)) failed!\n\n' + (MESSAGE)) \ - } + if (CONDITION) then \ + { \ + ASSERTION_ERROR('Assertion (not (CONDITION)) failed!\n\n' + (MESSAGE)) \ + } /* ------------------------------------------- Macro: ASSERT_OP() - Asserts that (A OPERATOR B) is true. When an assertion fails, an error is raised with the given MESSAGE. + Asserts that (A OPERATOR B) is true. When an assertion fails, an error is raised with the given MESSAGE. Parameters: - A - First value [Any] - OPERATOR - Binary operator to use [Operator] - B - Second value [Any] - MESSSAGE - Message to display if (A OPERATOR B) is false. [String] + A - First value [Any] + OPERATOR - Binary operator to use [Operator] + B - Second value [Any] + MESSSAGE - Message to display if (A OPERATOR B) is false. [String] Example: - (begin example) - ASSERT_OP(_fish,>,5,"Too few fish!"); - (end) + (begin example) + ASSERT_OP(_fish,>,5,"Too few fish!"); + (end) Author: - Spooner + Spooner ------------------------------------------- */ #define ASSERT_OP(A,OPERATOR,B,MESSAGE) \ - if (not ((A) OPERATOR (B))) then \ - { \ - ASSERTION_ERROR('Assertion (A OPERATOR B) failed!\n' + 'A: ' + (str (A)) + '\n' + 'B: ' + (str (B)) + "\n\n" + (MESSAGE)); \ - } + if (not ((A) OPERATOR (B))) then \ + { \ + ASSERTION_ERROR('Assertion (A OPERATOR B) failed!\n' + 'A: ' + (str (A)) + '\n' + 'B: ' + (str (B)) + "\n\n" + (MESSAGE)); \ + } /* ------------------------------------------- Macro: ASSERT_DEFINED() - Asserts that a VARIABLE is defined. When an assertion fails, an error is raised with the given MESSAGE.. + Asserts that a VARIABLE is defined. When an assertion fails, an error is raised with the given MESSAGE.. Parameters: - VARIABLE - Variable to test if defined [String or Function]. - MESSAGE - Message to display if variable is undefined [String]. + VARIABLE - Variable to test if defined [String or Function]. + MESSAGE - Message to display if variable is undefined [String]. Examples: - (begin example) - ASSERT_DEFINED("_anUndefinedVar","Too few fish!"); - ASSERT_DEFINED({ obj getVariable "anUndefinedVar" },"Too many fish!"); - (end) + (begin example) + ASSERT_DEFINED("_anUndefinedVar","Too few fish!"); + ASSERT_DEFINED({ obj getVariable "anUndefinedVar" },"Too many fish!"); + (end) Author: - Spooner + Spooner ------------------------------------------- */ #define ASSERT_DEFINED(VARIABLE,MESSAGE) \ - if (isNil VARIABLE) then \ - { \ - ASSERTION_ERROR('Assertion (VARIABLE is defined) failed!\n\n' + (MESSAGE)); \ - } + if (isNil VARIABLE) then \ + { \ + ASSERTION_ERROR('Assertion (VARIABLE is defined) failed!\n\n' + (MESSAGE)); \ + } + +/* ------------------------------------------- +Group: Unit tests +------------------------------------------- */ +#define TEST_SUCCESS(MESSAGE) MESSAGE_WITH_TITLE("Test OK",MESSAGE) +#define TEST_FAIL(MESSAGE) ERROR_WITH_TITLE("Test FAIL",MESSAGE) + +/* ------------------------------------------- +Macro: TEST_TRUE() + Tests that a CONDITION is true. + If the condition is not true, an error is raised with the given MESSAGE. + +Parameters: + CONDITION - Condition to assert as true [Boolean] + MESSSAGE - Message to display if (A OPERATOR B) is false [String] + +Example: + (begin example) + TEST_TRUE(_frogIsDead,"The frog is alive"); + (end) + +Author: + Killswitch +------------------------------------------- */ +#define TEST_TRUE(CONDITION, MESSAGE) \ + if (CONDITION) then \ + { \ + TEST_SUCCESS('(CONDITION)'); \ + } \ + else \ + { \ + TEST_FAIL('(CONDITION) ' + (MESSAGE)); \ + } + +/* ------------------------------------------- +Macro: TEST_FALSE() + Tests that a CONDITION is false. + If the condition is not false, an error is raised with the given MESSAGE. + +Parameters: + CONDITION - Condition to test as false [Boolean] + MESSSAGE - Message to display if (A OPERATOR B) is true [String] + +Example: + (begin example) + TEST_FALSE(_frogIsDead,"The frog died"); + (end) + +Author: + Killswitch +------------------------------------------- */ +#define TEST_FALSE(CONDITION, MESSAGE) \ + if (not (CONDITION)) then \ + { \ + TEST_SUCCESS('(not (CONDITION))'); \ + } \ + else \ + { \ + TEST_FAIL('(not (CONDITION)) ' + (MESSAGE)); \ + } + +/* ------------------------------------------- +Macro: TEST_OP() + Tests that (A OPERATOR B) is true. + If the test fails, an error is raised with the given MESSAGE. + +Parameters: + A - First value [Any] + OPERATOR - Binary operator to use [Operator] + B - Second value [Any] + MESSSAGE - Message to display if (A OPERATOR B) is false. [String] + +Example: + (begin example) + TEST_OP(_fish,>,5,"Too few fish!"); + (end) + +Author: + Killswitch +------------------------------------------- */ +#define TEST_OP(A,OPERATOR,B,MESSAGE) \ + if ((A) OPERATOR (B)) then \ + { \ + TEST_SUCCESS('(A OPERATOR B)') \ + } \ + else \ + { \ + TEST_FAIL('(A OPERATOR B)') \ + }; + +/* ------------------------------------------- +Macro: TEST_DEFINED() + Tests that a VARIABLE is defined. + +Parameters: + VARIABLE - Variable to test if defined [String or Function]. + MESSAGE - Message to display if variable is undefined [String]. + +Examples: + (begin example) + TEST_DEFINED("_anUndefinedVar","Too few fish!"); + TEST_DEFINED({ obj getVariable "anUndefinedVar" },"Too many fish!"); + (end) + +Author: + Killswitch +------------------------------------------- */ +#define TEST_DEFINED(VARIABLE,MESSAGE) \ + if (not isNil VARIABLE) then \ + { \ + TEST_SUCCESS('(' + VARIABLE + ' is defined)'); \ + } \ + else \ + { \ + TEST_FAIL('(' + VARIABLE + ' is not defined)' + (MESSAGE)); \ + } /* ------------------------------------------- Group: Managing Deprecation @@ -1139,117 +1292,117 @@ Group: Managing Deprecation /* ------------------------------------------- Macro: DEPRECATE_SYS() - Allow deprecation of a function that has been renamed. + Allow deprecation of a function that has been renamed. - Replaces an old OLD_FUNCTION (which will have PREFIX_ prepended) with a NEW_FUNCTION - (PREFIX_ prepended) with the intention that the old function will be disabled in the future. + Replaces an old OLD_FUNCTION (which will have PREFIX_ prepended) with a NEW_FUNCTION + (PREFIX_ prepended) with the intention that the old function will be disabled in the future. - Shows a warning in RPT each time the deprecated function is used, but runs the new function. + Shows a warning in RPT each time the deprecated function is used, but runs the new function. Parameters: - OLD_FUNCTION - Full name of old function [Identifier for function that does not exist any more] - NEW_FUNCTION - Full name of new function [Function] + OLD_FUNCTION - Full name of old function [Identifier for function that does not exist any more] + NEW_FUNCTION - Full name of new function [Function] Example: - (begin example) - // After renaming CBA_fnc_frog as CBA_fnc_fish - DEPRECATE_SYS(CBA_fnc_frog,CBA_fnc_fish); - (end) + (begin example) + // After renaming CBA_fnc_frog as CBA_fnc_fish + DEPRECATE_SYS(CBA_fnc_frog,CBA_fnc_fish); + (end) Author: - Sickboy + Sickboy ------------------------------------------- */ #define DEPRECATE_SYS(OLD_FUNCTION,NEW_FUNCTION) \ - OLD_FUNCTION = { \ - WARNING('Deprecated function used: OLD_FUNCTION (new: NEW_FUNCTION) in ADDON'); \ - if (isNil "_this") then { call NEW_FUNCTION } else { _this call NEW_FUNCTION }; \ - } + OLD_FUNCTION = { \ + WARNING('Deprecated function used: OLD_FUNCTION (new: NEW_FUNCTION) in ADDON'); \ + if (isNil "_this") then { call NEW_FUNCTION } else { _this call NEW_FUNCTION }; \ + } /* ------------------------------------------- Macro: DEPRECATE() - Allow deprecation of a function, in the current component, that has been renamed. + Allow deprecation of a function, in the current component, that has been renamed. - Replaces an OLD_FUNCTION (which will have PREFIX_ prepended) with a NEW_FUNCTION - (PREFIX_ prepended) with the intention that the old function will be disabled in the future. + Replaces an OLD_FUNCTION (which will have PREFIX_ prepended) with a NEW_FUNCTION + (PREFIX_ prepended) with the intention that the old function will be disabled in the future. - Shows a warning in RPT each time the deprecated function is used, but runs the new function. + Shows a warning in RPT each time the deprecated function is used, but runs the new function. Parameters: - OLD_FUNCTION - Name of old function, assuming PREFIX [Identifier for function that does not exist any more] - NEW_FUNCTION - Name of new function, assuming PREFIX [Function] + OLD_FUNCTION - Name of old function, assuming PREFIX [Identifier for function that does not exist any more] + NEW_FUNCTION - Name of new function, assuming PREFIX [Function] Example: - (begin example) - // After renaming CBA_fnc_frog as CBA_fnc_fish - DEPRECATE(fnc_frog,fnc_fish); - (end) + (begin example) + // After renaming CBA_fnc_frog as CBA_fnc_fish + DEPRECATE(fnc_frog,fnc_fish); + (end) Author: - Sickboy + Sickboy ------------------------------------------- */ #define DEPRECATE(OLD_FUNCTION,NEW_FUNCTION) \ - DEPRECATE_SYS(DOUBLES(PREFIX,OLD_FUNCTION),DOUBLES(PREFIX,NEW_FUNCTION)) + DEPRECATE_SYS(DOUBLES(PREFIX,OLD_FUNCTION),DOUBLES(PREFIX,NEW_FUNCTION)) /* ------------------------------------------- Macro: OBSOLETE_SYS() - Replace a function that has become obsolete. + Replace a function that has become obsolete. - Replace an obsolete OLD_FUNCTION with a simple COMMAND_FUNCTION, with the intention that anyone - using the function should replace it with the simple command, since the function will be disabled in the future. + Replace an obsolete OLD_FUNCTION with a simple COMMAND_FUNCTION, with the intention that anyone + using the function should replace it with the simple command, since the function will be disabled in the future. - Shows a warning in RPT each time the deprecated function is used, and runs the command function. + Shows a warning in RPT each time the deprecated function is used, and runs the command function. Parameters: - OLD_FUNCTION - Full name of old function [Identifier for function that does not exist any more] - COMMAND_CODE - Code to replace the old function [Function] + OLD_FUNCTION - Full name of old function [Identifier for function that does not exist any more] + COMMAND_CODE - Code to replace the old function [Function] Example: - (begin example) - // In Arma2, currentWeapon command made the CBA_fMyWeapon function obsolete: - OBSOLETE_SYS(CBA_fMyWeapon,{ currentWeapon player }); - (end) + (begin example) + // In Arma2, currentWeapon command made the CBA_fMyWeapon function obsolete: + OBSOLETE_SYS(CBA_fMyWeapon,{ currentWeapon player }); + (end) Author: - Spooner + Spooner ------------------------------------------- */ #define OBSOLETE_SYS(OLD_FUNCTION,COMMAND_CODE) \ - OLD_FUNCTION = { \ - WARNING('Obsolete function used: (use: OLD_FUNCTION) in ADDON'); \ - if (isNil "_this") then { call COMMAND_CODE } else { _this call COMMAND_CODE }; \ - } + OLD_FUNCTION = { \ + WARNING('Obsolete function used: (use: OLD_FUNCTION) in ADDON'); \ + if (isNil "_this") then { call COMMAND_CODE } else { _this call COMMAND_CODE }; \ + } /* ------------------------------------------- Macro: OBSOLETE() - Replace a function, in the current component, that has become obsolete. + Replace a function, in the current component, that has become obsolete. - Replace an obsolete OLD_FUNCTION (which will have PREFIX_ prepended) with a simple - COMMAND_CODE, with the intention that anyone using the function should replace it with the simple - command. + Replace an obsolete OLD_FUNCTION (which will have PREFIX_ prepended) with a simple + COMMAND_CODE, with the intention that anyone using the function should replace it with the simple + command. - Shows a warning in RPT each time the deprecated function is used. + Shows a warning in RPT each time the deprecated function is used. Parameters: - OLD_FUNCTION - Name of old function, assuming PREFIX [Identifier for function that does not exist any more] - COMMAND_CODE - Code to replace the old function [Function] + OLD_FUNCTION - Name of old function, assuming PREFIX [Identifier for function that does not exist any more] + COMMAND_CODE - Code to replace the old function [Function] Example: - (begin example) - // In Arma2, currentWeapon command made the CBA_fMyWeapon function obsolete: - OBSOLETE(fMyWeapon,{ currentWeapon player }); - (end) + (begin example) + // In Arma2, currentWeapon command made the CBA_fMyWeapon function obsolete: + OBSOLETE(fMyWeapon,{ currentWeapon player }); + (end) Author: - Spooner + Spooner ------------------------------------------- */ #define OBSOLETE(OLD_FUNCTION,COMMAND_CODE) \ - OBSOLETE_SYS(DOUBLES(PREFIX,OLD_FUNCTION),COMMAND_CODE) + OBSOLETE_SYS(DOUBLES(PREFIX,OLD_FUNCTION),COMMAND_CODE) #define BWC_CONFIG(NAME) class NAME { \ - units[] = {}; \ - weapons[] = {}; \ - requiredVersion = REQUIRED_VERSION; \ - requiredAddons[] = {}; \ - version = VERSION; \ + units[] = {}; \ + weapons[] = {}; \ + requiredVersion = REQUIRED_VERSION; \ + requiredAddons[] = {}; \ + version = VERSION; \ } // XEH Specific diff --git a/tools/cba/addons/xeh/init_pre.sqf b/tools/cba/addons/xeh/init_pre.sqf index 8e6a31f8c8..44b4657aca 100644 --- a/tools/cba/addons/xeh/init_pre.sqf +++ b/tools/cba/addons/xeh/init_pre.sqf @@ -23,10 +23,10 @@ uiNamespace setVariable ["CBA_isCached", CBA_isCached]; if (isNil "SLX_XEH_RECOMPILE") then { SLX_XEH_RECOMPILE = CACHE_DIS(xeh) }; if (!isMultiplayer || {isDedicated} || {CBA_isCached == -1}) then { - uiNamespace setVariable ["SLX_XEH_CACHE_KEYS", []]; - uiNamespace setVariable ["SLX_XEH_CACHE_KEYS2", []]; - uiNamespace setVariable ["SLX_XEH_CACHE_KEYS3", []]; - uiNamespace setVariable ["CBA_CACHE_KEYS", []]; + uiNamespace setVariable ["SLX_XEH_CACHE_KEYS", []]; + uiNamespace setVariable ["SLX_XEH_CACHE_KEYS2", []]; + uiNamespace setVariable ["SLX_XEH_CACHE_KEYS3", []]; + uiNamespace setVariable ["CBA_CACHE_KEYS", []]; }; SLX_XEH_CACHE_KEYS = uiNamespace getVariable "SLX_XEH_CACHE_KEYS"; @@ -46,24 +46,24 @@ SLX_XEH_DisableLogging = isClass(configFile/"CfgPatches"/"Disable_XEH_Logging"); /* CBA_fnc_defaultParam = { - PARAMS_3(_params,_index,_defaultValue); - - private "_value"; - - if (!isNil "_defaultValue") then { - _value = _defaultValue; - }; - - if (!isNil "_params" && {(typeName _params) == "ARRAY"} && {count _params > _index} && {!isNil { _params select _index }}) then { - _value = _params select _index; - }; - - // Return. - if (isNil "_value") then { - nil; - } else { - _value; - }; + params ["_params","_index","_defaultValue"]; + + private "_value"; + + if (!isNil "_defaultValue") then { + _value = _defaultValue; + }; + + if (!isNil "_params" && {(typeName _params) == "ARRAY"} && {count _params > _index} && {!isNil { _params select _index }}) then { + _value = _params select _index; + }; + + // Return. + if (isNil "_value") then { + nil; + } else { + _value; + }; }; */ @@ -74,10 +74,10 @@ if (time > 0) then { XEH_LOG("XEH WARNING: Time > 0; This probably means there a _cfgRespawn = (missionConfigFile/"respawn"); _respawn = false; if ( isNumber(_cfgRespawn) ) then { - _respawn = !(getNumber(_cfgRespawn) in [0, 1, 4, 5]); + _respawn = !(getNumber(_cfgRespawn) in [0, 1, 4, 5]); }; if ( isText(_cfgRespawn) ) then { - _respawn = !(getText(_cfgRespawn) in ["none", "bird", "group", "side"]); + _respawn = !(getText(_cfgRespawn) in ["none", "bird", "group", "side"]); }; SLX_XEH_objects = []; // Temporary array, to track InitPosts at mission initialization @@ -90,81 +90,81 @@ _level = 0; // pre v1.60 // TODO: Improve v1.60 detection // TODO: Temporary disabled due to #28652 //if ((isNumber (configFile >> "CfgDifficulties" >> "recruit" >> "recoilCoef")) && (isNumber (configFile >> "CfgVehicles" >> "Car" >> "turnCoef"))) then { - //_level = 1; // v1.60 + //_level = 1; // v1.60 //}; FUNC(determineProductVersion) = { - private "_pv"; - _pv = call {productVersion}; + private "_pv"; + _pv = call {productVersion}; - // A2 (and OA pre 1.61beta, and TOH pre 1.05?) does not support productVersion so we deal with it manually - if (isNil "_pv") then { - _pv = if (isClass(configFile >> "CfgPatches" >> "A3_Map_Stratis")) then { - // A3 Backup - ["Arma 3 Alpha","Arma3Alpha", -1, -1]; //,5,102571] + // A2 (and OA pre 1.61beta, and TOH pre 1.05?) does not support productVersion so we deal with it manually + if (isNil "_pv") then { + _pv = if (isClass(configFile >> "CfgPatches" >> "A3_Map_Stratis")) then { + // A3 Backup + ["Arma 3 Alpha","Arma3Alpha", -1, -1]; //,5,102571] - } else { - if (isClass(configFile >> "CfgPatches" >> "United_States_H")) then { - // TOH Backup - ["TakeOn H", "TakeOnH", -1, -1]; - } else { - if (isClass(configFile >> "CfgPatches" >> "Takistan")) then { - // OA Backup - ["ArmA 2OA", "ArmA2OA", -1, -1]; - } else { - // A2 Backup - ["ArmA 2", "ArmA2", -1, -1]; - }; - }; - }; - }; + } else { + if (isClass(configFile >> "CfgPatches" >> "United_States_H")) then { + // TOH Backup + ["TakeOn H", "TakeOnH", -1, -1]; + } else { + if (isClass(configFile >> "CfgPatches" >> "Takistan")) then { + // OA Backup + ["ArmA 2OA", "ArmA2OA", -1, -1]; + } else { + // A2 Backup + ["ArmA 2", "ArmA2", -1, -1]; + }; + }; + }; + }; - _pv; + _pv; }; FUNC(determineGame) = { - // 0 = A2 - // 1 = OA - // 2 = TOH - // 3 = A3 :P - private "_pv"; - _pv = call FUNC(determineProductVersion); + // 0 = A2 + // 1 = OA + // 2 = TOH + // 3 = A3 :P + private "_pv"; + _pv = call FUNC(determineProductVersion); - switch (_pv select 1) do { - case "ArmA2": {0}; - case "ArmA2OA": {1}; - case "TakeOnH": {2}; - case "Arma3Alpha": {3}; - case "Arma3": {3}; - default {0}; - }; + switch (_pv select 1) do { + case "ArmA2": {0}; + case "ArmA2OA": {1}; + case "TakeOnH": {2}; + case "Arma3Alpha": {3}; + case "Arma3": {3}; + default {0}; + }; }; // System array with machine / mission / session information SLX_XEH_MACHINE = [ - !isDedicated, // 0 - isClient (and thus has player) - false, // 1 - isJip - !isServer, // 2 - isDedicatedClient (and thus not a Client-Server) - isServer, // 3 - isServer - isDedicated, // 4 - isDedicatedServer (and thus not a Client-Server) - false, // 5 - Player Check Finished - !isMultiplayer, // 6 - SP? - false, // 7 - StartInit Passed - false, // 8 - Postinit Passed - isMultiplayer && {_respawn}, // 9 - Multiplayer && respawn? - if (isDedicated) then { 0 } else { if (isServer) then { 1 } else { 2 } }, // 10 - Machine type (only 3 possible configurations) - _id, // 11 - SESSION_ID - _level, // 12 - LEVEL - Used for version determination - false, // 13 - TIMEOUT - PostInit timedOut - call FUNC(determineGame), // 14 - Game - call FUNC(determineProductVersion) // 15 - Product+Version + !isDedicated, // 0 - isClient (and thus has player) + false, // 1 - isJip + !isServer, // 2 - isDedicatedClient (and thus not a Client-Server) + isServer, // 3 - isServer + isDedicated, // 4 - isDedicatedServer (and thus not a Client-Server) + false, // 5 - Player Check Finished + !isMultiplayer, // 6 - SP? + false, // 7 - StartInit Passed + false, // 8 - Postinit Passed + isMultiplayer && {_respawn}, // 9 - Multiplayer && respawn? + if (isDedicated) then { 0 } else { if (isServer) then { 1 } else { 2 } }, // 10 - Machine type (only 3 possible configurations) + _id, // 11 - SESSION_ID + _level, // 12 - LEVEL - Used for version determination + false, // 13 - TIMEOUT - PostInit timedOut + call FUNC(determineGame), // 14 - Game + call FUNC(determineProductVersion) // 15 - Product+Version ]; SLX_XEH_DUMMY = switch (SLX_XEH_MACHINE select 14) do { - case 2: {"Helipad_Invisible_H" }; - case 3: {"Land_HelipadEmpty_F" }; - default { "HeliHEmpty" }; + case 2: {"Helipad_Invisible_H" }; + case 3: {"Land_HelipadEmpty_F" }; + default { "HeliHEmpty" }; }; SLX_XEH_STR = ""; // Empty string @@ -259,24 +259,24 @@ call COMPILE_FILE(init_eh); // All XEH Event functions GVAR(init_obj) = SLX_XEH_DUMMY createVehicleLocal [0, 0, 0]; GVAR(init_obj) addEventHandler ["killed", { - #ifdef DEBUG_MODE_FULL - XEH_LOG("XEH: VehicleCrewInit: "+str(count vehicles)); - #endif + #ifdef DEBUG_MODE_FULL + XEH_LOG("XEH: VehicleCrewInit: "+str(count vehicles)); + #endif - { - _sim = getText(configFile/"CfgVehicles"/(typeOf _x)/"simulation"); - _crew = crew _x; - /* - * If it's a vehicle then start event handlers for the crew. - * (Vehicles have crew and are neither humanoids nor game logics) - */ - if (count _crew > 0 && {{ _sim == _x }count["soldier", "invisible"] == 0}) then { - { if !(_x in SLX_XEH_INIT_MEN) then { [_x] call SLX_XEH_EH_Init } } forEach _crew; - }; - } forEach vehicles; - SLX_XEH_INIT_MEN = nil; - - deleteVehicle GVAR(init_obj);GVAR(init_obj) = nil + { + _sim = getText(configFile/"CfgVehicles"/(typeOf _x)/"simulation"); + _crew = crew _x; + /* + * If it's a vehicle then start event handlers for the crew. + * (Vehicles have crew and are neither humanoids nor game logics) + */ + if (count _crew > 0 && {{ _sim == _x }count["soldier", "invisible"] == 0}) then { + { if !(_x in SLX_XEH_INIT_MEN) then { [_x] call SLX_XEH_EH_Init } } forEach _crew; + }; + } forEach vehicles; + SLX_XEH_INIT_MEN = nil; + + deleteVehicle GVAR(init_obj);GVAR(init_obj) = nil }]; GVAR(init_obj) setDamage 1; // Schedule to run itsy bitsy later @@ -284,73 +284,75 @@ GVAR(init_obj) setDamage 1; // Schedule to run itsy bitsy later // Prepare postInit GVAR(init_obj2) = SLX_XEH_DUMMY createVehicleLocal [0, 0, 0]; GVAR(init_obj2) addEventHandler ["killed", { - call COMPILE_FILE(init_post); - deleteVehicle GVAR(init_obj2);GVAR(init_obj2) = nil; + call COMPILE_FILE(init_post); + deleteVehicle GVAR(init_obj2);GVAR(init_obj2) = nil; }]; // Schedule PostInit SLX_XEH_STR spawn { - // Warn if PostInit takes longer than 10 tickTime seconds - SLX_XEH_STR spawn { - private["_time2Wait"]; - _time2Wait = diag_ticktime + 10; - waituntil {diag_ticktime > _time2Wait}; - if !(SLX_XEH_MACHINE select 8) then { - XEH_LOG("WARNING: PostInit did not finish in a timely fashion"); - waitUntil {time > 0}; - // Consider there will be no player if neither PostInit-Ready, nor PlayerCheck-Ready - if !(SLX_XEH_MACHINE select 8 || {SLX_XEH_MACHINE select 5}) then { SLX_XEH_MACHINE set [13, true]; }; - }; - }; + // Warn if PostInit takes longer than 10 tickTime seconds + SLX_XEH_STR spawn { + private["_time2Wait"]; + _time2Wait = diag_ticktime + 10; + waituntil {diag_ticktime > _time2Wait}; + if !(SLX_XEH_MACHINE select 8) then { + XEH_LOG("WARNING: PostInit did not finish in a timely fashion"); + waitUntil {time > 0}; + // Consider there will be no player if neither PostInit-Ready, nor PlayerCheck-Ready + if !(SLX_XEH_MACHINE select 8 || {SLX_XEH_MACHINE select 5}) then { SLX_XEH_MACHINE set [13, true]; }; + }; + }; - // On Server + Non JIP Client, we are now after all objects have inited - // and at the briefing, still time == 0 - if (isNull player) then { - #ifdef DEBUG_MODE_FULL - "NULL PLAYER" call SLX_XEH_LOG; - #endif - if !((SLX_XEH_MACHINE select 4) || {(SLX_XEH_MACHINE select 6)}) then { // only if MultiPlayer and not dedicated - #ifdef DEBUG_MODE_FULL - "JIP" call SLX_XEH_LOG; - #endif - - SLX_XEH_MACHINE set [1, true]; // set JIP - // TEST for weird jip-is-server-issue :S - if (!(SLX_XEH_MACHINE select 2) || {SLX_XEH_MACHINE select 3} || {SLX_XEH_MACHINE select 4}) then { - str(["WARNING: JIP Client, yet wrong detection", SLX_XEH_MACHINE]) call SLX_XEH_LOG; - SLX_XEH_MACHINE set [2, true]; // set Dedicated client - SLX_XEH_MACHINE set [3, false]; // set server - SLX_XEH_MACHINE set [4, false]; // set dedicatedserver - }; - waitUntil { !(isNull player) || {SLX_XEH_MACHINE select 13} }; - if (SLX_XEH_MACHINE select 13) then { XEH_LOG("WARNING: TimedOut waiting for player object to be ready. Continueing PostInit without Player ready") }; - }; - }; - - if !(isNull player) then { - if (isNull (group player) && {player isKindOf "CAManBase"}) then { - // DEBUG TEST: Crashing due to JIP, or when going from briefing - // into game - #ifdef DEBUG_MODE_FULL - "NULLGROUP" call SLX_XEH_LOG; - #endif - waitUntil { !(isNull (group player)) }; - }; - waitUntil { local player }; - }; + // On Server + Non JIP Client, we are now after all objects have inited + // and at the briefing, still time == 0 + if (isNull player) then { + #ifdef DEBUG_MODE_FULL + "NULL PLAYER" call SLX_XEH_LOG; + #endif + if !((SLX_XEH_MACHINE select 4) || {(SLX_XEH_MACHINE select 6)}) then { // only if MultiPlayer and not dedicated + #ifdef DEBUG_MODE_FULL + "JIP" call SLX_XEH_LOG; + #endif - GVAR(init_obj2) setDamage 1; // Schedule to run itsy bitsy later + // TEST for weird jip-is-server-issue :S + if (!(SLX_XEH_MACHINE select 2) || {SLX_XEH_MACHINE select 3} || {SLX_XEH_MACHINE select 4}) then { + str(["WARNING: JIP Client, yet wrong detection", SLX_XEH_MACHINE]) call SLX_XEH_LOG; + SLX_XEH_MACHINE set [2, true]; // set Dedicated client + SLX_XEH_MACHINE set [3, false]; // set server + SLX_XEH_MACHINE set [4, false]; // set dedicatedserver + }; + waitUntil { !(isNull player) || {SLX_XEH_MACHINE select 13} }; + if (SLX_XEH_MACHINE select 13) then { XEH_LOG("WARNING: TimedOut waiting for player object to be ready. Continueing PostInit without Player ready") }; + }; + }; - SLX_XEH_MACHINE set [5, true]; // set player check = complete + if !(isNull player) then { + if (isNull (group player) && {player isKindOf "CAManBase"}) then { + // DEBUG TEST: Crashing due to JIP, or when going from briefing + // into game + #ifdef DEBUG_MODE_FULL + "NULLGROUP" call SLX_XEH_LOG; + #endif + waitUntil { !(isNull (group player)) }; + }; + waitUntil { local player }; + }; + + // set JIP + SLX_XEH_MACHINE set [1, !isDedicated && getClientState in ["BRIEFING SHOWN","BRIEFING READ","GAME FINISHED","DEBRIEFING READ"]]; + + GVAR(init_obj2) setDamage 1; // Schedule to run itsy bitsy later + + SLX_XEH_MACHINE set [5, true]; // set player check = complete }; // Load and call any "pre-init", run-once event handlers /* - Compile code strings in the Extended_PreInit_EventHandlers class and call - them. This is done once per mission and before any extended init event - handler code is run. An addon maker can put run-once initialisation code - in such a pre-init "EH" rather than in a normal XEH init EH which might be - called several times. + Compile code strings in the Extended_PreInit_EventHandlers class and call + them. This is done once per mission and before any extended init event + handler code is run. An addon maker can put run-once initialisation code + in such a pre-init "EH" rather than in a normal XEH init EH which might be + called several times. */ { (_x/SLX_XEH_STR_PreInit) call FUNC(init_once) } forEach SLX_XEH_CONFIG_FILES; diff --git a/tools/cba/addons/xeh/script_xeh.hpp b/tools/cba/addons/xeh/script_xeh.hpp index ec7a1d8b88..ba55dbc917 100644 --- a/tools/cba/addons/xeh/script_xeh.hpp +++ b/tools/cba/addons/xeh/script_xeh.hpp @@ -1,8 +1,14 @@ +/* + Header: script_xeh.hpp + + Description: + Used internally. +*/ ///////////////////////////////////////////////////////////////////////////////// // MACRO: EXTENDED_EVENTHANDLERS -// XEH uses all existing event handlers +// Add all XEH event handlers ///////////////////////////////////////////////////////////////////////////////// -#define EXTENDED_EVENTHANDLERS init = QUOTE(if(isNil'SLX_XEH_MACHINE')then{call compile preProcessFileLineNumbers '\x\cba\addons\xeh\init_pre.sqf'};_this call SLX_XEH_EH_Init); \ +#define EXTENDED_EVENTHANDLERS init = "_this call SLX_XEH_EH_Init"; \ fired = "_this call SLX_XEH_EH_Fired"; \ animChanged = "_this call SLX_XEH_EH_AnimChanged"; \ animDone = "_this call SLX_XEH_EH_AnimDone"; \ @@ -45,22 +51,25 @@ weaponDisAssembled = "_this call SLX_XEH_EH_WeaponDisassembled"; -///////////////////////////////////////////////////////////////////////////////// -// MACRO: DELETE_EVENTHANDLERS -// -// Example: -// -// class DefaultEventhandlers; -// class Car_F; -// class MRAP_01_base_F: Car_F { -// class EventHandlers; -// }; -// class B_MRAP_01_F: MRAP_01_base_F { -// class Eventhandlers: EventHandlers { -// DELETE_EVENTHANDLERS -// }; -// }; -///////////////////////////////////////////////////////////////////////////////// +/* + MACRO: DELETE_EVENTHANDLERS + + Removes all event handlers. + + Example: + (begin example) + class DefaultEventhandlers; + class Car_F; + class MRAP_01_base_F: Car_F { + class EventHandlers; + }; + class B_MRAP_01_F: MRAP_01_base_F { + class Eventhandlers: EventHandlers { + DELETE_EVENTHANDLERS + }; + }; + (end example) +*/ #define DELETE_EVENTHANDLERS delete init; \ delete fired; \ From 0cfb492916ba7d58865bbaf617432e9c82681147 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Wed, 26 Aug 2015 10:04:51 +0200 Subject: [PATCH 022/132] Fixes and removal of duplicate code --- .../fnc_actionCheckBloodPressureLocal.sqf | 2 +- addons/medical/functions/fnc_createLitter.sqf | 6 +- .../fnc_displayPatientInformation.sqf | 6 +- addons/medical/functions/fnc_handleDamage.sqf | 87 +++------ .../functions/fnc_handleDamage_advanced.sqf | 8 +- .../functions/fnc_handleDamage_basic2.sqf | 170 +++--------------- .../functions/fnc_handleDamage_caching.sqf | 20 ++- .../functions/fnc_handleDamage_wounds.sqf | 4 + .../fnc_treatmentAdvanced_bandage.sqf | 2 +- .../fnc_treatmentAdvanced_bandageLocal.sqf | 4 +- 10 files changed, 80 insertions(+), 229 deletions(-) diff --git a/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf b/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf index c4c90845fd..6f58683d61 100644 --- a/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf +++ b/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf @@ -22,7 +22,7 @@ _bloodPressure = if (!alive _target) then { } else { [_target] call FUNC(getBloodPressure) }; -_bloodPressure params ["_bloodPressureLow", "_bloodPressureLow"]; +_bloodPressure params ["_bloodPressureHigh", "_bloodPressureLow"]; _output = ""; _logOutPut = ""; if ([_caller] call FUNC(isMedic)) then { diff --git a/addons/medical/functions/fnc_createLitter.sqf b/addons/medical/functions/fnc_createLitter.sqf index b25a3bbf94..c234574abc 100644 --- a/addons/medical/functions/fnc_createLitter.sqf +++ b/addons/medical/functions/fnc_createLitter.sqf @@ -39,7 +39,7 @@ _litter = getArray (_config >> "litter"); _createLitter = { private["_position", "_direction"]; - params ["_unit", "_litter"]; + params ["_unit", "_litterClass"]; // @TODO: handle carriers over water // For now, don't spawn litter if we are over water to avoid floating litter if(surfaceIsWater (getPos _unit)) exitWith { false }; @@ -55,7 +55,7 @@ _createLitter = { // Create the litter, and timeout the event based on the cleanup delay // The cleanup delay for events in MP is handled by the server side - [QGVAR(createLitter), [_litterClass,_position,_direction], 0] call EFUNC(common,syncedEvent); + [QGVAR(createLitter), [_litterClass, _position, _direction], 0] call EFUNC(common,syncedEvent); true }; @@ -65,7 +65,7 @@ _createdLitter = []; if (typeName _x == "ARRAY") then { if (count _x < MIN_ENTRIES_LITTER_CONFIG) exitwith {}; - params ["_selection", "_litterCondition", "_litterOptions"]; + _x params ["_selection", "_litterCondition", "_litterOptions"]; if (toLower _selection in [toLower _selectionName, "all"]) then { // in is case sensitve. We can be forgiving here, so lets use toLower. diff --git a/addons/medical/functions/fnc_displayPatientInformation.sqf b/addons/medical/functions/fnc_displayPatientInformation.sqf index 82622bdca6..934bcc72dc 100644 --- a/addons/medical/functions/fnc_displayPatientInformation.sqf +++ b/addons/medical/functions/fnc_displayPatientInformation.sqf @@ -18,8 +18,8 @@ // Exit for basic medical if (GVAR(level) < 2) exitWith {}; -private ["_target", "_show", "_selectionN", "_amountOfGeneric", "_bandagedwounds", "_logCtrl", "_part", "_partText", "_pointDamage", "_severity", "_total", "_totalIvVolume", "_triageStatus", "_type"]; -params ["_target", ["_target", true], ["_selectionN", 0]]; +private ["_amountOfGeneric", "_bandagedwounds", "_logCtrl", "_part", "_partText", "_pointDamage", "_severity", "_total", "_totalIvVolume", "_triageStatus", "_type"]; +params ["_target", ["_show", true], ["_selectionN", 0]]; GVAR(currentSelectedSelectionN) = if (typeName _selectionN == "SCALAR") then {_selectionN} else {0}; GVAR(displayPatientInformationTarget) = if (_show) then {_target} else {ObjNull}; @@ -203,7 +203,7 @@ if (_show) then { _logs = _target getvariable [QGVAR(logFile_Activity), []]; { // [_message,_moment,_type, _arguments] - _x params ["_message", "_moment", "_arguments"]; + _x params ["_message", "_moment", "_type", "_arguments"]; if (isLocalized _message) then { _message = localize _message; }; diff --git a/addons/medical/functions/fnc_handleDamage.sqf b/addons/medical/functions/fnc_handleDamage.sqf index eb6c2aa9b2..444643c806 100644 --- a/addons/medical/functions/fnc_handleDamage.sqf +++ b/addons/medical/functions/fnc_handleDamage.sqf @@ -31,79 +31,46 @@ if (typeName _projectile == "OBJECT") then { if !(_selection in (GVAR(SELECTIONS) + [""])) exitWith {0}; // Exit if we disable damage temporarily -_damageOld = damage _unit; -if (_selection in GVAR(SELECTIONS)) then { - _damageOld = _unit getHit _selection; +if !(_unit getVariable [QGVAR(allowDamage), true]) exitWith { + _damageOld = damage _unit; + if (_selection in GVAR(SELECTIONS)) then { + _damageOld = _unit getHit _selection; + }; + _damageOld; }; -if !(_unit getVariable [QGVAR(allowDamage), true]) exitWith {_damageOld}; // Get return damage _damageReturn = _damage; -if (GVAR(level) < 2) then { - _newDamage = _this call FUNC(handleDamage_basic2); - _projectile = _this select 4; - _typeOfDamage = [_projectile] call FUNC(getTypeOfDamage); - _typeIndex = (GVAR(allAvailableDamageTypes) find _typeOfDamage); - _minLethalDamage = 0.01; - if (_typeIndex >= 0) then { - _minLethalDamage = GVAR(minLethalDamages) select _typeIndex; +_newDamage = _this call FUNC(handleDamage_caching); +// handleDamage_caching may have modified the projectile string +_typeOfDamage = [_projectile] call FUNC(getTypeOfDamage); + +_typeIndex = (GVAR(allAvailableDamageTypes) find _typeOfDamage); +_minLethalDamage = 0.01; +if (_typeIndex >= 0) then { + _minLethalDamage = GVAR(minLethalDamages) select _typeIndex; +}; + +if (vehicle _unit != _unit && {!(vehicle _unit isKindOf "StaticWeapon")} && {isNull _shooter} && {_projectile == ""} && {_selection == ""}) then { + if (GVAR(enableVehicleCrashes)) then { + _selection = GVAR(SELECTIONS) select (floor(random(count GVAR(SELECTIONS)))); }; +}; - if (vehicle _unit != _unit && {!(vehicle _unit isKindOf "StaticWeapon")} && {isNull _shooter} && {_projectile == ""} && {_selection == ""}) then { - if (GVAR(enableVehicleCrashes)) then { - _selection = GVAR(SELECTIONS) select (floor(random(count GVAR(SELECTIONS)))); - }; +if ((_minLethalDamage <= _newDamage) && {[_unit, [_selection] call FUNC(selectionNameToNumber), _newDamage] call FUNC(determineIfFatal)}) then { + if ((_unit getVariable [QGVAR(preventInstaDeath), GVAR(preventInstaDeath)])) exitwith { + _damageReturn = 0.9; }; - - if ((_minLethalDamage <= _newDamage) && {[_unit, [_selection] call FUNC(selectionNameToNumber), _newDamage] call FUNC(determineIfFatal)}) then { - if ((_unit getVariable [QGVAR(preventInstaDeath), GVAR(preventInstaDeath)])) exitwith { - _damageReturn = 0.9; - }; - if ([_unit] call FUNC(setDead)) then { - _damageReturn = 1; - } else { - _damageReturn = _damageReturn min 0.89; - }; + if ([_unit] call FUNC(setDead)) then { + _damageReturn = 1; } else { _damageReturn = _damageReturn min 0.89; }; } else { - if !([_unit] call FUNC(hasMedicalEnabled)) exitwith { - // Because of the config changes, we cannot properly disable the medical system for a unit. - // lets use basic for the ACE_time being.. - _damageReturn = _this call FUNC(handleDamage_basic); - }; - _newDamage = _this call FUNC(handleDamage_caching); - // handleDamage_caching may have modified the projectile string - _typeOfDamage = [_projectile] call FUNC(getTypeOfDamage); - - _typeIndex = (GVAR(allAvailableDamageTypes) find _typeOfDamage); - _minLethalDamage = 0.01; - if (_typeIndex >= 0) then { - _minLethalDamage = GVAR(minLethalDamages) select _typeIndex; - }; - - if (vehicle _unit != _unit && {!(vehicle _unit isKindOf "StaticWeapon")} && {isNull _shooter} && {_projectile == ""} && {_selection == ""}) then { - if (GVAR(enableVehicleCrashes)) then { - _selection = GVAR(SELECTIONS) select (floor(random(count GVAR(SELECTIONS)))); - }; - }; - - if ((_minLethalDamage <= _newDamage) && {[_unit, [_selection] call FUNC(selectionNameToNumber), _newDamage] call FUNC(determineIfFatal)}) then { - if ((_unit getVariable [QGVAR(preventInstaDeath), GVAR(preventInstaDeath)])) exitwith { - _damageReturn = 0.9; - }; - if ([_unit] call FUNC(setDead)) then { - _damageReturn = 1; - } else { - _damageReturn = _damageReturn min 0.89; - }; - } else { - _damageReturn = _damageReturn min 0.89; - }; - + _damageReturn = _damageReturn min 0.89; }; + [_unit] call FUNC(addToInjuredCollection); if (_unit getVariable [QGVAR(preventInstaDeath), GVAR(preventInstaDeath)]) exitWith { diff --git a/addons/medical/functions/fnc_handleDamage_advanced.sqf b/addons/medical/functions/fnc_handleDamage_advanced.sqf index f1ba5cc6f0..09ea6cd3db 100644 --- a/addons/medical/functions/fnc_handleDamage_advanced.sqf +++ b/addons/medical/functions/fnc_handleDamage_advanced.sqf @@ -20,7 +20,7 @@ #include "script_component.hpp" private ["_typeOfProjectile", "_part", "_damageBodyParts", "_hitPoints"]; -params ["_unit", "_selectionName", "_amountOfDamage", "_sourceOfDamage", "_typeOfDamage", "_newDamage"]; +params ["_unit", "_selectionName", "_amountOfDamage", "_sourceOfDamage", "_typeOfProjectile", "_newDamage"]; // Most likely taking exessive fire damage. Lets exit. if (isNull _sourceOfDamage && {_typeOfProjectile == ""} && {vehicle _unit == _unit} && {(_selectionName == "head" || isBurning _unit)}) exitwith {}; @@ -35,7 +35,11 @@ _damageBodyParts set [_part, (_damageBodyParts select _part) + _newDamage]; _unit setvariable [QGVAR(bodyPartStatus), _damageBodyParts, true]; _typeOfDamage = [_typeOfProjectile] call FUNC(getTypeOfDamage); -[_unit, _selectionName, _newDamage, _typeOfProjectile, _typeOfDamage] call FUNC(handleDamage_assignWounds); + + +systemChat format["ASSIGNING INJURIES: %1", _unit]; + +[_unit, _selectionName, _newDamage, _typeOfProjectile, _typeOfDamage] call FUNC(handleDamage_wounds); //FUNC(handleDamage_assignWounds); // TODO Disabled until implemented fully //if (GVAR(enableAirway)) then { diff --git a/addons/medical/functions/fnc_handleDamage_basic2.sqf b/addons/medical/functions/fnc_handleDamage_basic2.sqf index 9da6fd405d..3a79b1525f 100644 --- a/addons/medical/functions/fnc_handleDamage_basic2.sqf +++ b/addons/medical/functions/fnc_handleDamage_basic2.sqf @@ -3,12 +3,6 @@ * Cache a handleDamage call to execute it 3 frames later * * Arguments: - * 0: Unit That Was Hit - * 1: Name Of Hit Selection - * 2: Amount Of Damage - * 3: Shooter - * 4: Projectile - * 5: Current damage to be returned * * Return Value: * @@ -18,151 +12,29 @@ #include "script_component.hpp" -private ["_unit", "_selectionName", "_damage", "_source", "_projectile", "_hitSelections", "_hitPoints", "_impactVelocity", "_newDamage", "_cache_hitpoints", "_cache_projectiles", "_cache_params", "_cache_damages"]; -_unit = _this select 0; -_selectionName = _this select 1; -_damage = _this select 2; -_source = _this select 3; -_projectile = _this select 4; +private ["_damageBodyParts", "_cache_params", "_cache_damages"]; +params ["_target"]; -_hitSelections = GVAR(SELECTIONS); -_hitPoints = GVAR(HITPOINTS); +_damageBodyParts = _target getvariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]]; +_cache_params = _target getVariable [QGVAR(cachedHandleDamageParams), []]; +_cache_damages = _target getVariable QGVAR(cachedDamages); -// Calculate change in damage. -_newDamage = _damage - (damage _unit); -if (_selectionName in _hitSelections) then { - _newDamage = _damage - (_unit getHitPointDamage (_hitPoints select (_hitSelections find _selectionName))); -}; - -//_damage = _damage + _newDamage; - -// Check for vehicle crash -if (vehicle _unit != _unit && {!(vehicle _unit isKindOf "StaticWeapon")} && {isNull _source} && {_projectile == ""} && {_selectionName == ""}) then { - if (GVAR(enableVehicleCrashes)) then { - _selectionName = _hitSelections select (floor(random(count _hitSelections))); - _projectile = "vehiclecrash"; - _this set [1, _selectionName]; - _this set [4, _projectile]; +{ + _x params ["_unit","_selectionName","_amountOfDamage","_sourceOfDamage","_typeOfProjectile","_typeOfDamage"]; + if !(isNull _sourceOfDamage && {_typeOfProjectile == ""} && {vehicle _unit == _unit} && {(_selectionName == "head" || isBurning _unit)}) then { + _part = [_selectionName] call FUNC(selectionNameToNumber); + if (_part < 0) exitwith {}; + _damageBodyParts set [_part, (_damageBodyParts select _part) + (_cache_damages select _foreachIndex)]; }; -}; +}foreach _cache_params; +_target setvariable [QGVAR(bodyPartStatus), _damageBodyParts, true]; -// Handle falling damage -_impactVelocity = (velocity _unit) select 2; -if (_impactVelocity < -5 && {vehicle _unit == _unit}) then { - _unit setVariable [QGVAR(isFalling), true]; - _unit setVariable [QGVAR(impactVelocity), _impactVelocity]; -}; -if (_unit getVariable [QGVAR(isFalling), false]) then { - if !(_selectionName in ["", "leg_l", "leg_r"]) then { - if (_selectionName == "body") then { - _newDamage = _newDamage * abs(_unit getVariable [QGVAR(impactVelocity), _impactVelocity]) / 50; - } else { - _newDamage = _newDamage * 0.5; - }; - } else { - if (_selectionName == "") then { - _selectionName = ["leg_l", "leg_r"] select (floor(random 2)); - _this set [1, _selectionName]; - }; - _newDamage = _newDamage * 0.7; - }; - _projectile = "falling"; - _this set [4, "falling"]; -}; +EXPLODE_6_PVT(_damageBodyParts,_headDamage,_torsoDamage,_handsDamageR,_handsDamageL,_legsDamageR,_legsDamageL); +_target setHitPointDamage ["hitHead", _headDamage min 0.95]; +_target setHitPointDamage ["hitBody", _torsoDamage min 0.95]; +_target setHitPointDamage ["hitHands", (_handsDamageR + _handsDamageL) min 0.95]; +_target setHitPointDamage ["hitLegs", (_legsDamageR + _legsDamageL) min 0.95]; -// Finished with the current frame, reset variables -// Note: sometimes handleDamage spans over 2 or even 3 frames. -if (diag_frameno > (_unit getVariable [QGVAR(frameNo_damageCaching), -3]) + 2) then { - _unit setVariable [QGVAR(frameNo_damageCaching), diag_frameno]; - - // handle the cached damages 3 frames later - [{ - params ["_args", "_id"]; - _args params ["_target", "_frameNo"]; - - if (diag_frameno > _frameNo + 2) then { - _target setDamage 0; - - _cache_params = _target getVariable [QGVAR(cachedHandleDamageParams), []]; - _cache_damages = _target getVariable QGVAR(cachedDamages); - _damageBodyParts = _target getvariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]]; - { - _x params ["_unit","_selectionName","_amountOfDamage","_sourceOfDamage","_typeOfProjectile","_typeOfDamage"]; - if !(isNull _sourceOfDamage && {_typeOfProjectile == ""} && {vehicle _unit == _unit} && {(_selectionName == "head" || isBurning _unit)}) then { - _part = [_selectionName] call FUNC(selectionNameToNumber); - if (_part < 0) exitwith {}; - _damageBodyParts set [_part, (_damageBodyParts select _part) + (_cache_damages select _foreachIndex)]; - }; - }foreach _cache_params; - _unit setvariable [QGVAR(bodyPartStatus), _damageBodyParts, true]; - - EXPLODE_6_PVT(_damageBodyParts,_headDamage,_torsoDamage,_handsDamageR,_handsDamageL,_legsDamageR,_legsDamageL); - _target setHitPointDamage ["hitHead", _headDamage min 0.95]; - _target setHitPointDamage ["hitBody", _torsoDamage min 0.95]; - _target setHitPointDamage ["hitHands", (_handsDamageR + _handsDamageL) min 0.95]; - _target setHitPointDamage ["hitLegs", (_legsDamageR + _legsDamageL) min 0.95]; - - { - _target setHitPointDamage [_x, (_damageBodyParts select _foreachIndex) min 0.95]; - }foreach GVAR(HITPOINTS); - [_id] call cba_fnc_removePerFrameHandler; - }; - }, 0, [_unit, diag_frameno] ] call CBA_fnc_addPerFrameHandler; - - _unit setVariable [QGVAR(cachedProjectiles), []]; - _unit setVariable [QGVAR(cachedHitPoints), []]; - _unit setVariable [QGVAR(cachedDamages), []]; - _unit setVariable [QGVAR(cachedHandleDamageParams), []]; -}; - -// Caching of the damage events -if (_selectionName != "") then { - _cache_projectiles = _unit getVariable QGVAR(cachedProjectiles); - private ["_index","_otherDamage"]; - _index = _cache_projectiles find _projectile; - // Check if the current projectile has already been handled once - if (_index >= 0 && {_projectile != "falling"}) exitwith { - _cache_damages = _unit getVariable QGVAR(cachedDamages); - // Find the previous damage this projectile has done - _otherDamage = (_cache_damages select _index); - - // Take the highest damage of the two - if (_newDamage > _otherDamage) then { - _cache_params = _unit getVariable QGVAR(cachedHandleDamageParams); - _cache_hitpoints = _unit getVariable QGVAR(cachedHitPoints); - - private ["_hitPoint", "_restore"]; - // Restore the damage before the previous damage was processed - _hitPoint = _cache_hitpoints select _index; - _restore = ((_unit getHitPointDamage _hitPoint) - _otherDamage) max 0; - _unit setHitPointDamage [_hitPoint, _restore]; - - _cache_hitpoints set [_index, (_hitPoints select (_hitSelections find _selectionName))]; - _cache_damages set [_index, _newDamage]; - _cache_params set[_index, _this]; - - _unit setVariable [QGVAR(cachedProjectiles), _cache_projectiles]; - _unit setVariable [QGVAR(cachedHitPoints), _cache_hitpoints]; - _unit setVariable [QGVAR(cachedDamages), _cache_damages]; - _unit setVariable [QGVAR(cachedHandleDamageParams), _cache_params]; - }; - }; - - _cache_hitpoints = _unit getVariable QGVAR(cachedHitPoints); - _cache_damages = _unit getVariable QGVAR(cachedDamages); - _cache_params = _unit getVariable QGVAR(cachedHandleDamageParams); - - // This is an unhandled projectile - _cache_projectiles pushBack _projectile; - _cache_hitpoints pushBack (_hitPoints select (_hitSelections find _selectionName)); - _cache_damages pushBack _newDamage; - _cache_params pushBack _this; - - // Store the new cached values - _unit setVariable [QGVAR(cachedProjectiles), _cache_projectiles]; - _unit setVariable [QGVAR(cachedHitPoints), _cache_hitpoints]; - _unit setVariable [QGVAR(cachedDamages), _cache_damages]; - _unit setVariable [QGVAR(cachedHandleDamageParams), _cache_params]; -}; - -_newDamage; +{ + _target setHitPointDamage [_x, (_damageBodyParts select _foreachIndex) min 0.95]; +}foreach GVAR(HITPOINTS); diff --git a/addons/medical/functions/fnc_handleDamage_caching.sqf b/addons/medical/functions/fnc_handleDamage_caching.sqf index a9825a5c88..2422dcd9e3 100644 --- a/addons/medical/functions/fnc_handleDamage_caching.sqf +++ b/addons/medical/functions/fnc_handleDamage_caching.sqf @@ -79,15 +79,17 @@ if (diag_frameno > (_unit getVariable [QGVAR(frameNo_damageCaching), -3]) + 2) t if (diag_frameno > _frameno + 2) then { _unit setDamage 0; - _cache_params = _unit getVariable [QGVAR(cachedHandleDamageParams), []]; - _cache_damages = _unit getVariable QGVAR(cachedDamages); - { - _params = _x + [_cache_damages select _foreachIndex]; - _params call FUNC(handleDamage_advanced); - } foreach _cache_params; - - [_unit] call FUNC(handleDamage_advancedSetDamage); - + if (GVAR(level) < 2 || {!([_unit] call FUNC(hasMedicalEnabled))}) then { + [_unit] call FUNC(handleDamage_basic2); + } else { + _cache_params = _unit getVariable [QGVAR(cachedHandleDamageParams), []]; + _cache_damages = _unit getVariable QGVAR(cachedDamages); + { + _params = _x + [_cache_damages select _foreachIndex]; + _params call FUNC(handleDamage_advanced); + } foreach _cache_params; + [_unit] call FUNC(handleDamage_advancedSetDamage); + }; [_idPFH] call CBA_fnc_removePerFrameHandler; }; }, 0, [_unit, diag_frameno] ] call CBA_fnc_addPerFrameHandler; diff --git a/addons/medical/functions/fnc_handleDamage_wounds.sqf b/addons/medical/functions/fnc_handleDamage_wounds.sqf index 4438e9bb90..10aec5c459 100644 --- a/addons/medical/functions/fnc_handleDamage_wounds.sqf +++ b/addons/medical/functions/fnc_handleDamage_wounds.sqf @@ -20,11 +20,15 @@ private ["_bodyPartn", "_injuryTypeInfo", "_allInjuriesForDamageType", "_allPossibleInjuries", "_highestPossibleDamage", "_highestPossibleSpot", "_minDamage", "_openWounds", "_woundID", "_toAddInjury", "_painToAdd", "_bloodLoss", "_bodyPartNToAdd", "_classType", "_damageLevels", "_foundIndex", "_i", "_injury", "_maxDamage", "_pain", "_painLevel", "_selections", "_toAddClassID", "_woundsCreated"]; params ["_unit", "_selectionName", "_damage", "_typeOfProjectile", "_typeOfDamage"]; +systemChat format["input: %1", _this]; +diag_log format["input: %1", _this]; + // Administration for open wounds and ids _openWounds = _unit getvariable[QGVAR(openWounds), []]; _woundID = _unit getvariable[QGVAR(lastUniqueWoundID), 1]; _extensionOutput = "ace_medical" callExtension format ["HandleDamageWounds,%1,%2,%3,%4", _selectionName, _damage, _typeOfDamage, _woundID]; +systemChat format["EXTENSION OUTPUT: %1", _extensionOutput]; _painToAdd = 0; _woundsCreated = []; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf b/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf index f2159c37ef..aa3669c227 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf @@ -17,7 +17,7 @@ */ #include "script_component.hpp" -params ["_caller", "_target", "_selectionName", "_className", "_items", ["_specificSpot", -1]]; +params ["_caller", "_target", "_selectionName", "_className", "_items", "", ["_specificSpot", -1]]; if !([_target] call FUNC(hasMedicalEnabled)) exitwith { _this call FUNC(treatmentBasic_bandage); diff --git a/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf index b36a551458..effa1e74a7 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf @@ -40,7 +40,8 @@ _effectivenessFound = -1; _mostEffectiveInjury = _openWounds select 0; _exit = false; { - params ["", "_classID", "_partX"]; + _x params ["", "_classID", "_partX"]; + diag_log format["OPENWOUND: %1", _x]; // Only parse injuries that are for the selected bodypart. if (_partX == _part) then { _woundEffectivenss = _effectiveness; @@ -56,6 +57,7 @@ _exit = false; }; }; + diag_log format["_specificClass: %1 vs classId %2", _specificClass, _classID]; if (_specificClass == _classID) exitwith { _effectivenessFound = _woundEffectivenss; _mostEffectiveSpot = _foreachIndex; From c0379c78097cc233baf72da9df063f9bc645aef5 Mon Sep 17 00:00:00 2001 From: jonpas Date: Wed, 26 Aug 2015 17:02:29 +0200 Subject: [PATCH 023/132] Updated with correct cargo events and settings category --- addons/repair/ACE_Settings.hpp | 2 +- addons/repair/functions/fnc_addSpareParts.sqf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/repair/ACE_Settings.hpp b/addons/repair/ACE_Settings.hpp index 9116ff61ef..9dbcd21731 100644 --- a/addons/repair/ACE_Settings.hpp +++ b/addons/repair/ACE_Settings.hpp @@ -66,6 +66,6 @@ class ACE_Settings { description = CSTRING(addSpareParts_description); typeName = "BOOL"; value = 1; - category = CSTRING(categoryName); + category = ECSTRING(OptionsMenu,CategoryLogistics); }; }; diff --git a/addons/repair/functions/fnc_addSpareParts.sqf b/addons/repair/functions/fnc_addSpareParts.sqf index 4ec01a6cc1..c7366b27ba 100644 --- a/addons/repair/functions/fnc_addSpareParts.sqf +++ b/addons/repair/functions/fnc_addSpareParts.sqf @@ -42,4 +42,4 @@ if (_part == "") then { if (_part == "") exitWith {}; // Load -["AddCargoItem", [_part, _vehicle, _amount]] call EFUNC(common,localEvent); +["AddCargoByClass", [_part, _vehicle, _amount]] call EFUNC(common,localEvent); From 6d27299883141e48f60b23c66bbaa2a5881e6f94 Mon Sep 17 00:00:00 2001 From: jonpas Date: Wed, 26 Aug 2015 23:43:06 +0200 Subject: [PATCH 024/132] Cleaned up spare parts collection after SettingsInitialized, Check if vehicle already in collection --- addons/repair/XEH_postInit.sqf | 5 ++++- addons/repair/functions/fnc_addSpareParts.sqf | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/addons/repair/XEH_postInit.sqf b/addons/repair/XEH_postInit.sqf index d61f20a31e..7095b0bfd0 100644 --- a/addons/repair/XEH_postInit.sqf +++ b/addons/repair/XEH_postInit.sqf @@ -10,12 +10,15 @@ if (isServer) then { ["SettingsInitialized", { GVAR(settingInitted) = true; // Stop collecting in FUNC(addSpareParts) - // Exit if adding spare parts disabled + // Exit if adding spare parts disabled and clean collection if (!GVAR(addSpareParts)) exitWith {GVAR(addSparePartsCollection) = nil}; // Add spare parts to vehicles in collection { [_x] call FUNC(addSpareParts); } forEach GVAR(addSparePartsCollection); + + // Clean collection + GVAR(addSparePartsCollection) = nil; }] call EFUNC(common,addEventHandler); }; diff --git a/addons/repair/functions/fnc_addSpareParts.sqf b/addons/repair/functions/fnc_addSpareParts.sqf index c7366b27ba..6dfbb49bc0 100644 --- a/addons/repair/functions/fnc_addSpareParts.sqf +++ b/addons/repair/functions/fnc_addSpareParts.sqf @@ -27,7 +27,9 @@ if !(["ace_cargo"] call EFUNC(common,isModLoaded)) exitWith {}; // Collect until SettingsInitialized if (isNil QGVAR(settingInitted)) exitWith { - GVAR(addSparePartsCollection) pushBack _vehicle; + if !(_vehicle in GVAR(addSparePartsCollection)) then { + GVAR(addSparePartsCollection) pushBack _vehicle; + }; }; // Exit if not forced and add spare parts is disabled (after settings initted to make sure it really is) From d56f3cea813733c2ce68ea807804995477d55f7f Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 29 Aug 2015 11:58:03 +0200 Subject: [PATCH 025/132] Added pain and unconsciousness handling for new basic medical code --- .../functions/fnc_handleDamage_basic2.sqf | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/addons/medical/functions/fnc_handleDamage_basic2.sqf b/addons/medical/functions/fnc_handleDamage_basic2.sqf index 3a79b1525f..a4358b42d9 100644 --- a/addons/medical/functions/fnc_handleDamage_basic2.sqf +++ b/addons/medical/functions/fnc_handleDamage_basic2.sqf @@ -24,9 +24,25 @@ _cache_damages = _target getVariable QGVAR(cachedDamages); if !(isNull _sourceOfDamage && {_typeOfProjectile == ""} && {vehicle _unit == _unit} && {(_selectionName == "head" || isBurning _unit)}) then { _part = [_selectionName] call FUNC(selectionNameToNumber); if (_part < 0) exitwith {}; - _damageBodyParts set [_part, (_damageBodyParts select _part) + (_cache_damages select _foreachIndex)]; + + private ["_newDamage", "_pain"]; + _newDamage = (_cache_damages select _foreachIndex); + _damageBodyParts set [_part, (_damageBodyParts select _part) + _newDamage]; + _unit setvariable [QGVAR(bodyPartStatus), _damageBodyParts]; + + if (alive _unit && {!(_unit getvariable ["ACE_isUnconscious", false])}) then { + // If it reaches this, we can assume that the hit did not kill this unit, as this function is called 3 frames after the damage has been passed. + if ([_unit, _part, if (_part > 1) then {_newDamage * 1.3} else {_newDamage * 2}] call FUNC(determineIfFatal)) then { + [_unit] call FUNC(setUnconscious); + }; + }; + _pain = _unit getVariable [QGVAR(pain), 0]; + _pain = _pain + _newDamage * (1 - (_unit getVariable [QGVAR(morphine), 0])); + _unit setVariable [QGVAR(pain), _pain min 1, true]; }; }foreach _cache_params; + +// We broadcast the value across the net here, in order to avoid broadcasting it multiple times earlier in the above code block _target setvariable [QGVAR(bodyPartStatus), _damageBodyParts, true]; EXPLODE_6_PVT(_damageBodyParts,_headDamage,_torsoDamage,_handsDamageR,_handsDamageL,_legsDamageR,_legsDamageL); From 1c9e88f21326aab869fafbc65f907bbee816dd06 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 29 Aug 2015 11:58:28 +0200 Subject: [PATCH 026/132] fixes #1964 --- addons/medical/XEH_postInit.sqf | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/addons/medical/XEH_postInit.sqf b/addons/medical/XEH_postInit.sqf index 6ce81d396d..6760cc201a 100644 --- a/addons/medical/XEH_postInit.sqf +++ b/addons/medical/XEH_postInit.sqf @@ -257,15 +257,29 @@ if (USE_WOUND_EVENT_SYNC) then { }; }; -[ - {(((_this select 0) getvariable [QGVAR(bloodVolume), 100]) < 65)}, - {(((_this select 0) getvariable [QGVAR(pain), 0]) - ((_this select 0) getvariable [QGVAR(painSuppress), 0])) > 0.9}, - {(([_this select 0] call FUNC(getBloodLoss)) > 0.25)}, - {((_this select 0) getvariable [QGVAR(inReviveState), false])}, - {((_this select 0) getvariable [QGVAR(inCardiacArrest), false])}, - {((_this select 0) getvariable ["ACE_isDead", false])}, - {(((_this select 0) getvariable [QGVAR(airwayStatus), 100]) < 80)} -] call FUNC(addUnconsciousCondition); + + +["SettingsInitialized", { + if (GVAR(level) == 2) exitwith { + [ + {(((_this select 0) getvariable [QGVAR(bloodVolume), 100]) < 65)}, + {(((_this select 0) getvariable [QGVAR(pain), 0]) - ((_this select 0) getvariable [QGVAR(painSuppress), 0])) > 0.9}, + {(([_this select 0] call FUNC(getBloodLoss)) > 0.25)}, + {((_this select 0) getvariable [QGVAR(inReviveState), false])}, + {((_this select 0) getvariable [QGVAR(inCardiacArrest), false])}, + {((_this select 0) getvariable ["ACE_isDead", false])}, + {(((_this select 0) getvariable [QGVAR(airwayStatus), 100]) < 80)} + ] call FUNC(addUnconsciousCondition); + }; + + [ + {(((_this select 0) getvariable [QGVAR(bloodVolume), 100]) < 40)}, + {(((_this select 0) getvariable [QGVAR(pain), 0]) - ((_this select 0) getvariable [QGVAR(painSuppress), 0])) > 0.6}, + {(([_this select 0] call FUNC(getBloodLoss)) > 0.1)}, + {((_this select 0) getvariable [QGVAR(inReviveState), false])}, + {((_this select 0) getvariable ["ACE_isDead", false])} + ] call FUNC(addUnconsciousCondition); +}] call FUNC(addEventHandler); // Prevent all types of interaction while unconscious // @todo: probably remove this when CBA keybind hold key works properly From 1a4736e6630150e505d0d174f810c4bc6c7b34cc Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 29 Aug 2015 12:01:00 +0200 Subject: [PATCH 027/132] Clean up --- addons/medical/XEH_postInit.sqf | 2 - addons/medical/XEH_preInit.sqf | 2 - .../functions/fnc_handleDamage_basic.sqf | 205 +++--------------- .../functions/fnc_handleDamage_basic2.sqf | 56 ----- .../functions/fnc_handleDamage_caching.sqf | 2 +- 5 files changed, 36 insertions(+), 231 deletions(-) delete mode 100644 addons/medical/functions/fnc_handleDamage_basic2.sqf diff --git a/addons/medical/XEH_postInit.sqf b/addons/medical/XEH_postInit.sqf index 6760cc201a..d55a66d2b1 100644 --- a/addons/medical/XEH_postInit.sqf +++ b/addons/medical/XEH_postInit.sqf @@ -257,8 +257,6 @@ if (USE_WOUND_EVENT_SYNC) then { }; }; - - ["SettingsInitialized", { if (GVAR(level) == 2) exitwith { [ diff --git a/addons/medical/XEH_preInit.sqf b/addons/medical/XEH_preInit.sqf index 6ae9dbb866..b479383468 100644 --- a/addons/medical/XEH_preInit.sqf +++ b/addons/medical/XEH_preInit.sqf @@ -2,8 +2,6 @@ ADDON = false; -PREP(handleDamage_basic2); - PREP(actionCheckBloodPressure); PREP(actionCheckBloodPressureLocal); PREP(actionCheckPulse); diff --git a/addons/medical/functions/fnc_handleDamage_basic.sqf b/addons/medical/functions/fnc_handleDamage_basic.sqf index a7a2db8bec..cf53ac100f 100644 --- a/addons/medical/functions/fnc_handleDamage_basic.sqf +++ b/addons/medical/functions/fnc_handleDamage_basic.sqf @@ -1,191 +1,56 @@ /* - * Author: KoffeinFlummi - * Basic HandleDamage EH function. + * Author: KoffeinFlummi, Glowbal + * Handle damage basic medical * * Arguments: - * 0: Unit That Was Hit - * 1: Name Of Hit Selection - * 2: Amount Of Damage - * 3: Shooter - * 4: Projectile - * 5: Current damage to be returned * * Return Value: - * Damage To Be Inflicted + * * * Public: No */ #include "script_component.hpp" -#define LEGDAMAGETRESHOLD1 1 -#define LEGDAMAGETRESHOLD2 1.7 -#define ARMDAMAGETRESHOLD1 1 -#define ARMDAMAGETRESHOLD2 1.7 -#define UNCONSCIOUSNESSTRESHOLD 0.7 +private ["_damageBodyParts", "_cache_params", "_cache_damages"]; +params ["_target"]; -private ["_damage", "_armdamage", "_hitPoint", "_index", "_legdamage", "_newDamage", "_otherDamage", "_pain", "_restore"]; -params ["_unit", "_selectionName", "_damage", "_shooter", "_projectile"]; +_damageBodyParts = _target getvariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]]; +_cache_params = _target getVariable [QGVAR(cachedHandleDamageParams), []]; +_cache_damages = _target getVariable QGVAR(cachedDamages); -// Apply damage treshold / coefficient -_threshold = [ - _unit getVariable [QGVAR(damageThreshold), GVAR(AIDamageThreshold)], - _unit getVariable [QGVAR(damageThreshold), GVAR(playerDamageThreshold)] -] select ([_unit] call EFUNC(common,isPlayer)); -if (_selectionName in ["leg_l", "leg_r", "hand_l", "hand_r"]) then {_threshold = _threshold * 1.7}; +{ + _x params ["_unit","_selectionName","_amountOfDamage","_sourceOfDamage","_typeOfProjectile","_typeOfDamage"]; + if !(isNull _sourceOfDamage && {_typeOfProjectile == ""} && {vehicle _unit == _unit} && {(_selectionName == "head" || isBurning _unit)}) then { + _part = [_selectionName] call FUNC(selectionNameToNumber); + if (_part < 0) exitwith {}; -_damage = _damage * (1 / _threshold); + private ["_newDamage", "_pain"]; + _newDamage = (_cache_damages select _foreachIndex); + _damageBodyParts set [_part, (_damageBodyParts select _part) + _newDamage]; + _unit setvariable [QGVAR(bodyPartStatus), _damageBodyParts]; -// This is a new hit, reset variables. -// Note: sometimes handleDamage spans over 2 or even 3 frames. -if (diag_frameno > (_unit getVariable [QGVAR(basic_frameNo), -3]) + 2) then { - _unit setVariable [QGVAR(basic_frameNo), diag_frameno]; - _unit setVariable [QGVAR(isFalling), false]; - _unit setVariable [QGVAR(projectiles), []]; - _unit setVariable [QGVAR(hitPoints), []]; - _unit setVariable [QGVAR(damages), []]; - _unit setVariable [QGVAR(structDamage), 0]; - - if (isnil {_unit getvariable QGVAR(structDamagePFH)}) then { - // Assign orphan structural damage to torso - [{ - private "_damagesum"; - params ["_args", "_idPFH"]; - _args params ["_unit"]; - - if (ACE_diagTime - (_unit getvariable [QGVAR(structDamagePFH),-2]) >= 2) then { - _unit setVariable [QGVAR(structDamagePFH), nil]; - _damagesum = (_unit getHitPointDamage "HitHead") + - (_unit getHitPointDamage "HitBody") + - (_unit getHitPointDamage "HitLeftArm") + - (_unit getHitPointDamage "HitRightArm") + - (_unit getHitPointDamage "HitLeftLeg") + - (_unit getHitPointDamage "HitRightLeg"); - if (_damagesum < 0.06 and damage _unit > 0.06 and alive _unit) then { - // _unit setHitPointDamage ["HitBody", damage _unit]; - }; - [_idPFH] call CBA_fnc_removePerFrameHandler; + if (alive _unit && {!(_unit getvariable ["ACE_isUnconscious", false])}) then { + // If it reaches this, we can assume that the hit did not kill this unit, as this function is called 3 frames after the damage has been passed. + if ([_unit, _part, if (_part > 1) then {_newDamage * 1.3} else {_newDamage * 2}] call FUNC(determineIfFatal)) then { + [_unit] call FUNC(setUnconscious); }; - }, 0, [_unit]] call CBA_fnc_addPerFrameHandler; - }; - _unit setVariable [QGVAR(structDamagePFH), ACE_diagTime]; // Assign starting ACE_time or reset it -}; - -_newDamage = _damage - (damage _unit); -if (_selectionName in GVAR(SELECTIONS)) then { - _newDamage = _damage - (_unit getHitPointDamage (GVAR(HITPOINTS) select (GVAR(SELECTIONS) find _selectionName))); -}; - -_damage = _damage - _newDamage; - - -// Exclude falling damage to everything other than legs and reduce it overall. -if (((velocity _unit) select 2 < -5) and (vehicle _unit == _unit)) then { - _unit setVariable [QGVAR(isFalling), true]; -}; -if (_unit getVariable [QGVAR(isFalling), false] and !(_selectionName in ["", "leg_l", "leg_r"])) exitWith { - (_unit getHitPointDamage (GVAR(HITPOINTS) select (GVAR(SELECTIONS) find _selectionName))) max 0.01; -}; -if (_unit getVariable [QGVAR(isFalling), false]) then { - _newDamage = _newDamage * 0.7; -}; - - -// Make sure there's only one damaged selection per projectile per frame. -if (_selectionName != "" and !(_unit getVariable QGVAR(isFalling))) then { - _cache_projectiles = _unit getVariable QGVAR(projectiles); - _cache_hitpoints = _unit getVariable QGVAR(hitPoints); - _cache_damages = _unit getVariable QGVAR(damages); - if (_projectile in _cache_projectiles) then { - _index = _cache_projectiles find _projectile; - _otherDamage = (_cache_damages select _index); - if (_otherDamage > _newDamage) then { - _newDamage = 0; - } else { - _hitPoint = _cache_hitpoints select _index; - _restore = ((_unit getHitPointDamage _hitPoint) - _otherDamage) max 0; - _unit setHitPointDamage [_hitPoint, _restore]; - // Make entry unfindable - _cache_projectiles set [_index, objNull]; - _cache_projectiles pushBack _projectile; - _cache_hitpoints pushBack (GVAR(HITPOINTS) select (GVAR(SELECTIONS) find _selectionName)); - _cache_damages pushBack _newDamage; }; - } else { - _cache_projectiles pushBack _projectile; - _cache_hitpoints pushBack (GVAR(HITPOINTS) select (GVAR(SELECTIONS) find _selectionName)); - _cache_damages pushBack _newDamage; + _pain = _unit getVariable [QGVAR(pain), 0]; + _pain = _pain + _newDamage * (1 - (_unit getVariable [QGVAR(morphine), 0])); + _unit setVariable [QGVAR(pain), _pain min 1, true]; }; - _unit setVariable [QGVAR(projectiles), _cache_projectiles]; - _unit setVariable [QGVAR(hitPoints), _cache_hitpoints]; - _unit setVariable [QGVAR(damages), _cache_damages]; -}; +}foreach _cache_params; -// Get rid of double structural damage (seriously arma, what the fuck?) -if (_selectionName == "") then { - _cache_structDamage = _unit getVariable QGVAR(structDamage); - if (_newDamage > _cache_structDamage) then { - _unit setVariable [QGVAR(structDamage), _newDamage]; - _newDamage = _newDamage - _cache_structDamage; - } else { - _newDamage = 0; - }; -}; +// We broadcast the value across the net here, in order to avoid broadcasting it multiple times earlier in the above code block +_target setvariable [QGVAR(bodyPartStatus), _damageBodyParts, true]; -if (_selectionName == "") then { - _damage = _damage + (_unit getVariable QGVAR(structDamage)); -} else { - _damage = _damage + _newDamage; -}; +EXPLODE_6_PVT(_damageBodyParts,_headDamage,_torsoDamage,_handsDamageR,_handsDamageL,_legsDamageR,_legsDamageL); +_target setHitPointDamage ["hitHead", _headDamage min 0.95]; +_target setHitPointDamage ["hitBody", _torsoDamage min 0.95]; +_target setHitPointDamage ["hitHands", (_handsDamageR + _handsDamageL) min 0.95]; +_target setHitPointDamage ["hitLegs", (_legsDamageR + _legsDamageL) min 0.95]; -// Leg Damage -_legdamage = (_unit getHitPointDamage "HitLeftLeg") + (_unit getHitPointDamage "HitRightLeg"); -if (_selectionName == "leg_l") then { - _legdamage = _damage + (_unit getHitPointDamage "HitRightLeg"); -}; -if (_selectionName == "leg_r") then { - _legdamage = (_unit getHitPointDamage "HitLeftLeg") + _damage; -}; - -if (_legdamage >= LEGDAMAGETRESHOLD1) then { - _unit setHitPointDamage ["HitLegs", 1]; -} else { - _unit setHitPointDamage ["HitLegs", 0]; -}; -// @todo: force prone for completely fucked up legs. - - -// Arm Damage -_armdamage = (_unit getHitPointDamage "HitLeftArm") + (_unit getHitPointDamage "HitRightArm"); -if (_selectionName == "hand_l") then { - _armdamage = _damage + (_unit getHitPointDamage "HitRightArm"); -}; -if (_selectionName == "hand_r") then { - _armdamage = (_unit getHitPointDamage "HitLeftArm") + _damage; -}; - -if (_armdamage >= ARMDAMAGETRESHOLD1) then { - _unit setHitPointDamage ["HitHands", 1]; -} else { - _unit setHitPointDamage ["HitHands", 0]; -}; -// @todo: Drop weapon for full damage. - - -// Set Pain -if (_selectionName == "") then { - _pain = _unit getVariable [QGVAR(pain), 0]; - _pain = _pain + _newDamage * (1 - (_unit getVariable [QGVAR(morphine), 0])); - _unit setVariable [QGVAR(pain), _pain min 1, true]; -}; - -// Unconsciousness -if (_selectionName == "" and - _damage >= UNCONSCIOUSNESSTRESHOLD and - _damage < 1 and - !(_unit getVariable ["ACE_isUnconscious", False] -)) then { - [_unit, true] call FUNC(setUnconscious); -}; - -_damage +{ + _target setHitPointDamage [_x, (_damageBodyParts select _foreachIndex) min 0.95]; +}foreach GVAR(HITPOINTS); diff --git a/addons/medical/functions/fnc_handleDamage_basic2.sqf b/addons/medical/functions/fnc_handleDamage_basic2.sqf deleted file mode 100644 index a4358b42d9..0000000000 --- a/addons/medical/functions/fnc_handleDamage_basic2.sqf +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Author: KoffeinFlummi, Glowbal - * Cache a handleDamage call to execute it 3 frames later - * - * Arguments: - * - * Return Value: - * - * - * Public: No - */ - -#include "script_component.hpp" - -private ["_damageBodyParts", "_cache_params", "_cache_damages"]; -params ["_target"]; - -_damageBodyParts = _target getvariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]]; -_cache_params = _target getVariable [QGVAR(cachedHandleDamageParams), []]; -_cache_damages = _target getVariable QGVAR(cachedDamages); - -{ - _x params ["_unit","_selectionName","_amountOfDamage","_sourceOfDamage","_typeOfProjectile","_typeOfDamage"]; - if !(isNull _sourceOfDamage && {_typeOfProjectile == ""} && {vehicle _unit == _unit} && {(_selectionName == "head" || isBurning _unit)}) then { - _part = [_selectionName] call FUNC(selectionNameToNumber); - if (_part < 0) exitwith {}; - - private ["_newDamage", "_pain"]; - _newDamage = (_cache_damages select _foreachIndex); - _damageBodyParts set [_part, (_damageBodyParts select _part) + _newDamage]; - _unit setvariable [QGVAR(bodyPartStatus), _damageBodyParts]; - - if (alive _unit && {!(_unit getvariable ["ACE_isUnconscious", false])}) then { - // If it reaches this, we can assume that the hit did not kill this unit, as this function is called 3 frames after the damage has been passed. - if ([_unit, _part, if (_part > 1) then {_newDamage * 1.3} else {_newDamage * 2}] call FUNC(determineIfFatal)) then { - [_unit] call FUNC(setUnconscious); - }; - }; - _pain = _unit getVariable [QGVAR(pain), 0]; - _pain = _pain + _newDamage * (1 - (_unit getVariable [QGVAR(morphine), 0])); - _unit setVariable [QGVAR(pain), _pain min 1, true]; - }; -}foreach _cache_params; - -// We broadcast the value across the net here, in order to avoid broadcasting it multiple times earlier in the above code block -_target setvariable [QGVAR(bodyPartStatus), _damageBodyParts, true]; - -EXPLODE_6_PVT(_damageBodyParts,_headDamage,_torsoDamage,_handsDamageR,_handsDamageL,_legsDamageR,_legsDamageL); -_target setHitPointDamage ["hitHead", _headDamage min 0.95]; -_target setHitPointDamage ["hitBody", _torsoDamage min 0.95]; -_target setHitPointDamage ["hitHands", (_handsDamageR + _handsDamageL) min 0.95]; -_target setHitPointDamage ["hitLegs", (_legsDamageR + _legsDamageL) min 0.95]; - -{ - _target setHitPointDamage [_x, (_damageBodyParts select _foreachIndex) min 0.95]; -}foreach GVAR(HITPOINTS); diff --git a/addons/medical/functions/fnc_handleDamage_caching.sqf b/addons/medical/functions/fnc_handleDamage_caching.sqf index 2422dcd9e3..553c300631 100644 --- a/addons/medical/functions/fnc_handleDamage_caching.sqf +++ b/addons/medical/functions/fnc_handleDamage_caching.sqf @@ -80,7 +80,7 @@ if (diag_frameno > (_unit getVariable [QGVAR(frameNo_damageCaching), -3]) + 2) t _unit setDamage 0; if (GVAR(level) < 2 || {!([_unit] call FUNC(hasMedicalEnabled))}) then { - [_unit] call FUNC(handleDamage_basic2); + [_unit] call FUNC(handleDamage_basic); } else { _cache_params = _unit getVariable [QGVAR(cachedHandleDamageParams), []]; _cache_damages = _unit getVariable QGVAR(cachedDamages); From 1e08244f21a340447b7a4398a1fd21c32ba57700 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 29 Aug 2015 12:59:11 +0200 Subject: [PATCH 028/132] Removed debug output --- addons/medical/functions/fnc_handleDamage_advanced.sqf | 5 +---- addons/medical/functions/fnc_handleDamage_wounds.sqf | 4 ---- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/addons/medical/functions/fnc_handleDamage_advanced.sqf b/addons/medical/functions/fnc_handleDamage_advanced.sqf index 09ea6cd3db..f928732bba 100644 --- a/addons/medical/functions/fnc_handleDamage_advanced.sqf +++ b/addons/medical/functions/fnc_handleDamage_advanced.sqf @@ -36,10 +36,7 @@ _unit setvariable [QGVAR(bodyPartStatus), _damageBodyParts, true]; _typeOfDamage = [_typeOfProjectile] call FUNC(getTypeOfDamage); - -systemChat format["ASSIGNING INJURIES: %1", _unit]; - -[_unit, _selectionName, _newDamage, _typeOfProjectile, _typeOfDamage] call FUNC(handleDamage_wounds); //FUNC(handleDamage_assignWounds); +[_unit, _selectionName, _newDamage, _typeOfProjectile, _typeOfDamage] call FUNC(handleDamage_assignWounds); // TODO Disabled until implemented fully //if (GVAR(enableAirway)) then { diff --git a/addons/medical/functions/fnc_handleDamage_wounds.sqf b/addons/medical/functions/fnc_handleDamage_wounds.sqf index 10aec5c459..4438e9bb90 100644 --- a/addons/medical/functions/fnc_handleDamage_wounds.sqf +++ b/addons/medical/functions/fnc_handleDamage_wounds.sqf @@ -20,15 +20,11 @@ private ["_bodyPartn", "_injuryTypeInfo", "_allInjuriesForDamageType", "_allPossibleInjuries", "_highestPossibleDamage", "_highestPossibleSpot", "_minDamage", "_openWounds", "_woundID", "_toAddInjury", "_painToAdd", "_bloodLoss", "_bodyPartNToAdd", "_classType", "_damageLevels", "_foundIndex", "_i", "_injury", "_maxDamage", "_pain", "_painLevel", "_selections", "_toAddClassID", "_woundsCreated"]; params ["_unit", "_selectionName", "_damage", "_typeOfProjectile", "_typeOfDamage"]; -systemChat format["input: %1", _this]; -diag_log format["input: %1", _this]; - // Administration for open wounds and ids _openWounds = _unit getvariable[QGVAR(openWounds), []]; _woundID = _unit getvariable[QGVAR(lastUniqueWoundID), 1]; _extensionOutput = "ace_medical" callExtension format ["HandleDamageWounds,%1,%2,%3,%4", _selectionName, _damage, _typeOfDamage, _woundID]; -systemChat format["EXTENSION OUTPUT: %1", _extensionOutput]; _painToAdd = 0; _woundsCreated = []; From 6796b3126dcc107f37ceee09445bebcdac8823a9 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 29 Aug 2015 12:59:28 +0200 Subject: [PATCH 029/132] Staged work on fixing updating base classes for hitpoints --- addons/medical/CfgVehicles.hpp | 460 ++++++++++++++++++++++++++++++--- 1 file changed, 431 insertions(+), 29 deletions(-) diff --git a/addons/medical/CfgVehicles.hpp b/addons/medical/CfgVehicles.hpp index 350f83b3f7..278d3523e0 100644 --- a/addons/medical/CfgVehicles.hpp +++ b/addons/medical/CfgVehicles.hpp @@ -417,12 +417,29 @@ class CfgVehicles { #define ARM_LEG_ARMOR_BETTER 3 #define ARM_LEG_ARMOR_CSAT 4 - class Man; - class CAManBase: Man { + class Land; + class Man: Land { class HitPoints { - class HitHead; - class HitBody; - // "DEACTIVE" DEFAULT HITPOINTS + class HitHead { + visual = ""; + armor = 1; + material = -1; + name = "head"; + passThrough = 1; + radius = 0.1; + explosionShielding = 0.5; + minimalHit = 0; + }; + class HitBody { + armor = 1; + material = -1; + name = "body"; + passThrough = 1; + radius = 0.15; + explosionShielding = 10; + visual = "injury_body"; + minimalHit = 0; + }; class HitHands { armor = 999; //armor = 2; explosionShielding = 0; //explosionShielding = 1; @@ -443,6 +460,118 @@ class CfgVehicles { radius = 0; //radius = 0.08; visual = "injury_legs"; }; + }; + }; + class CAManBase: Man { + class HitPoints: HitPoints { + + class HitFace: HitHead { + armor = 999; + material = -1; + name = "face_hub"; + passThrough = 1; + radius = 0.08; + explosionShielding = 0.1; + minimalHit = 0.01; + }; + class HitNeck: HitFace { + armor = 999; + material = -1; + name = "neck"; + passThrough = 1; + radius = 0.08; + explosionShielding = 0.5; + minimalHit = 0.01; + }; + class HitHead: HitNeck { + armor = 1; + material = -1; + name = "head"; + passThrough = 1; + radius = 0.1; + explosionShielding = 0.5; + minimalHit = 0.01; + }; + class HitPelvis: HitBody { + armor = 999; + material = -1; + name = "pelvis"; + passThrough = 1; + radius = 0.15; + explosionShielding = 0.5; + visual = "injury_body"; + minimalHit = 0.01; + }; + class HitAbdomen: HitPelvis { + armor = 999; + material = -1; + name = "spine1"; + passThrough = 1; + radius = 0.15; + explosionShielding = 1; + visual = "injury_body"; + minimalHit = 0.01; + }; + class HitDiaphragm: HitAbdomen { + armor = 999; + material = -1; + name = "spine2"; + passThrough = 1; + radius = 0.15; + explosionShielding = 6; + visual = "injury_body"; + minimalHit = 0.01; + }; + class HitChest: HitDiaphragm { + armor = 999; + material = -1; + name = "spine3"; + passThrough = 1; + radius = 0.15; + explosionShielding = 6; + visual = "injury_body"; + minimalHit = 0.01; + }; + class HitBody: HitChest { + armor = 1; + material = -1; + name = "body"; + passThrough = 1; + radius = 0.15; + explosionShielding = 10; + visual = "injury_body"; + minimalHit = 0.01; + }; + class HitArms: HitHands { + armor = 999; + material = -1; + name = "arms"; + passThrough = 1; + radius = 0.08; + explosionShielding = 1; + visual = "injury_hands"; + minimalHit = 0.01; + }; + class HitHands: HitArms { + armor = 999; + material = -1; + name = "hands"; + passThrough = 1; + radius = 0.08; + explosionShielding = 1; + visual = "injury_hands"; + minimalHit = 0.01; + }; + class HitLegs: HitLegs { + armor = 999; + material = -1; + name = "legs"; + passThrough = 1; + radius = 0.1; + explosionShielding = 1; + visual = "injury_legs"; + minimalHit = 0.01; + }; class HitLeftArm { armor = ARM_LEG_ARMOR_DEFAULT; //2; @@ -529,10 +658,55 @@ class CfgVehicles { class B_Soldier_04_f: B_Soldier_base_F { class HitPoints: HitPoints { - class HitHead: HitHead {}; - class HitBody: HitBody {}; - class HitHands: HitHands {}; - class HitLegs: HitLegs {}; + class HitFace: HitHead { + armor = 999; + }; + class HitNeck: HitFace { + armor = 999; + }; + class HitHead: HitNeck { + armor = 1; + }; + class HitPelvis: HitBody { + armor = 999; + passThrough = 0.5; + explosionShielding = 2.4; + }; + class HitAbdomen: HitPelvis { + armor = 999; + passThrough = 0.5; + explosionShielding = 2.4; + }; + class HitDiaphragm: HitAbdomen { + armor = 999; + passThrough = 0.5; + explosionShielding = 2.4; + }; + class HitChest: HitDiaphragm { + armor = 999; + passThrough = 0.5; + explosionShielding = 2.4; + }; + class HitBody: HitChest { + armor = 2; + passThrough = 0.5; + explosionShielding = 2.4; + }; + class HitArms: HitHands { + armor = 999; + passThrough = 0.5; + explosionShielding = 1.2; + }; + class HitHands: HitArms { + armor = 999; + passThrough = 0.5; + explosionShielding = 1.2; + }; + class HitLegs: HitLegs { + armor = 999; + passThrough = 0.5; + explosionShielding = 1.2; + }; class HitLeftArm: HitLeftArm { armor = ARM_LEG_ARMOR_BETTER; @@ -554,10 +728,56 @@ class CfgVehicles { class B_Soldier_05_f: B_Soldier_base_F { class HitPoints: HitPoints { - class HitHead: HitHead {}; - class HitBody: HitBody {}; - class HitHands: HitHands {}; - class HitLegs: HitLegs {}; + class HitFace: HitHead { + armor = 999; + }; + class HitNeck: HitFace { + armor = 999; + }; + class HitHead: HitNeck { + armor = 1; + }; + class HitPelvis: HitBody { + armor = 999; + passThrough = 0.5; + explosionShielding = 2.4; + }; + class HitAbdomen: HitPelvis { + armor = 999; + passThrough = 0.5; + explosionShielding = 2.4; + }; + class HitDiaphragm: HitAbdomen { + armor = 999; + passThrough = 0.5; + explosionShielding = 2.4; + }; + class HitChest: HitDiaphragm { + armor = 999; + passThrough = 0.5; + explosionShielding = 2.4; + }; + class HitBody: HitChest { + armor = 3; + passThrough = 0.5; + explosionShielding = 2.4; + }; + class HitArms: HitHands { + armor = 999; + passThrough = 0.5; + explosionShielding = 1.2; + }; + class HitHands: HitArms { + armor = 999; + passThrough = 0.5; + explosionShielding = 1.2; + }; + class HitLegs: HitLegs { + armor = 999; + passThrough = 0.5; + explosionShielding = 1.2; + }; + class HitLeftArm: HitLeftArm { armor = ARM_LEG_ARMOR_BETTER; @@ -581,10 +801,55 @@ class CfgVehicles { class I_Soldier_03_F: I_Soldier_base_F { class HitPoints: HitPoints { - class HitHead: HitHead {}; - class HitBody: HitBody {}; - class HitHands: HitHands {}; - class HitLegs: HitLegs {}; + class HitFace: HitHead { + armor = 999; + }; + class HitNeck: HitFace { + armor = 999; + }; + class HitHead: HitNeck { + armor = 1; + }; + class HitPelvis: HitBody { + armor = 999; + passThrough = 0.5; + explosionShielding = 2.4; + }; + class HitAbdomen: HitPelvis { + armor = 999; + passThrough = 0.5; + explosionShielding = 2.4; + }; + class HitDiaphragm: HitAbdomen { + armor = 999; + passThrough = 0.5; + explosionShielding = 2.4; + }; + class HitChest: HitDiaphragm { + armor = 999; + passThrough = 0.5; + explosionShielding = 2.4; + }; + class HitBody: HitChest { + armor = 2; + passThrough = 0.5; + explosionShielding = 2.4; + }; + class HitArms: HitHands { + armor = 999; + passThrough = 0.5; + explosionShielding = 1.2; + }; + class HitHands: HitArms { + armor = 999; + passThrough = 0.5; + explosionShielding = 1.2; + }; + class HitLegs: HitLegs { + armor = 999; + passThrough = 0.5; + explosionShielding = 1.2; + }; class HitLeftArm: HitLeftArm { armor = ARM_LEG_ARMOR_BETTER; @@ -606,10 +871,56 @@ class CfgVehicles { class I_Soldier_04_F: I_Soldier_base_F { class HitPoints: HitPoints { - class HitHead: HitHead {}; - class HitBody: HitBody {}; - class HitHands: HitHands {}; - class HitLegs: HitLegs {}; + class HitFace: HitHead { + armor = 999; + }; + class HitNeck: HitFace { + armor = 999; + }; + class HitHead: HitNeck { + armor = 1; + }; + class HitPelvis: HitBody { + armor = 999; + passThrough = 0.5; + explosionShielding = 2.4; + }; + class HitAbdomen: HitPelvis { + armor = 999; + passThrough = 0.5; + explosionShielding = 2.4; + }; + class HitDiaphragm: HitAbdomen { + armor = 999; + passThrough = 0.5; + explosionShielding = 2.4; + }; + class HitChest: HitDiaphragm { + armor = 999; + passThrough = 0.5; + explosionShielding = 2.4; + }; + class HitBody: HitChest { + armor = 3; + passThrough = 0.5; + explosionShielding = 2.4; + }; + class HitArms: HitHands { + armor = 999; + passThrough = 0.5; + explosionShielding = 1.2; + }; + class HitHands: HitArms { + armor = 999; + passThrough = 0.5; + explosionShielding = 1.2; + }; + class HitLegs: HitLegs { + armor = 999; + passThrough = 0.5; + explosionShielding = 1.2; + }; + class HitLeftArm: HitLeftArm { armor = ARM_LEG_ARMOR_BETTER; @@ -631,10 +942,56 @@ class CfgVehicles { class O_Soldier_base_F: SoldierEB { class HitPoints: HitPoints { - class HitHead: HitHead {}; - class HitBody: HitBody {}; - class HitHands: HitHands {}; - class HitLegs: HitLegs {}; + class HitFace: HitHead { + armor = 999; + }; + class HitNeck: HitFace { + armor = 999; + }; + class HitHead: HitNeck { + armor = 1; + }; + class HitPelvis: HitBody { + armor = 999; + passThrough = 0.5; + explosionShielding = 2.4; + }; + class HitAbdomen: HitPelvis { + armor = 999; + passThrough = 0.5; + explosionShielding = 2.4; + }; + class HitDiaphragm: HitAbdomen { + armor = 999; + passThrough = 0.5; + explosionShielding = 2.4; + }; + class HitChest: HitDiaphragm { + armor = 999; + passThrough = 0.5; + explosionShielding = 2.4; + }; + class HitBody: HitChest { + armor = 4; + passThrough = 0.5; + explosionShielding = 2.4; + }; + class HitArms: HitHands { + armor = 999; + passThrough = 0.5; + explosionShielding = 1.2; + }; + class HitHands: HitArms { + armor = 999; + passThrough = 0.5; + explosionShielding = 1.2; + }; + class HitLegs: HitLegs { + armor = 999; + passThrough = 0.5; + explosionShielding = 1.2; + }; + class HitLeftArm: HitLeftArm { armor = ARM_LEG_ARMOR_CSAT; @@ -660,10 +1017,55 @@ class CfgVehicles { class O_Soldier_02_F: O_Soldier_base_F { class HitPoints: HitPoints { - class HitHead: HitHead {}; - class HitBody: HitBody {}; - class HitHands: HitHands {}; - class HitLegs: HitLegs {}; + class HitFace: HitHead { + armor = 999; + }; + class HitNeck: HitFace { + armor = 999; + }; + class HitHead: HitNeck { + armor = 1; + }; + class HitPelvis: HitBody { + armor = 999; + passThrough = 0.5; + explosionShielding = 2.4; + }; + class HitAbdomen: HitPelvis { + armor = 999; + passThrough = 0.5; + explosionShielding = 2.4; + }; + class HitDiaphragm: HitAbdomen { + armor = 999; + passThrough = 0.5; + explosionShielding = 2.4; + }; + class HitChest: HitDiaphragm { + armor = 999; + passThrough = 0.5; + explosionShielding = 2.4; + }; + class HitBody: HitChest { + armor = 4; + passThrough = 0.5; + explosionShielding = 2.4; + }; + class HitArms: HitHands { + armor = 999; + passThrough = 0.5; + explosionShielding = 1.2; + }; + class HitHands: HitArms { + armor = 999; + passThrough = 0.5; + explosionShielding = 1.2; + }; + class HitLegs: HitLegs { + armor = 999; + passThrough = 0.5; + explosionShielding = 1.2; + }; class HitLeftArm: HitLeftArm { armor = ARM_LEG_ARMOR_CSAT; From 8916b70fe11775307f44bfd8dd4157d4da664e04 Mon Sep 17 00:00:00 2001 From: jokoho48 Date: Sat, 29 Aug 2015 15:29:02 +0200 Subject: [PATCH 030/132] Improve some Code --- .../medical/functions/fnc_actionLoadUnit.sqf | 2 +- .../functions/fnc_actionRemoveTourniquet.sqf | 2 +- addons/medical/functions/fnc_addToLog.sqf | 7 ++--- addons/medical/functions/fnc_canTreat.sqf | 7 ++--- .../fnc_displayPatientInformation.sqf | 4 +-- .../medical/functions/fnc_getTypeOfDamage.sqf | 27 +++++++++---------- addons/medical/functions/fnc_handleDamage.sqf | 13 ++++----- 7 files changed, 28 insertions(+), 34 deletions(-) diff --git a/addons/medical/functions/fnc_actionLoadUnit.sqf b/addons/medical/functions/fnc_actionLoadUnit.sqf index 9dc711a5a7..42a94997d8 100644 --- a/addons/medical/functions/fnc_actionLoadUnit.sqf +++ b/addons/medical/functions/fnc_actionLoadUnit.sqf @@ -18,7 +18,7 @@ private "_vehicle"; params ["_caller", "_target"]; if ([_target] call EFUNC(common,isAwake)) exitwith { - ["displayTextStructured", [_caller], [[localize LSTRING(CanNotLoaded), [_target] call EFUNC(common,getName)], 1.5, _caller]] call EFUNC(common,targetEvent); + ["displayTextStructured", [_caller], [[LSTRING(CanNotLoaded), [_target] call EFUNC(common,getName)], 1.5, _caller]] call EFUNC(common,targetEvent); }; if ([_target] call FUNC(isBeingCarried)) then { [_caller, _target] call EFUNC(dragging,dropObject_carry); diff --git a/addons/medical/functions/fnc_actionRemoveTourniquet.sqf b/addons/medical/functions/fnc_actionRemoveTourniquet.sqf index 2a39b63095..b920f276f0 100644 --- a/addons/medical/functions/fnc_actionRemoveTourniquet.sqf +++ b/addons/medical/functions/fnc_actionRemoveTourniquet.sqf @@ -24,7 +24,7 @@ _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 { - _output = localize LSTRING(noTourniquetOnBodyPart); + _output = LSTRING(noTourniquetOnBodyPart); ["displayTextStructured", [_caller], [_output, 1.5, _caller]] call EFUNC(common,targetEvent); }; diff --git a/addons/medical/functions/fnc_addToLog.sqf b/addons/medical/functions/fnc_addToLog.sqf index fff615a5b3..9cac3af5f2 100644 --- a/addons/medical/functions/fnc_addToLog.sqf +++ b/addons/medical/functions/fnc_addToLog.sqf @@ -25,11 +25,8 @@ if (!local _unit) exitwith { date params ["", "", "", "_minute", "_hour"]; -_moment = if (_minute < 10) then { - format["%1:0%2", _hour, _minute] -} else { - format["%1:%2", _hour, _minute] -}; +_moment = format [ (["%1:%2", "%1:0%2"] select (_minute < 10)), _hour, _minute] + _logVarName = format[QGVAR(logFile_%1), _type]; _log = _unit getvariable [_logVarName, []]; diff --git a/addons/medical/functions/fnc_canTreat.sqf b/addons/medical/functions/fnc_canTreat.sqf index e1817d21fe..ff191ea7ca 100644 --- a/addons/medical/functions/fnc_canTreat.sqf +++ b/addons/medical/functions/fnc_canTreat.sqf @@ -22,11 +22,8 @@ params ["_caller", "_target", "_selectionName", "_className"]; if !(_target isKindOf "CAManBase") exitWith { false }; -_config = if (GVAR(level)>=2) then { - (ConfigFile >> "ACE_Medical_Actions" >> "Advanced" >> _className) -} else { - (ConfigFile >> "ACE_Medical_Actions" >> "Basic" >> _className) -}; +_config = (ConfigFile >> "ACE_Medical_Actions" >> (["Basic", "Advanced"] select (GVAR(level)>=2)) >> _className); + if !(isClass _config) exitwith {false}; _medicRequired = if (isNumber (_config >> "requiredMedic")) then { diff --git a/addons/medical/functions/fnc_displayPatientInformation.sqf b/addons/medical/functions/fnc_displayPatientInformation.sqf index 934bcc72dc..f73376cb29 100644 --- a/addons/medical/functions/fnc_displayPatientInformation.sqf +++ b/addons/medical/functions/fnc_displayPatientInformation.sqf @@ -21,8 +21,8 @@ if (GVAR(level) < 2) exitWith {}; private ["_amountOfGeneric", "_bandagedwounds", "_logCtrl", "_part", "_partText", "_pointDamage", "_severity", "_total", "_totalIvVolume", "_triageStatus", "_type"]; params ["_target", ["_show", true], ["_selectionN", 0]]; -GVAR(currentSelectedSelectionN) = if (typeName _selectionN == "SCALAR") then {_selectionN} else {0}; -GVAR(displayPatientInformationTarget) = if (_show) then {_target} else {ObjNull}; +GVAR(currentSelectedSelectionN) = [0, _selectionN] select (IS_SCALAR(_selectionN)); +GVAR(displayPatientInformationTarget) = [ObjNull, _target] select _show; if (USE_WOUND_EVENT_SYNC) then { [_target, ACE_player] call FUNC(requestWoundSync); diff --git a/addons/medical/functions/fnc_getTypeOfDamage.sqf b/addons/medical/functions/fnc_getTypeOfDamage.sqf index d0aff19cc4..afa687f137 100644 --- a/addons/medical/functions/fnc_getTypeOfDamage.sqf +++ b/addons/medical/functions/fnc_getTypeOfDamage.sqf @@ -15,17 +15,16 @@ params ["_typeOfProjectile"]; -call { - if (_typeOfProjectile isKindOf "BulletBase") exitWith {"bullet"}; - if (_typeOfProjectile isKindOf "GrenadeCore") exitWith {"grenade"}; - if (_typeOfProjectile isKindOf "TimeBombCore") exitWith {"explosive"}; - if (_typeOfProjectile isKindOf "MineCore") exitWith {"explosive"}; - if (_typeOfProjectile isKindOf "FuelExplosion") exitWith {"explosive"}; - if (_typeOfProjectile isKindOf "ShellBase") exitWith {"shell"}; - if (_typeOfProjectile isKindOf "RocketBase") exitWith {"explosive"}; - if (_typeOfProjectile isKindOf "MissileBase") exitWith {"explosive"}; - if (_typeOfProjectile isKindOf "LaserBombCore") exitWith {"explosive"}; - if (_typeOfProjectile isKindOf "BombCore") exitWith {"explosive"}; - if (_typeOfProjectile isKindOf "Grenade") exitWith {"grenade"}; - toLower _typeOfProjectile -} + +if (_typeOfProjectile isKindOf "BulletBase") exitWith {"bullet"}; +if (_typeOfProjectile isKindOf "GrenadeCore") exitWith {"grenade"}; +if (_typeOfProjectile isKindOf "TimeBombCore") exitWith {"explosive"}; +if (_typeOfProjectile isKindOf "MineCore") exitWith {"explosive"}; +if (_typeOfProjectile isKindOf "FuelExplosion") exitWith {"explosive"}; +if (_typeOfProjectile isKindOf "ShellBase") exitWith {"shell"}; +if (_typeOfProjectile isKindOf "RocketBase") exitWith {"explosive"}; +if (_typeOfProjectile isKindOf "MissileBase") exitWith {"explosive"}; +if (_typeOfProjectile isKindOf "LaserBombCore") exitWith {"explosive"}; +if (_typeOfProjectile isKindOf "BombCore") exitWith {"explosive"}; +if (_typeOfProjectile isKindOf "Grenade") exitWith {"grenade"}; +toLower _typeOfProjectile diff --git a/addons/medical/functions/fnc_handleDamage.sqf b/addons/medical/functions/fnc_handleDamage.sqf index 444643c806..1f484ab056 100644 --- a/addons/medical/functions/fnc_handleDamage.sqf +++ b/addons/medical/functions/fnc_handleDamage.sqf @@ -32,11 +32,11 @@ if !(_selection in (GVAR(SELECTIONS) + [""])) exitWith {0}; // Exit if we disable damage temporarily if !(_unit getVariable [QGVAR(allowDamage), true]) exitWith { - _damageOld = damage _unit; if (_selection in GVAR(SELECTIONS)) then { - _damageOld = _unit getHit _selection; + _unit getHit _selection + } else { + damage _unit }; - _damageOld; }; // Get return damage @@ -47,9 +47,10 @@ _newDamage = _this call FUNC(handleDamage_caching); _typeOfDamage = [_projectile] call FUNC(getTypeOfDamage); _typeIndex = (GVAR(allAvailableDamageTypes) find _typeOfDamage); -_minLethalDamage = 0.01; -if (_typeIndex >= 0) then { - _minLethalDamage = GVAR(minLethalDamages) select _typeIndex; +_minLethalDamage = if (_typeIndex >= 0) then { + GVAR(minLethalDamages) select _typeIndex +} else { + 0.01 }; if (vehicle _unit != _unit && {!(vehicle _unit isKindOf "StaticWeapon")} && {isNull _shooter} && {_projectile == ""} && {_selection == ""}) then { From 321ca815a2cac7fc45844211258c09afb7a7917b Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 29 Aug 2015 09:52:28 -0500 Subject: [PATCH 031/132] semi-colon --- addons/medical/functions/fnc_addToLog.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical/functions/fnc_addToLog.sqf b/addons/medical/functions/fnc_addToLog.sqf index 9cac3af5f2..3b071948f3 100644 --- a/addons/medical/functions/fnc_addToLog.sqf +++ b/addons/medical/functions/fnc_addToLog.sqf @@ -25,7 +25,7 @@ if (!local _unit) exitwith { date params ["", "", "", "_minute", "_hour"]; -_moment = format [ (["%1:%2", "%1:0%2"] select (_minute < 10)), _hour, _minute] +_moment = format [ (["%1:%2", "%1:0%2"] select (_minute < 10)), _hour, _minute]; _logVarName = format[QGVAR(logFile_%1), _type]; From 183e872f1ff879eafa9a82f852f0a5b92b5d01de Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 29 Aug 2015 22:44:52 +0200 Subject: [PATCH 032/132] Possible fix for #2298 --- .../medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf index effa1e74a7..0b5a0a9973 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf @@ -99,8 +99,7 @@ if (GVAR(healHitPointAfterAdvBandage) && {{(_x select 2) == _part && {_x select _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]; + _target setHitPointDamage [_point, 0]; }; true; From b291141d11a73035fe8a024d98869fee531f8c9b Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 29 Aug 2015 22:51:42 +0200 Subject: [PATCH 033/132] Should Be a better fix for #2298 --- addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf index 0b5a0a9973..0b19c05b03 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf @@ -95,7 +95,7 @@ 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 (GVAR(healHitPointAfterAdvBandage) && {{(_x select 2) == _part && {_x select 3 > 0}}count _openWounds == 0}) then { +if (GVAR(healHitPointAfterAdvBandage) && {{(_x select 2) == _part && {((_x select 4) * (_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); From ce42f5864fbcd51f718d82935efe19f11b6ec905 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 29 Aug 2015 22:53:08 +0200 Subject: [PATCH 034/132] fix #2155 --- addons/medical/functions/fnc_getBloodPressure.sqf | 2 +- addons/medical/functions/fnc_handleUnitVitals.sqf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/medical/functions/fnc_getBloodPressure.sqf b/addons/medical/functions/fnc_getBloodPressure.sqf index 2ba0b7366d..659949d716 100644 --- a/addons/medical/functions/fnc_getBloodPressure.sqf +++ b/addons/medical/functions/fnc_getBloodPressure.sqf @@ -30,4 +30,4 @@ _resistance = _unit getvariable [QGVAR(peripheralResistance), 100]; _bloodPressureHigh = (_cardiacOutput * MODIFIER_BP_HIGH) * _resistance; _bloodPressureLow = (_cardiacOutput * MODIFIER_BP_LOW) * _resistance; -[_bloodPressureLow, _bloodPressureHigh] +[_bloodPressureLow max 0, _bloodPressureHigh max 0] diff --git a/addons/medical/functions/fnc_handleUnitVitals.sqf b/addons/medical/functions/fnc_handleUnitVitals.sqf index cbb8f6fdcc..db312eea34 100644 --- a/addons/medical/functions/fnc_handleUnitVitals.sqf +++ b/addons/medical/functions/fnc_handleUnitVitals.sqf @@ -104,7 +104,7 @@ if (GVAR(level) >= 2) then { // Set the vitals _heartRate = (_unit getvariable [QGVAR(heartRate), 80]) + (([_unit] call FUNC(getHeartRateChange)) * _interval); - _unit setvariable [QGVAR(heartRate), _heartRate, _syncValues]; + _unit setvariable [QGVAR(heartRate), _heartRate max 0, _syncValues]; _bloodPressure = [_unit] call FUNC(getBloodPressure); _unit setvariable [QGVAR(bloodPressure), _bloodPressure, _syncValues]; From 602ef690fcf59f8eb19f983827add5548fba5970 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 29 Aug 2015 22:54:51 +0200 Subject: [PATCH 035/132] Allow diagnose on torso #1879 --- addons/medical/ACE_Medical_Treatments.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical/ACE_Medical_Treatments.hpp b/addons/medical/ACE_Medical_Treatments.hpp index b96dcaf21b..18fd875bf6 100644 --- a/addons/medical/ACE_Medical_Treatments.hpp +++ b/addons/medical/ACE_Medical_Treatments.hpp @@ -93,7 +93,7 @@ class ACE_Medical_Actions { displayNameProgress = CSTRING(Actions_Diagnosing); category = "examine"; treatmentLocations[] = {"All"}; - allowedSelections[] = {"head"}; + allowedSelections[] = {"head", "body"}; requiredMedic = 0; treatmentTime = 1; items[] = {}; From 2fd30ba20c134d1b208089265739cf3787d02c65 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 29 Aug 2015 22:57:52 +0200 Subject: [PATCH 036/132] fixes #2274 --- addons/medical/functions/fnc_getTypeOfDamage.sqf | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/medical/functions/fnc_getTypeOfDamage.sqf b/addons/medical/functions/fnc_getTypeOfDamage.sqf index afa687f137..7a351e0b77 100644 --- a/addons/medical/functions/fnc_getTypeOfDamage.sqf +++ b/addons/medical/functions/fnc_getTypeOfDamage.sqf @@ -17,6 +17,7 @@ params ["_typeOfProjectile"]; if (_typeOfProjectile isKindOf "BulletBase") exitWith {"bullet"}; +if (_typeOfProjectile isKindOf "ShotgunBase") exitwith {"bullet"}; if (_typeOfProjectile isKindOf "GrenadeCore") exitWith {"grenade"}; if (_typeOfProjectile isKindOf "TimeBombCore") exitWith {"explosive"}; if (_typeOfProjectile isKindOf "MineCore") exitWith {"explosive"}; From 8307ccea9638e43fce04d3c4958eb9c57c9b7c88 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 30 Aug 2015 01:37:14 -0500 Subject: [PATCH 037/132] firedNear - use new isKindOf --- addons/hearing/functions/fnc_firedNear.sqf | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/addons/hearing/functions/fnc_firedNear.sqf b/addons/hearing/functions/fnc_firedNear.sqf index 1ede8db3ea..1ee84a2dc8 100644 --- a/addons/hearing/functions/fnc_firedNear.sqf +++ b/addons/hearing/functions/fnc_firedNear.sqf @@ -7,8 +7,8 @@ * 1: Firer: Object - Object which fires a weapon near the unit * 2: Distance - Distance in meters between the unit and firer * 3: weapon - Fired weapon - * 4: muzzle - Muzzle that was used - * 5: mod - Current mode of the fired weapon + * 4: muzzle - Muzzle that was used (not used) + * 5: mode - Current mode of the fired weapon (not used) * 6: ammo - Ammo used * * Return Value: @@ -16,6 +16,7 @@ * * Example: * [clientFiredNearEvent] call ace_hearing_fnc_firedNear + * [player, player, 10, "arifle_MX_ACO_pointer_F", "arifle_MX_ACO_pointer_F", "single", "B_65x39_Caseless"] call ace_hearing_fnc_firedNear * * Public: No */ @@ -24,14 +25,14 @@ //Only run if deafness or ear ringing is enabled: if ((!GVAR(enableCombatDeafness)) && GVAR(DisableEarRinging)) exitWith {}; -params ["_object", "_firer", "_distance", "_weapon", "_muzzle", "_mode", "_ammo"]; +params ["_object", "_firer", "_distance", "_weapon", "", "", "_ammo"]; //Only run if firedNear object is player or player's vehicle: if ((ACE_player != _object) && {(vehicle ACE_player) != _object}) exitWith {}; if (_weapon in ["Throw", "Put"]) exitWith {}; if (_distance > 50) exitWith {}; -private ["_silencer", "_audibleFireCoef", "_loudness", "_strength", "_vehAttenuation", "_magazine", "_muzzles", "_weaponMagazines", "_muzzleMagazines", "_ammoType", "_initSpeed", "_ammoConfig", "_caliber", "_parentClasses"]; +private ["_silencer", "_audibleFireCoef", "_loudness", "_strength", "_vehAttenuation", "_magazine", "_muzzles", "_weaponMagazines", "_muzzleMagazines", "_ammoType", "_initSpeed", "_ammoConfig", "_caliber"]; _vehAttenuation = if ((ACE_player == (vehicle ACE_player)) || {isTurnedOut ACE_player}) then {1} else {GVAR(playerVehAttenuation)}; @@ -78,21 +79,20 @@ if (_magazine == "") exitWith {}; _initSpeed = getNumber(configFile >> "CfgMagazines" >> _magazine >> "initSpeed"); _ammoConfig = (configFile >> "CfgAmmo" >> _ammo); -_parentClasses = [_ammoConfig, true] call BIS_fnc_returnParents; _caliber = getNumber(_ammoConfig >> "ACE_caliber"); _caliber = call { - if ("ShellBase" in _parentClasses) exitWith { 80 }; - if ("RocketBase" in _parentClasses) exitWith { 200 }; - if ("MissileBase" in _parentClasses) exitWith { 600 }; - if ("SubmunitionBase" in _parentClasses) exitWith { 80 }; + if (_ammo isKindOf ["ShellBase", (configFile >> "CfgAmmo")]) exitWith { 80 }; + if (_ammo isKindOf ["RocketBase", (configFile >> "CfgAmmo")]) exitWith { 200 }; + if (_ammo isKindOf ["MissileBase", (configFile >> "CfgAmmo")]) exitWith { 600 }; + if (_ammo isKindOf ["SubmunitionBase", (configFile >> "CfgAmmo")]) exitWith { 80 }; if (_caliber <= 0) then { 6.5 } else { _caliber }; }; _loudness = (_caliber ^ 1.25 / 10) * (_initspeed / 1000) * _audibleFireCoef / 5; _strength = _vehAttenuation * (_loudness - (_loudness / 50 * _distance)); // linear drop off -//systemChat format["%1 : %2 : %3", _strength, _initSpeed, _parentClasses]; +//systemChat format["%1 : %2", _strength, _initSpeed]; //systemChat format["%1 : %2 : %3", _weapon, _magazine, _initSpeed]; if (_strength < 0.01) exitWith {}; -[{_this call FUNC(earRinging)}, [ACE_player, _strength], 0.2, 0] call EFUNC(common,waitAndExecute); +[{_this call FUNC(earRinging)}, [ACE_player, _strength], 0.2] call EFUNC(common,waitAndExecute); From 910bb151e252d4c116b5603459194301d8d78aa9 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 30 Aug 2015 01:47:40 -0500 Subject: [PATCH 038/132] #1988 - Boost explosive hearing damage --- addons/hearing/CfgEventHandlers.hpp | 2 +- addons/hearing/functions/fnc_explosionNear.sqf | 8 ++++++-- addons/hearing/functions/fnc_moduleHearing.sqf | 3 +-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/addons/hearing/CfgEventHandlers.hpp b/addons/hearing/CfgEventHandlers.hpp index ce968ed2ca..f09f259266 100644 --- a/addons/hearing/CfgEventHandlers.hpp +++ b/addons/hearing/CfgEventHandlers.hpp @@ -29,7 +29,7 @@ class Extended_FiredNear_EventHandlers { class Extended_Explosion_EventHandlers { class CAManBase { class GVAR(ExplosionNear) { - clientExplosion = QUOTE( if (GVAR(enableCombatDeafness) && {_this select 0 == ACE_player}) then {_this call FUNC(explosionNear)}; ); + clientExplosion = QUOTE(_this call FUNC(explosionNear);); }; }; }; diff --git a/addons/hearing/functions/fnc_explosionNear.sqf b/addons/hearing/functions/fnc_explosionNear.sqf index 8cea263fec..7e4d0b9bfc 100644 --- a/addons/hearing/functions/fnc_explosionNear.sqf +++ b/addons/hearing/functions/fnc_explosionNear.sqf @@ -21,8 +21,12 @@ if ((!GVAR(enableCombatDeafness)) && GVAR(DisableEarRinging)) exitWith {}; params ["_unit", "_damage"]; +if (_unit != ACE_player) exitWith {}; + +TRACE_2("explosion near player",_unit,_damage); + private ["_strength"]; -_strength = 0 max _damage; +_strength = (0 max _damage) * 30; if (_strength < 0.01) exitWith {}; -[{_this call FUNC(earRinging)}, [_unit, _strength], 0.2, 0] call EFUNC(common,waitAndExecute); +[{_this call FUNC(earRinging)}, [_unit, _strength], 0.2] call EFUNC(common,waitAndExecute); diff --git a/addons/hearing/functions/fnc_moduleHearing.sqf b/addons/hearing/functions/fnc_moduleHearing.sqf index 035d5eaa88..2b4daecc72 100644 --- a/addons/hearing/functions/fnc_moduleHearing.sqf +++ b/addons/hearing/functions/fnc_moduleHearing.sqf @@ -9,9 +9,8 @@ * None */ #include "script_component.hpp" -params ["_logic", "_units", "_activated"]; -if !(_activated) exitWith {}; +params ["_logic"]; [_logic, QGVAR(enableCombatDeafness), "EnableCombatDeafness"] call EFUNC(common,readSettingFromModule); From 32300a0a809b62c89199bb3cc446dc628bd9eb7b Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 30 Aug 2015 10:45:14 +0200 Subject: [PATCH 039/132] objectParent command replacing fnc_getBackpackAssignedUnit --- addons/backpacks/XEH_preInit.sqf | 1 - .../functions/fnc_getBackpackAssignedUnit.sqf | 22 ------------------- .../functions/fnc_onOpenInventory.sqf | 13 ++++++----- 3 files changed, 7 insertions(+), 29 deletions(-) delete mode 100644 addons/backpacks/functions/fnc_getBackpackAssignedUnit.sqf diff --git a/addons/backpacks/XEH_preInit.sqf b/addons/backpacks/XEH_preInit.sqf index a47825d0b0..f4c6a1a5d8 100644 --- a/addons/backpacks/XEH_preInit.sqf +++ b/addons/backpacks/XEH_preInit.sqf @@ -3,7 +3,6 @@ ADDON = false; PREP(backpackOpened); -PREP(getBackpackAssignedUnit); PREP(isBackpack); PREP(onOpenInventory); diff --git a/addons/backpacks/functions/fnc_getBackpackAssignedUnit.sqf b/addons/backpacks/functions/fnc_getBackpackAssignedUnit.sqf deleted file mode 100644 index 85f5966aa9..0000000000 --- a/addons/backpacks/functions/fnc_getBackpackAssignedUnit.sqf +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Author: commy2 - * - * Returns the unit that has the given backpack object equipped. - * - * Argument: - * 0: Executing Unit (Object) - * 1: A backpack object (Object) - * - * Return value: - * Unit that has the backpack equipped. (Object) - */ -#include "script_component.hpp" -scopeName "main"; - -params ["_unit","_backpack"]; -_target = objNull; -{ - if (backpackContainer _x == _backpack) then {_target = _x; breakTo "main"}; -} count nearestObjects [_unit, ["Man"], 5]; -if (isNull _target) exitWith {ACE_Player}; -_target diff --git a/addons/backpacks/functions/fnc_onOpenInventory.sqf b/addons/backpacks/functions/fnc_onOpenInventory.sqf index d79f8aed9b..afeeb21313 100644 --- a/addons/backpacks/functions/fnc_onOpenInventory.sqf +++ b/addons/backpacks/functions/fnc_onOpenInventory.sqf @@ -1,7 +1,7 @@ /* * Author: commy2 * - * Handle the open inventory event. Display message on traget client. + * Handle the open inventory event. Display message on target client. * * Argument: * Input from "InventoryOpened" eventhandler @@ -11,16 +11,17 @@ */ #include "script_component.hpp" -private "_target"; -params ["","_backpack"]; +params ["_unit","_backpack"]; -// exit if the target is not a backpack -if !([_backpack] call FUNC(isBackpack)) exitWith {}; +// exit if the target is not a real backpack, i.e. parachute, static weapon bag etc. +if !([_backpack] call FUNC(isBackpack)) exitWith {false}; // get the unit that wears the backpack object -_target = _this call FUNC(getBackpackAssignedUnit); +private "_target"; +_target = objectParent _backpack; if (isNull _target) exitWith {false}; + // raise event on target unit ["backpackOpened", _target, [_target, _backpack]] call EFUNC(common,targetEvent); From 4682235d8a937fa6e02ebfa808442c214380191e Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 30 Aug 2015 11:13:26 +0200 Subject: [PATCH 040/132] increase reach in 3rd person for opening doors, fix #2301 --- addons/interaction/XEH_postInit.sqf | 2 +- addons/interaction/functions/fnc_openDoor.sqf | 4 ++-- addons/interaction/script_component.hpp | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/addons/interaction/XEH_postInit.sqf b/addons/interaction/XEH_postInit.sqf index 8db2d34ad1..801102b4d4 100644 --- a/addons/interaction/XEH_postInit.sqf +++ b/addons/interaction/XEH_postInit.sqf @@ -35,7 +35,7 @@ private ["_team"]; // Conditions: canInteract if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if (GVAR(isOpeningDoor) || {[2] call FUNC(getDoor) select 1 == ''}) exitWith {false}; + if (GVAR(isOpeningDoor) || {[MACRO_DOOR_REACH_DISTANCE] call FUNC(getDoor) select 1 == ''}) exitWith {false}; // Statement call EFUNC(interaction,openDoor); diff --git a/addons/interaction/functions/fnc_openDoor.sqf b/addons/interaction/functions/fnc_openDoor.sqf index db808e2eba..9555502a93 100644 --- a/addons/interaction/functions/fnc_openDoor.sqf +++ b/addons/interaction/functions/fnc_openDoor.sqf @@ -18,7 +18,7 @@ private ["_info", "_phase", "_position", "_time", "_usedMouseWheel", "_getDoorAnimations"]; -_info = [2] call FUNC(getDoor); +_info = [MACRO_DOOR_REACH_DISTANCE] call FUNC(getDoor); EXPLODE_2_PVT(_info,_house,_door); @@ -36,7 +36,7 @@ if (_house animationPhase (_animations select 0) <= 0 && {_house getVariable [_l }; GVAR(isOpeningDoor) = true; -playSound "ACE_Sound_Click"; +playSound "ACE_Sound_Click"; //@todo replace with smth. more fitting [_house, _animations] spawn { private ["_house", "_animations", "_phase", "_position", "_time", "_usedMouseWheel"]; diff --git a/addons/interaction/script_component.hpp b/addons/interaction/script_component.hpp index 68f22e96d7..d668387bb9 100644 --- a/addons/interaction/script_component.hpp +++ b/addons/interaction/script_component.hpp @@ -9,4 +9,6 @@ #define DEBUG_SETTINGS DEBUG_SETTINGS_INTERACTION #endif -#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file +#include "\z\ace\addons\main\script_macros.hpp" + +#define MACRO_DOOR_REACH_DISTANCE (AGLToASL positionCameraToWorld [0,0,0] vectorDistance AGLToASL (ACE_player modelToWorld (ACE_player selectionPosition "Head"))) + 2 From 58ec4a68cb00f90a404ef51f47b35434c0482647 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 30 Aug 2015 12:01:13 +0200 Subject: [PATCH 041/132] fix weapon select in ffv slots not working --- addons/weaponselect/XEH_postInit.sqf | 32 ++++++++++++++-------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/addons/weaponselect/XEH_postInit.sqf b/addons/weaponselect/XEH_postInit.sqf index dfb70f4f71..d2bfb55236 100644 --- a/addons/weaponselect/XEH_postInit.sqf +++ b/addons/weaponselect/XEH_postInit.sqf @@ -7,7 +7,7 @@ if !(hasInterface) exitWith {}; ["ACE3 Weapons", QGVAR(SelectPistolNew), localize LSTRING(SelectPistol), { // Conditions: canInteract - if !([ACE_player, ACE_player, ["isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, ACE_player, ["isNotInside", "isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; @@ -21,7 +21,7 @@ if !(hasInterface) exitWith {}; ["ACE3 Weapons", QGVAR(SelectRifleNew), localize LSTRING(SelectRifle), { // Conditions: canInteract - if !([ACE_player, ACE_player, ["isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, ACE_player, ["isNotInside", "isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; @@ -35,7 +35,7 @@ if !(hasInterface) exitWith {}; ["ACE3 Weapons", QGVAR(SelectRifleMuzzleNew), localize LSTRING(SelectRifleMuzzle), { // Conditions: canInteract - if !([ACE_player, ACE_player, ["isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, ACE_player, ["isNotInside", "isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; @@ -49,7 +49,7 @@ if !(hasInterface) exitWith {}; ["ACE3 Weapons", QGVAR(SelectLauncherNew), localize LSTRING(SelectLauncher), { // Conditions: canInteract - if !([ACE_player, ACE_player, ["isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, ACE_player, ["isNotInside", "isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; @@ -63,7 +63,7 @@ if !(hasInterface) exitWith {}; ["ACE3 Weapons", QGVAR(SelectBinocularNew), localize LSTRING(SelectBinocular), { // Conditions: canInteract - if !([ACE_player, ACE_player, ["isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, ACE_player, ["isNotInside", "isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; @@ -77,7 +77,7 @@ if !(hasInterface) exitWith {}; ["ACE3 Weapons", QGVAR(SelectGrenadeFrag), localize LSTRING(SelectGrenadeFrag), { // Conditions: canInteract - if !([ACE_player, ACE_player, ["isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, ACE_player, ["isNotInside", "isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; @@ -91,7 +91,7 @@ if !(hasInterface) exitWith {}; ["ACE3 Weapons", QGVAR(SelectGrenadeOther), localize LSTRING(SelectGrenadeOther), { // Conditions: canInteract - if !([ACE_player, ACE_player, ["isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, ACE_player, ["isNotInside", "isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; @@ -105,7 +105,7 @@ if !(hasInterface) exitWith {}; ["ACE3 Weapons", QGVAR(HolsterWeapon), localize LSTRING(HolsterWeapon), { // Conditions: canInteract - if !([ACE_player, ACE_player, ["isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, ACE_player, ["isNotInside", "isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; @@ -130,12 +130,12 @@ if !(hasInterface) exitWith {}; ["ACE3 Vehicles", QGVAR(EngineOn), localize LSTRING(EngineOn), { // Conditions: canInteract - if !([ACE_player, (vehicle ACE_player), []] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !((ACE_player != vehicle ACE_player) && {ACE_player == driver vehicle ACE_player} && {!isEngineOn vehicle ACE_player}) exitWith {false}; // Statement - (vehicle ACE_player) engineOn true; + vehicle ACE_player engineOn true; true }, {false}, @@ -144,12 +144,12 @@ if !(hasInterface) exitWith {}; ["ACE3 Vehicles", QGVAR(EngineOff), localize LSTRING(EngineOff), { // Conditions: canInteract - if !([ACE_player, (vehicle ACE_player), []] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(ACE_player != vehicle ACE_player && {ACE_player == driver vehicle ACE_player} && {isEngineOn vehicle ACE_player}) exitWith {false}; // Statement - (vehicle ACE_player) engineOn false; + vehicle ACE_player engineOn false; true }, {false}, @@ -158,7 +158,7 @@ if !(hasInterface) exitWith {}; ["ACE3 Vehicles", QGVAR(SelectMainGunNew), localize LSTRING(SelectMainGun), { // Conditions: canInteract - if !([ACE_player, (vehicle ACE_player), []] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(ACE_player != vehicle ACE_player) exitWith {false}; @@ -172,7 +172,7 @@ if !(hasInterface) exitWith {}; ["ACE3 Vehicles", QGVAR(SelectMachineGunNew), localize LSTRING(SelectMachineGun), { // Conditions: canInteract - if !([ACE_player, (vehicle ACE_player), []] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(ACE_player != vehicle ACE_player) exitWith {false}; @@ -186,7 +186,7 @@ if !(hasInterface) exitWith {}; ["ACE3 Vehicles", QGVAR(SelectMissilesNew), localize LSTRING(SelectMissiles), { // Conditions: canInteract - if !([ACE_player, (vehicle ACE_player), []] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(ACE_player != vehicle ACE_player) exitWith {false}; @@ -200,7 +200,7 @@ if !(hasInterface) exitWith {}; ["ACE3 Vehicles", QGVAR(FireSmokeLauncher), localize LSTRING(FireSmokeLauncher), { // Conditions: canInteract - if !([ACE_player, (vehicle ACE_player), []] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(ACE_player != vehicle ACE_player && {ACE_player == commander vehicle ACE_player}) exitWith {false}; From 610bb7a1df1e292cd522c98117cfcc5a049847fc Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 30 Aug 2015 13:10:25 +0200 Subject: [PATCH 042/132] better animation for spotting scope, fix #1638 --- addons/spottingscope/CfgMoves.hpp | 28 ++++++++++++++++++++ addons/spottingscope/CfgVehicles.hpp | 2 +- addons/spottingscope/config.cpp | 5 ++-- addons/spottingscope/data/spottingscope.p3d | Bin 1583477 -> 1585552 bytes 4 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 addons/spottingscope/CfgMoves.hpp diff --git a/addons/spottingscope/CfgMoves.hpp b/addons/spottingscope/CfgMoves.hpp new file mode 100644 index 0000000000..c7436801ee --- /dev/null +++ b/addons/spottingscope/CfgMoves.hpp @@ -0,0 +1,28 @@ + +class CfgMovesBasic { + class DefaultDie; + + class ManActions { + ACE_SpottingScope = "ACE_SpottingScope"; + }; +}; + +class CfgMovesMaleSdr: CfgMovesBasic { + class States { + class ACE_KIA_SpottingScope: DefaultDie { + actions = "DeadActions"; + file = "\A3\anims_f\Data\Anim\Sdr\dth\pne\stp\ras\Rfl\AdthPpneMstpSrasWrflDnon_1"; + speed = 1; + looped = "false"; + terminal = 1; + soundEnabled = 0; + connectTo[] = {"Unconscious",0.1}; + }; + + class Crew; + class ACE_SpottingScope: Crew { + file = "\A3\anims_f\Data\Anim\Sdr\Mov\pne\stp\non\non\AmovPpneMstpSnonWnonDnon"; + interpolateTo[] = {"ACE_KIA_SpottingScope",1}; + }; + }; +}; diff --git a/addons/spottingscope/CfgVehicles.hpp b/addons/spottingscope/CfgVehicles.hpp index b0b8bf9c77..2c8159fbb1 100644 --- a/addons/spottingscope/CfgVehicles.hpp +++ b/addons/spottingscope/CfgVehicles.hpp @@ -77,7 +77,7 @@ class CfgVehicles { gunnerOpticsEffect[] = {"OpticsCHAbera1","OpticsBlur2"}; gunnerOutOpticsShowCursor = 0; gunnerOpticsShowCursor = 0; - gunnerAction = "gunner_static_low01"; + gunnerAction = "ACE_SpottingScope"; gunnerGetInAction = "GetInLow"; gunnerGetOutAction = "GetOutLow"; gunnerForceOptics = 0; diff --git a/addons/spottingscope/config.cpp b/addons/spottingscope/config.cpp index a615e5da79..157e430868 100644 --- a/addons/spottingscope/config.cpp +++ b/addons/spottingscope/config.cpp @@ -6,11 +6,12 @@ class CfgPatches { weapons[] = {"ACE_SpottingScope"}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_apl", "ace_interaction"}; - author[] = {"Rocko", "Scubaman3D", "Ruthberg"}; + author[] = {"Rocko", "Scubaman3D", "Ruthberg", "commy2"}; VERSION_CONFIG; }; }; #include "CfgEventHandlers.hpp" #include "CfgVehicles.hpp" -#include "CfgWeapons.hpp" \ No newline at end of file +#include "CfgWeapons.hpp" +#include "CfgMoves.hpp" diff --git a/addons/spottingscope/data/spottingscope.p3d b/addons/spottingscope/data/spottingscope.p3d index c4e0363dcf124ff1181bf332bfe028297e309950..fba9d66b913cf18b1cfef9b7e191808ce19c91d3 100644 GIT binary patch delta 690 zcmex*DPh9ngbg2TRldxeW6!|Az_=i|-{wYYt$p7ND1X{+n=Rgr`yVxPI&8OH#kC<( zGObU;X6vtdd(-MK)+p@eyYt)c&S%_ycRtg~4_wN@sX3|1C8;UO+aJtee#kt%;fFB$ z^aopn`?t+xUc)?HUxtru`!;UALlWD4Rx)d@Aa66%0ZXOE|vu>B0$9D1- zaYk}ivgfGdF>=BJ_U#iEaEP8G&bX6#oLhwO7&onvbNjSLu4WD5j3W@{oA1s~y)=_ss7#9Th+uTU4wf9ef@~7>#+2Y-}KW^b0`|UZKxHcq8 zruJ#rZ2eVlZ(9Au8in0_cYgcb`Hb7|&SzTrVf#a2zGD*Gt2Z)ht|89!6R|8g9=J_! z_g%&U#H`zWm$99^MVygVjqEw5c2>rFA(zqF+UIs0I?ttgXD#QSOkbgfmm$&nrGq- zCM--$3=G>1q$PGU`w|nqpy^ From fc6f97e09eec448ffe7e556463758f911685d8c8 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 30 Aug 2015 13:29:23 +0200 Subject: [PATCH 043/132] fix autoriflemen spawning with 0x frag grenade bug --- addons/overheating/CfgWeapons.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/overheating/CfgWeapons.hpp b/addons/overheating/CfgWeapons.hpp index 025fa5e280..5c9717dbcf 100644 --- a/addons/overheating/CfgWeapons.hpp +++ b/addons/overheating/CfgWeapons.hpp @@ -9,7 +9,7 @@ class CfgWeapons { picture = QUOTE(PATHTOF(UI\spare_barrel_ca.paa)); scope = 2; class ItemInfo: InventoryItem_Base_F { - mass = 50; + mass = 30; }; }; From 8d589ea8f00f6b7809a2a2474f1f9a3295a0615d Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 30 Aug 2015 15:50:51 +0200 Subject: [PATCH 044/132] solution for custom cameras (for intros) being broken with ACE --- addons/optics/XEH_postInit.sqf | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/addons/optics/XEH_postInit.sqf b/addons/optics/XEH_postInit.sqf index df6d0ae486..b4c326d31a 100644 --- a/addons/optics/XEH_postInit.sqf +++ b/addons/optics/XEH_postInit.sqf @@ -3,8 +3,18 @@ if (!hasInterface) exitWith {}; +#define ALL_CAMERAS [ \ + missionNamespace getVariable ["BIS_DEBUG_CAM", objNull], \ + missionNamespace getVariable ["BIS_fnc_camera_cam", objNull], \ + uiNamespace getVariable ["BIS_fnc_arsenal_cam", objNull], \ + uiNamespace getVariable ["BIS_fnc_animViewer_cam", objNull], \ + missionNamespace getVariable ["BIS_fnc_establishingShot_fakeUAV", objNull], \ + missionNamespace getVariable ["ACE_CustomCamera", objNull] \ +] + 0 = 0 spawn { waituntil {!isNull ACE_player}; + waituntil {sleep 0.5; {!isNull _x} count ALL_CAMERAS == 0}; // PiP technique by BadBenson GVAR(camera) = "camera" camCreate positioncameratoworld [0,0,0]; From 74dfd73167569f63ab547866f992b96c28a75289 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 30 Aug 2015 19:05:35 +0200 Subject: [PATCH 045/132] fix issues with pip optics camera in virtual arsenal --- addons/common/XEH_postInit.sqf | 11 +------- addons/optics/XEH_postInit.sqf | 27 +++++++++---------- addons/optics/functions/fnc_onDrawScope2D.sqf | 4 +-- 3 files changed, 15 insertions(+), 27 deletions(-) diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 1f060c8900..cd1c8c2dd0 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -284,22 +284,13 @@ GVAR(OldVisibleMap) = false; }, 0, []] call CBA_fnc_addPerFrameHandler; -// PFH to raise camera created event. Only works on these cams by BI. -#define ALL_CAMERAS [ \ - missionNamespace getVariable ["BIS_DEBUG_CAM", objNull], \ - missionNamespace getVariable ["BIS_fnc_camera_cam", objNull], \ - uiNamespace getVariable ["BIS_fnc_arsenal_cam", objNull], \ - uiNamespace getVariable ["BIS_fnc_animViewer_cam", objNull], \ - missionNamespace getVariable ["BIS_fnc_establishingShot_fakeUAV", objNull] \ -] - GVAR(OldIsCamera) = false; [{ // "activeCameraChanged" event private ["_isCamera"]; - _isCamera = {!isNull _x} count ALL_CAMERAS > 0; + _isCamera = call FUNC(isfeatureCameraActive); if !(_isCamera isEqualTo GVAR(OldIsCamera)) then { // Raise ACE event locally GVAR(OldIsCamera) = _isCamera; diff --git a/addons/optics/XEH_postInit.sqf b/addons/optics/XEH_postInit.sqf index b4c326d31a..34b52b83fb 100644 --- a/addons/optics/XEH_postInit.sqf +++ b/addons/optics/XEH_postInit.sqf @@ -3,26 +3,22 @@ if (!hasInterface) exitWith {}; -#define ALL_CAMERAS [ \ - missionNamespace getVariable ["BIS_DEBUG_CAM", objNull], \ - missionNamespace getVariable ["BIS_fnc_camera_cam", objNull], \ - uiNamespace getVariable ["BIS_fnc_arsenal_cam", objNull], \ - uiNamespace getVariable ["BIS_fnc_animViewer_cam", objNull], \ - missionNamespace getVariable ["BIS_fnc_establishingShot_fakeUAV", objNull], \ - missionNamespace getVariable ["ACE_CustomCamera", objNull] \ -] +GVAR(camera) = objNull; 0 = 0 spawn { waituntil {!isNull ACE_player}; - waituntil {sleep 0.5; {!isNull _x} count ALL_CAMERAS == 0}; + waituntil {sleep 0.5; !(call EFUNC(common,isfeatureCameraActive)) && isNull (missionNamespace getVariable ["ACE_CustomCamera", objNull])}; + + GVAR(camera) cameraEffect ["TERMINATE", "BACK"]; + camDestroy GVAR(camera); // PiP technique by BadBenson - GVAR(camera) = "camera" camCreate positioncameratoworld [0,0,0]; + GVAR(camera) = "camera" camCreate positionCameraToWorld [0,0,0]; GVAR(camera) camSetFov 0.7; GVAR(camera) camSetTarget ACE_player; GVAR(camera) camCommit 1; - "ace_optics_rendertarget0" setPiPEffect [2, 1.0, 1.0, 1.0, 0.0, [0.0, 1.0, 0.0, 0.25], [1.0, 0.0, 1.0, 1.0], [0.199, 0.587, 0.114, 0.0]]; + "ace_optics_rendertarget0" setPiPEffect [0]; GVAR(camera) cameraEffect ["INTERNAL", "BACK", "ace_optics_rendertarget0"]; }; @@ -33,18 +29,19 @@ if (!hasInterface) exitWith {}; }; }] call EFUNC(common,addEventHandler); -// camera has to be re-created every ACE_time another camera is created. Otherwise r2t is either black or transparent. @todo Add popular custom cameras to the event in ACE_common. +// camera has to be re-created every time another camera is created. Otherwise r2t is either black or transparent. @todo Add popular custom cameras to the event in ACE_common. ["activeCameraChanged", { if !(_this select 1) then { - deleteVehicle GVAR(camera); + GVAR(camera) cameraEffect ["TERMINATE", "BACK"]; + camDestroy GVAR(camera); // PiP technique by BadBenson - GVAR(camera) = "camera" camCreate positioncameratoworld [0,0,0]; + GVAR(camera) = "camera" camCreate positionCameraToWorld [0,0,0]; GVAR(camera) camSetFov 0.7; GVAR(camera) camSetTarget ACE_player; GVAR(camera) camCommit 1; - "ace_optics_rendertarget0" setPiPEffect [2, 1.0, 1.0, 1.0, 0.0, [0.0, 1.0, 0.0, 0.25], [1.0, 0.0, 1.0, 1.0], [0.199, 0.587, 0.114, 0.0]]; + "ace_optics_rendertarget0" setPiPEffect [0]; GVAR(camera) cameraEffect ["INTERNAL", "BACK", "ace_optics_rendertarget0"]; }; }] call EFUNC(common,addEventHandler); diff --git a/addons/optics/functions/fnc_onDrawScope2D.sqf b/addons/optics/functions/fnc_onDrawScope2D.sqf index 7abee8f122..9ea038f877 100644 --- a/addons/optics/functions/fnc_onDrawScope2D.sqf +++ b/addons/optics/functions/fnc_onDrawScope2D.sqf @@ -22,8 +22,8 @@ _optic = (primaryWeaponItems ACE_player) select 2; _isPIP = (getText (configFile >> "CfgWeapons" >> _optic >> "ItemInfo" >> "modelOptics")) == QUOTE(PATHTOF(models\ace_optics_pip.p3d)); if (_isPIP) then { - GVAR(camera) setposATL positioncameratoworld [0,0,0.4]; - GVAR(camera) camPrepareTarget positioncameratoworld [0,0,50]; + GVAR(camera) setPosATL positionCameraToWorld [0,0,0.4]; + GVAR(camera) camPrepareTarget positionCameraToWorld [0,0,50]; GVAR(camera) camCommitPrepared 0; // @todo, check if that needs to be done at all From c18af0d34bb2f0ab8520a12f9707ad94bda8de65 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 30 Aug 2015 19:30:44 +0200 Subject: [PATCH 046/132] completely prevent ace_optics from interfering with any mission camera scripts --- addons/optics/XEH_postInit.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/optics/XEH_postInit.sqf b/addons/optics/XEH_postInit.sqf index 34b52b83fb..64226fcf3d 100644 --- a/addons/optics/XEH_postInit.sqf +++ b/addons/optics/XEH_postInit.sqf @@ -7,7 +7,7 @@ GVAR(camera) = objNull; 0 = 0 spawn { waituntil {!isNull ACE_player}; - waituntil {sleep 0.5; !(call EFUNC(common,isfeatureCameraActive)) && isNull (missionNamespace getVariable ["ACE_CustomCamera", objNull])}; + waituntil {sleep 1; {_x != GVAR(camera)} count allMissionObjects "camera" == 0}; GVAR(camera) cameraEffect ["TERMINATE", "BACK"]; camDestroy GVAR(camera); From fae38a223255f2c95a9dd09bd2fc715988fc8e68 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 30 Aug 2015 20:20:00 +0200 Subject: [PATCH 047/132] tripod hmgs should have 100rnd mags instead of 500rnd mags, fix #1190 --- addons/vehicles/CfgVehicles.hpp | 93 +++++++++++++++++++++++++++++++++ addons/vehicles/CfgWeapons.hpp | 5 ++ 2 files changed, 98 insertions(+) diff --git a/addons/vehicles/CfgVehicles.hpp b/addons/vehicles/CfgVehicles.hpp index fa60a72961..a07781a413 100644 --- a/addons/vehicles/CfgVehicles.hpp +++ b/addons/vehicles/CfgVehicles.hpp @@ -331,4 +331,97 @@ class CfgVehicles { }; }; }; + + // static mgs shouldn't use 500 rnd mags. + class StaticWeapon: LandVehicle { + class Turrets { + class MainTurret; //: NewTurret {}; + }; + }; + + class StaticMGWeapon: StaticWeapon {}; + + class HMG_01_base_F: StaticMGWeapon { + class Turrets: Turrets { + class MainTurret: MainTurret { + magazines[] = {"100Rnd_127x99_mag","100Rnd_127x99_mag","100Rnd_127x99_mag","100Rnd_127x99_mag","100Rnd_127x99_mag"}; + }; + }; + }; + + class B_HMG_01_F: HMG_01_base_F { + class Turrets: Turrets { + class MainTurret: MainTurret { + magazines[] = {"100Rnd_127x99_mag_Tracer_Red","100Rnd_127x99_mag_Tracer_Red","100Rnd_127x99_mag_Tracer_Red","100Rnd_127x99_mag_Tracer_Red","100Rnd_127x99_mag_Tracer_Red"}; + }; + }; + }; + + class O_HMG_01_F: HMG_01_base_F { + class Turrets: Turrets { + class MainTurret: MainTurret { + magazines[] = {"100Rnd_127x99_mag_Tracer_Green","100Rnd_127x99_mag_Tracer_Green","100Rnd_127x99_mag_Tracer_Green","100Rnd_127x99_mag_Tracer_Green","100Rnd_127x99_mag_Tracer_Green"}; + }; + }; + }; + + class I_HMG_01_F: HMG_01_base_F { + class Turrets: Turrets { + class MainTurret: MainTurret { + magazines[] = {"100Rnd_127x99_mag_Tracer_Yellow","100Rnd_127x99_mag_Tracer_Yellow","100Rnd_127x99_mag_Tracer_Yellow","100Rnd_127x99_mag_Tracer_Yellow","100Rnd_127x99_mag_Tracer_Yellow"}; + }; + }; + }; + + class HMG_01_high_base_F: HMG_01_base_F {}; + + class B_HMG_01_high_F: HMG_01_high_base_F { + class Turrets: Turrets { + class MainTurret: MainTurret { + magazines[] = {"100Rnd_127x99_mag_Tracer_Red","100Rnd_127x99_mag_Tracer_Red","100Rnd_127x99_mag_Tracer_Red","100Rnd_127x99_mag_Tracer_Red","100Rnd_127x99_mag_Tracer_Red"}; + }; + }; + }; + + class O_HMG_01_high_F: HMG_01_high_base_F { + class Turrets: Turrets { + class MainTurret: MainTurret { + magazines[] = {"100Rnd_127x99_mag_Tracer_Green","100Rnd_127x99_mag_Tracer_Green","100Rnd_127x99_mag_Tracer_Green","100Rnd_127x99_mag_Tracer_Green","100Rnd_127x99_mag_Tracer_Green"}; + }; + }; + }; + + class I_HMG_01_high_F: HMG_01_high_base_F { + class Turrets: Turrets { + class MainTurret: MainTurret { + magazines[] = {"100Rnd_127x99_mag_Tracer_Yellow","100Rnd_127x99_mag_Tracer_Yellow","100Rnd_127x99_mag_Tracer_Yellow","100Rnd_127x99_mag_Tracer_Yellow","100Rnd_127x99_mag_Tracer_Yellow"}; + }; + }; + }; + + class HMG_01_A_base_F: HMG_01_base_F {}; + + class B_HMG_01_A_F: HMG_01_A_base_F { + class Turrets: Turrets { + class MainTurret: MainTurret { + magazines[] = {"100Rnd_127x99_mag_Tracer_Red","100Rnd_127x99_mag_Tracer_Red","100Rnd_127x99_mag_Tracer_Red","100Rnd_127x99_mag_Tracer_Red","100Rnd_127x99_mag_Tracer_Red"}; + }; + }; + }; + + class O_HMG_01_A_F: HMG_01_A_base_F { + class Turrets: Turrets { + class MainTurret: MainTurret { + magazines[] = {"100Rnd_127x99_mag_Tracer_Green","100Rnd_127x99_mag_Tracer_Green","100Rnd_127x99_mag_Tracer_Green","100Rnd_127x99_mag_Tracer_Green","100Rnd_127x99_mag_Tracer_Green"}; + }; + }; + }; + + class I_HMG_01_A_F: HMG_01_A_base_F { + class Turrets: Turrets { + class MainTurret: MainTurret { + magazines[] = {"100Rnd_127x99_mag_Tracer_Yellow","100Rnd_127x99_mag_Tracer_Yellow","100Rnd_127x99_mag_Tracer_Yellow","100Rnd_127x99_mag_Tracer_Yellow","100Rnd_127x99_mag_Tracer_Yellow"}; + }; + }; + }; }; diff --git a/addons/vehicles/CfgWeapons.hpp b/addons/vehicles/CfgWeapons.hpp index 2eee38643f..76feb1818a 100644 --- a/addons/vehicles/CfgWeapons.hpp +++ b/addons/vehicles/CfgWeapons.hpp @@ -62,4 +62,9 @@ class CfgWeapons { muzzles[] = {"AP"}; }; + + // make static weapons compatible with 100rnd mag variants + class HMG_static: HMG_01 { + magazines[] = {"500Rnd_127x99_mag","500Rnd_127x99_mag_Tracer_Red","500Rnd_127x99_mag_Tracer_Green","500Rnd_127x99_mag_Tracer_Yellow","200Rnd_127x99_mag","200Rnd_127x99_mag_Tracer_Red","200Rnd_127x99_mag_Tracer_Green","200Rnd_127x99_mag_Tracer_Yellow","100Rnd_127x99_mag","100Rnd_127x99_mag_Tracer_Red","100Rnd_127x99_mag_Tracer_Green","100Rnd_127x99_mag_Tracer_Yellow"}; + }; }; From 7a4c37c0854cab20cb6211f379823b37ce6f6a2c Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 30 Aug 2015 22:03:45 +0200 Subject: [PATCH 048/132] disable all actions on ladders by default, close #2289 --- .../functions/fnc_compileMenuSelfAction.sqf | 2 +- addons/interact_menu/functions/fnc_keyDown.sqf | 2 +- addons/interaction/CfgVehicles.hpp | 18 +++++++++--------- addons/interaction/XEH_postInit.sqf | 1 + 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf index f486b3ee58..2c8cdc279c 100644 --- a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf +++ b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf @@ -122,7 +122,7 @@ _actions = if (_isMan) then { // Dummy statement so it's not collapsed when there's no available actions true }, - {[ACE_player, _target, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering", "isNotSitting"]] call EFUNC(common,canInteractWith)}, + {[ACE_player, _target, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering", "isNotSitting", "isNotOnLadder"]] call EFUNC(common,canInteractWith)}, {}, {}, "Spine3", diff --git a/addons/interact_menu/functions/fnc_keyDown.sqf b/addons/interact_menu/functions/fnc_keyDown.sqf index ca06e25eb6..8c8ecf0c20 100644 --- a/addons/interact_menu/functions/fnc_keyDown.sqf +++ b/addons/interact_menu/functions/fnc_keyDown.sqf @@ -18,7 +18,7 @@ if (GVAR(openedMenuType) == _menuType) exitWith {true}; // Conditions: canInteract (these don't apply to zeus) if ((isNull curatorCamera) && { - !([ACE_player, objNull, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering", "isNotSitting"]] call EFUNC(common,canInteractWith)) + !([ACE_player, objNull, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering", "isNotSitting", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) }) exitWith {false}; while {dialog} do { diff --git a/addons/interaction/CfgVehicles.hpp b/addons/interaction/CfgVehicles.hpp index d2cef4c9ef..abfdb976ab 100644 --- a/addons/interaction/CfgVehicles.hpp +++ b/addons/interaction/CfgVehicles.hpp @@ -191,7 +191,7 @@ class CfgVehicles { class ACE_TeamManagement { displayName = CSTRING(TeamManagement); condition = QUOTE(GVAR(EnableTeamManagement)); - exceptions[] = {"isNotInside", "isNotSitting"}; + exceptions[] = {"isNotInside", "isNotSitting", "isNotOnLadder"}; statement = ""; showDisabled = 1; priority = 3.2; @@ -201,7 +201,7 @@ class CfgVehicles { class ACE_JoinTeamRed { displayName = CSTRING(JoinTeamRed); condition = QUOTE(true); - exceptions[] = {"isNotInside", "isNotSitting"}; + exceptions[] = {"isNotInside", "isNotSitting", "isNotOnLadder"}; statement = QUOTE([ARR_2(_player,'RED')] call DFUNC(joinTeam)); showDisabled = 1; priority = 2.4; @@ -211,7 +211,7 @@ class CfgVehicles { class ACE_JoinTeamGreen { displayName = CSTRING(JoinTeamGreen); condition = QUOTE(true); - exceptions[] = {"isNotInside", "isNotSitting"}; + exceptions[] = {"isNotInside", "isNotSitting", "isNotOnLadder"}; statement = QUOTE([ARR_2(_player,'GREEN')] call DFUNC(joinTeam)); showDisabled = 1; priority = 2.3; @@ -221,7 +221,7 @@ class CfgVehicles { class ACE_JoinTeamBlue { displayName = CSTRING(JoinTeamBlue); condition = QUOTE(true); - exceptions[] = {"isNotInside", "isNotSitting"}; + exceptions[] = {"isNotInside", "isNotSitting", "isNotOnLadder"}; statement = QUOTE([ARR_2(_player,'BLUE')] call DFUNC(joinTeam)); showDisabled = 1; priority = 2.2; @@ -231,7 +231,7 @@ class CfgVehicles { class ACE_JoinTeamYellow { displayName = CSTRING(JoinTeamYellow); condition = QUOTE(true); - exceptions[] = {"isNotInside", "isNotSitting"}; + exceptions[] = {"isNotInside", "isNotSitting", "isNotOnLadder"}; statement = QUOTE([ARR_2(_player,'YELLOW')] call DFUNC(joinTeam)); showDisabled = 1; priority = 2.1; @@ -242,7 +242,7 @@ class CfgVehicles { class ACE_LeaveTeam { displayName = CSTRING(LeaveTeam); condition = QUOTE(assignedTeam _player != 'MAIN'); - exceptions[] = {"isNotInside", "isNotSitting"}; + exceptions[] = {"isNotInside", "isNotSitting", "isNotOnLadder"}; statement = QUOTE([ARR_2(_player,'MAIN')] call DFUNC(joinTeam)); showDisabled = 1; priority = 2.5; @@ -252,7 +252,7 @@ class CfgVehicles { class ACE_BecomeLeader { displayName = CSTRING(BecomeLeader); condition = QUOTE(_this call DFUNC(canBecomeLeader)); - exceptions[] = {"isNotInside", "isNotSitting"}; + exceptions[] = {"isNotInside", "isNotSitting", "isNotOnLadder"}; statement = QUOTE(_this call DFUNC(doBecomeLeader)); showDisabled = 1; priority = 1.0; @@ -262,7 +262,7 @@ class CfgVehicles { class ACE_LeaveGroup { displayName = CSTRING(LeaveGroup); condition = QUOTE(count (units group _player) > 1); - exceptions[] = {"isNotInside", "isNotSitting"}; + exceptions[] = {"isNotInside", "isNotSitting", "isNotOnLadder"}; statement = QUOTE(_oldGroup = units group _player; _newGroup = createGroup side _player; [_player] joinSilent _newGroup; {_player reveal _x} forEach _oldGroup;); showDisabled = 1; priority = 1.2; @@ -379,7 +379,7 @@ class CfgVehicles { class ACE_Equipment { displayName = CSTRING(Equipment); condition = QUOTE(true); - exceptions[] = {"isNotInside","notOnMap", "isNotSitting"}; + exceptions[] = {"isNotInside", "notOnMap", "isNotSitting"}; statement = ""; showDisabled = 1; priority = 4.5; diff --git a/addons/interaction/XEH_postInit.sqf b/addons/interaction/XEH_postInit.sqf index 8db2d34ad1..0906e48d35 100644 --- a/addons/interaction/XEH_postInit.sqf +++ b/addons/interaction/XEH_postInit.sqf @@ -82,3 +82,4 @@ private ["_team"]; [29, [false, false, false]], false] call cba_fnc_addKeybind; ["isNotSwimming", {!underwater (_this select 0)}] call EFUNC(common,addCanInteractWithCondition); +["isNotOnLadder", {getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> animationState (_this select 0) >> "ACE_isLadder") != 1}] call EFUNC(common,addCanInteractWithCondition); From 4be7411a05228e3773b559ba8b06d072f2fbb7a9 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 30 Aug 2015 15:26:43 -0500 Subject: [PATCH 049/132] Use "visibleMapChanged" event --- addons/common/XEH_postInit.sqf | 27 +++++--------------------- addons/maptools/XEH_postInitClient.sqf | 21 ++++++++++---------- 2 files changed, 16 insertions(+), 32 deletions(-) diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index bbb1302218..4f58e6f3cf 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -1,4 +1,6 @@ // ACE - Common + +// #define ENABLE_PERFORMANCE_COUNTERS #include "script_component.hpp" //IGNORE_PRIVATE_WARNING("_handleNetEvent", "_handleRequestAllSyncedEvents", "_handleRequestSyncedEvent", "_handleSyncedEvent"); @@ -208,6 +210,7 @@ GVAR(OldVisibleMap) = false; // PFH to raise varios events [{ + BEGIN_COUNTER(stateChecker); private ["_newCameraView", "_newInventoryDisplayIsOpen", "_newPlayerInventory", "_newPlayerTurret", "_newPlayerVehicle", "_newPlayerVisionMode", "_newPlayerWeapon", "_newZeusDisplayIsOpen", "_newVisibleMap"]; // "playerInventoryChanged" event _newPlayerInventory = [ACE_player] call FUNC(getAllGear); @@ -281,6 +284,8 @@ GVAR(OldVisibleMap) = false; ["visibleMapChanged", [ACE_player, _newVisibleMap]] call FUNC(localEvent); }; + END_COUNTER(stateChecker); + }, 0, []] call CBA_fnc_addPerFrameHandler; @@ -381,26 +386,4 @@ GVAR(deviceKeyCurrentIndex) = -1; {false}, [0xC7, [true, false, false]], false] call cba_fnc_addKeybind; //SHIFT + Home Key -//Map opened/closed Events: -GVAR(mapOpened) = false; -[{ - if (!isNull (findDisplay 12)) then { - [_this select 1] call CBA_fnc_removePerFrameHandler; - TRACE_1("Installing Map Draw EH for MapOpened event"); - ((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["Draw", { - if (!GVAR(mapOpened)) then { - GVAR(mapOpened) = true; - ["mapOpened", []] call FUNC(localEvent); - [{ - if (!visibleMap) then { - GVAR(mapOpened) = false; - ["mapClosed", []] call FUNC(localEvent); - [_this select 1] call CBA_fnc_removePerFrameHandler; - }; - }, 0, []] call CBA_fnc_addPerFrameHandler; - }; - }]; - }; -}, 0, []] call CBA_fnc_addPerFrameHandler; - GVAR(commonPostInited) = true; diff --git a/addons/maptools/XEH_postInitClient.sqf b/addons/maptools/XEH_postInitClient.sqf index 1e428f71b7..06cb8eda3d 100644 --- a/addons/maptools/XEH_postInitClient.sqf +++ b/addons/maptools/XEH_postInitClient.sqf @@ -66,14 +66,15 @@ GVAR(drawing_controls) = [36732, 36733, 36734, 36735, 36736, 36737]; 12 call _fnc_installMapEvents; }; -["mapOpened", { - // Show GPS if required - [GVAR(mapGpsShow)] call FUNC(openMapGps); -}] call EFUNC(common,addEventHandler); - -["mapClosed", { - // Hide GPS - [false] call FUNC(openMapGps); - // Cancel drawing - call FUNC(cancelDrawing); +["visibleMapChanged", { + params ["", "_mapOn"]; + if (_mapOn) then { + // Show GPS if required + [GVAR(mapGpsShow)] call FUNC(openMapGps); + } else { + // Hide GPS + [false] call FUNC(openMapGps); + // Cancel drawing + call FUNC(cancelDrawing); + }; }] call EFUNC(common,addEventHandler); From 8c6f896164889b3661db545ada433f6e778c48ec Mon Sep 17 00:00:00 2001 From: Glowbal Date: Mon, 31 Aug 2015 13:00:17 +0200 Subject: [PATCH 050/132] fixed script error when canceling treatment actions --- addons/medical/functions/fnc_treatment_failure.sqf | 2 +- addons/medical/functions/fnc_treatment_success.sqf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/medical/functions/fnc_treatment_failure.sqf b/addons/medical/functions/fnc_treatment_failure.sqf index 84526daa88..b31a9fd0de 100644 --- a/addons/medical/functions/fnc_treatment_failure.sqf +++ b/addons/medical/functions/fnc_treatment_failure.sqf @@ -19,7 +19,7 @@ private ["_config", "_callback", "_weaponSelect", "_lastAnim"]; params ["_args"]; -_args params ["_caller", "_target", "_selectionName", "_className", "_usersOfItems"]; +_args params ["_caller", "_target", "_selectionName", "_className", "_items", "_usersOfItems"]; if (primaryWeapon _caller == "ACE_FakePrimaryWeapon") then { _caller removeWeapon "ACE_FakePrimaryWeapon"; diff --git a/addons/medical/functions/fnc_treatment_success.sqf b/addons/medical/functions/fnc_treatment_success.sqf index f21f027ee7..d32f63468e 100644 --- a/addons/medical/functions/fnc_treatment_success.sqf +++ b/addons/medical/functions/fnc_treatment_success.sqf @@ -19,7 +19,7 @@ private ["_config", "_callback", "_weaponSelect", "_lastAnim"]; params ["_args"]; -_args params ["_caller", "_target","_selectionName","_className"]; +_args params ["_caller", "_target","_selectionName","_className", "_items", "_usersOfItems"]; if (primaryWeapon _caller == "ACE_FakePrimaryWeapon") then { _caller removeWeapon "ACE_FakePrimaryWeapon"; From 04269831e87a6526175bf8adb4ec2c3698024458 Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Mon, 31 Aug 2015 14:40:31 +0100 Subject: [PATCH 051/132] Consider modifier keys for zeus interaction hack The hacky keybind detection method should consider modifier keys also to prevent keybinds on the same key with different modifiers from firing --- addons/interact_menu/XEH_clientInit.sqf | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/addons/interact_menu/XEH_clientInit.sqf b/addons/interact_menu/XEH_clientInit.sqf index 7c7724d9b4..31dedfbe22 100644 --- a/addons/interact_menu/XEH_clientInit.sqf +++ b/addons/interact_menu/XEH_clientInit.sqf @@ -80,18 +80,26 @@ addMissionEventHandler ["Draw3D", DFUNC(render)]; if (_this select 1) then { (finddisplay 312) displayAddEventHandler ["KeyUp", { _key = ["ACE3 Common","ace_interact_menu_InteractKey"] call CBA_fnc_getKeybind; - _key = (_key select 5) select 0; + _key = _key select 5; + _dik = _key select 0; + _mods = _key select 1; - if ((_this select 1) == _key) then { - [_this,'keyup'] call CBA_events_fnc_keyHandler + if ((_this select 1) == _dik) then { + if ((_this select [2,3]) isEqualTo _mods) then { + [_this,'keyup'] call CBA_events_fnc_keyHandler + }; }; }]; (finddisplay 312) displayAddEventHandler ["KeyDown", { _key = ["ACE3 Common","ace_interact_menu_InteractKey"] call CBA_fnc_getKeybind; - _key = (_key select 5) select 0; + _key = _key select 5; + _dik = _key select 0; + _mods = _key select 1; - if ((_this select 1) == _key) then { - [_this,'keydown'] call CBA_events_fnc_keyHandler + if ((_this select 1) == _dik) then { + if ((_this select [2,3]) isEqualTo _mods) then { + [_this,'keydown'] call CBA_events_fnc_keyHandler + }; }; }]; }; From 543e829278bdb76f76592dc384e122f609708120 Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Mon, 31 Aug 2015 14:56:51 +0100 Subject: [PATCH 052/132] Fix goggles overlay for FFV seats When aiming down sights, view is considered to be "gunner" and so the overlay would be disabled. Introduces addition canUseWeapon check if view is "gunner" to differentiate FFV seats from regular gunner seats --- addons/goggles/functions/fnc_checkGoggles.sqf | 2 +- addons/goggles/functions/fnc_isGogglesVisible.sqf | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/addons/goggles/functions/fnc_checkGoggles.sqf b/addons/goggles/functions/fnc_checkGoggles.sqf index f222ea9881..84b86c3da4 100644 --- a/addons/goggles/functions/fnc_checkGoggles.sqf +++ b/addons/goggles/functions/fnc_checkGoggles.sqf @@ -18,7 +18,7 @@ if (!alive ace_player) exitWith {}; if (true) then { // Detect if curator interface is open and disable effects - if (!isNull(findDisplay 312)) exitWith { + if !(isNull curatorCamera) exitWith { if (GVAR(EffectsActive)) then { call FUNC(removeGlassesEffect); }; diff --git a/addons/goggles/functions/fnc_isGogglesVisible.sqf b/addons/goggles/functions/fnc_isGogglesVisible.sqf index 253a82f0a3..9f586a9cbf 100644 --- a/addons/goggles/functions/fnc_isGogglesVisible.sqf +++ b/addons/goggles/functions/fnc_isGogglesVisible.sqf @@ -15,14 +15,16 @@ */ #include "script_component.hpp" -PARAMS_1(_unit); - +params ["_unit"]; private ["_currentGlasses", "_result", "_position", "_visible"]; _currentGlasses = goggles _unit; _result = false; -if ((vehicle _unit) != _unit) exitWith {(cameraView != "GUNNER")}; +if ((vehicle _unit) != _unit) exitWith { + (cameraView != "GUNNER") || + {[_unit] call EFUNC(common,canUseWeapon)} +}; if (_currentGlasses != "") then { _position =(getPosASLW _unit); From 397d77e5b553db45cf635d5643fe71f192d2713c Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Mon, 31 Aug 2015 15:25:40 +0100 Subject: [PATCH 053/132] Remove special goggles treatment of vehicle units The condition to disable the overlay for gunners introduces more problems (and inconsistencies for that matter) than it was worth. Vehicle gunners using camera based weapons should probably consider not wearing a pair of glasses/goggles before doing so. --- addons/goggles/functions/fnc_isGogglesVisible.sqf | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/addons/goggles/functions/fnc_isGogglesVisible.sqf b/addons/goggles/functions/fnc_isGogglesVisible.sqf index 9f586a9cbf..80f9de4830 100644 --- a/addons/goggles/functions/fnc_isGogglesVisible.sqf +++ b/addons/goggles/functions/fnc_isGogglesVisible.sqf @@ -21,13 +21,8 @@ private ["_currentGlasses", "_result", "_position", "_visible"]; _currentGlasses = goggles _unit; _result = false; -if ((vehicle _unit) != _unit) exitWith { - (cameraView != "GUNNER") || - {[_unit] call EFUNC(common,canUseWeapon)} -}; - if (_currentGlasses != "") then { - _position =(getPosASLW _unit); + _position = getPosASLW _unit; if (surfaceIsWater _position && {((_position select 2) < 0.25)}) exitWith { _result = ([_currentGlasses] call FUNC(isDivingGoggles)); }; From e1d683d8dc09a83bb09b09df3278de0bc6813d24 Mon Sep 17 00:00:00 2001 From: commy2 Date: Mon, 31 Aug 2015 17:31:37 +0200 Subject: [PATCH 054/132] laserpointer with new command lineintersectssurface --- .../functions/fnc_drawLaserpoint.sqf | 103 +++--------------- addons/laserpointer/functions/fnc_onDraw.sqf | 2 +- 2 files changed, 19 insertions(+), 86 deletions(-) diff --git a/addons/laserpointer/functions/fnc_drawLaserpoint.sqf b/addons/laserpointer/functions/fnc_drawLaserpoint.sqf index e69fc5e271..34ca98808b 100644 --- a/addons/laserpointer/functions/fnc_drawLaserpoint.sqf +++ b/addons/laserpointer/functions/fnc_drawLaserpoint.sqf @@ -1,30 +1,11 @@ // by commy2 and esteldunedain #include "script_component.hpp" -private ["_p0", "_p1", "_p0Pos", "_offV1", "_offV2", "_offV3", "_camPos", "_intermediatePos", "_iteration", "_light", "_line", "_pL", "_pL2", "_pX", "_size", "_units", "_fnc_getDistanceToTerrain", "_fnc_doesIntersectWithMan"]; +params ["_unit", "_range", "_isGreen", "_brightness"]; -// init object -/*if (isNil QGVAR(laserdot)) then { - _light = "#lightpoint" createVehicleLocal [0,0,0]; - _light setLightBrightness 10; - _light setLightColor [1,0,0]; - _light setLightAmbient [1,0,0]; - _light setLightDayLight true; - //_light lightAttachObject [GVAR(laserdot), [0,0,0]]; - _light setLightAttenuation [0.04,4,4,0,0.04,0.08]; +private ["_p0", "_v1", "_v2", "_v3", "_p1", "_pL", "_distance", "_pL2", "_camPos", "_size"]; - GVAR(laserdot) = _light; -};*/ - -EXPLODE_4_PVT(_this,_unit,_range,_isGreen,_brightness); - -_p0Pos = _unit modelToWorldVisual (_unit selectionPosition "righthand"); - -// Convert _p0Pos to ASL -_p0 = + _p0Pos; -if (!surfaceIsWater _p0) then { - _p0 = ATLtoASL _p0; -}; +_p0 = AGLToASL (_unit modelToWorldVisual (_unit selectionPosition "righthand")); // Find a system of orthogonal reference vectors // _v1 points in the direction of the weapon @@ -36,68 +17,22 @@ _v3 = _v2 vectorCrossProduct _v1; // Offset over the 3 reference axis // This offset could eventually be configured by weapon in the config -_offV1 = 0.31; -_offV2 = 0; -_offV3 = 0.08; +#define OFFV1 0.31 +#define OFFV2 0 +#define OFFV3 0.08 // Offset _p0, the start of the laser -_p0 = _p0 vectorAdd (_v1 vectorMultiply _offV1) vectorAdd (_v3 vectorMultiply _offV3) vectorAdd (_v2 vectorMultiply _offV2); -_p0Pos = _p0Pos vectorAdd (_v1 vectorMultiply _offV1) vectorAdd (_v3 vectorMultiply _offV3) vectorAdd (_v2 vectorMultiply _offV2); +_p0 = _p0 vectorAdd (_v1 vectorMultiply OFFV1) vectorAdd (_v3 vectorMultiply OFFV3) vectorAdd (_v2 vectorMultiply OFFV2); + // Calculate _p1, the potential end of the laser _p1 = _p0 vectorAdd (_v1 vectorMultiply _range); -//Debugaaa = lineIntersectsObjs [_p0, _p1, objNull, _unit, false, 2]; +_pL = lineIntersectsSurfaces [_p0, _p1, ACE_player, vehicle ACE_player, true, 1, "GEOM", "FIRE"] select 0 select 0; -_fnc_getDistanceToTerrain = { - private ["_distance"]; +// no intersection found, quit +if (isNil "_pL") exitWith {}; - _pX = + _p0; - _line = [_p0, _pX]; - - _distance = _this; - _iteration = _distance; - - while {_iteration > 0.05 / 2} do { - _iteration = _iteration / 2; - - _pX = _p0 vectorAdd (_v1 vectorMultiply _distance); - - _line set [1, _pX]; - - _distance = _distance + (([1, -1] select (lineIntersects (_line + [_unit]) || {terrainIntersectASL _line})) * _iteration); - - if (_distance > _this) exitWith {_distance = _this}; - }; - - _distance -}; - -// Get distance to nearest object or terrain (excluding men) -_distance = _range call _fnc_getDistanceToTerrain; - -// Find all men potentially intercepted by the ray -_intermediatePos = _p0 vectorAdd (_v1 vectorMultiply _distance/2); -if (!surfaceIsWater _intermediatePos) then { - _intermediatePos = ASLtoATL _intermediatePos; -}; -_units = nearestObjects [_intermediatePos, ["Man"], _distance/2]; - -_units deleteAt (_units find _unit); - -_fnc_doesIntersectWithMan = { - _pX = _p0 vectorAdd (_v1 vectorMultiply (_this select 1)); - if (!surfaceIsWater _pX) then { - _pX = ASLtoATL _pX; - }; - count ([_this select 0, "FIRE"] intersect [_p0Pos, _pX]) > 0 -}; - -// Test intersection with nearby men -{ - if ([_x, _distance] call _fnc_doesIntersectWithMan) then { - _distance = _distance min ((_unit distance _x) - _offV1); - }; -} forEach _units; +_distance = _p0 vectorDistance _pL; //systemChat str _distance; if (_distance < 0.5) exitWith {}; @@ -105,31 +40,29 @@ if (_distance < 0.5) exitWith {}; _pL = _p0 vectorAdd (_v1 vectorMultiply _distance); _pL2 = _p0 vectorAdd (_v1 vectorMultiply (_distance - 0.5)); -// Convert _pL to pos -if (!surfaceIsWater _pL) then { - _pL = ASLtoATL _pL; -}; +_pL = ASLtoAGL _pL; /* drawLine3D [ - _p0Pos, + _p0, _pL, [[1,0,0,1], [0,1,0,1]] select _isGreen ]; */ -_size = 2 * (_range - (positionCameraToWorld [0,0,0] vectorDistance _pL)) / _range; +//systemChat str [_unit, "FIRE"] intersect [_camPos, _pL]; _camPos = positionCameraToWorld [0,0,0.2]; if (count ([_unit, "FIRE"] intersect [_camPos, _pL]) > 0) exitWith {}; if (count ([ACE_player, "FIRE"] intersect [_camPos, _pL]) > 0) exitWith {}; // Convert _camPos to ASL -if (!surfaceIsWater _camPos) then { _camPos = ATLtoASL _camPos; }; +_camPos = AGLToASL _camPos; + if ( terrainIntersectASL [_camPos, _pL2]) exitWith {}; if ( lineIntersects [_camPos, _pL2]) exitWith {}; -//GVAR(laserdot) setPos _pL; +_size = 2 * (_range - (positionCameraToWorld [0,0,0] vectorDistance _pL)) / _range; drawIcon3D [ format ["\a3\weapons_f\acc\data\collimdot_%1_ca.paa", ["red", "green"] select _isGreen], diff --git a/addons/laserpointer/functions/fnc_onDraw.sqf b/addons/laserpointer/functions/fnc_onDraw.sqf index 09663f9ecf..9e61e70156 100644 --- a/addons/laserpointer/functions/fnc_onDraw.sqf +++ b/addons/laserpointer/functions/fnc_onDraw.sqf @@ -35,7 +35,7 @@ _brightness = 2 - call EFUNC(common,ambientBrightness); }; if (_laserID > 0 && {_x isFlashlightOn _weapon}) then { - [_x, 50, (_laserID == 2 || _isIR), _brightness] call FUNC(drawLaserpoint); + [_x, 100, (_laserID == 2 || _isIR), _brightness] call FUNC(drawLaserpoint); }; }; From f15805d1f388293171a4daa1c2f0dca690645290 Mon Sep 17 00:00:00 2001 From: commy2 Date: Mon, 31 Aug 2015 20:05:38 +0200 Subject: [PATCH 055/132] setStructuralDamage function --- addons/medical/XEH_preInit.sqf | 1 + addons/medical/functions/fnc_copyDeadBody.sqf | 2 +- addons/medical/functions/fnc_setDead.sqf | 2 +- .../functions/fnc_setStructuralDamage.sqf | 25 +++++++++++++++++++ 4 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 addons/medical/functions/fnc_setStructuralDamage.sqf diff --git a/addons/medical/XEH_preInit.sqf b/addons/medical/XEH_preInit.sqf index b479383468..838dce7404 100644 --- a/addons/medical/XEH_preInit.sqf +++ b/addons/medical/XEH_preInit.sqf @@ -68,6 +68,7 @@ PREP(selectionNameToNumber); PREP(setCardiacArrest); PREP(setDead); PREP(setHitPointDamage); +PREP(setStructuralDamage); PREP(setUnconscious); PREP(treatment); PREP(treatment_failure); diff --git a/addons/medical/functions/fnc_copyDeadBody.sqf b/addons/medical/functions/fnc_copyDeadBody.sqf index 36bcd91487..85fea5eafc 100644 --- a/addons/medical/functions/fnc_copyDeadBody.sqf +++ b/addons/medical/functions/fnc_copyDeadBody.sqf @@ -79,5 +79,5 @@ _newUnit setvariable ["ACE_isUnconscious", true, true]; _newUnit setvariable [QGVAR(disableInteraction), true, true]; _oldBody setvariable [QGVAR(disableInteraction), true, true]; -_newUnit setDamage 0.89; +[_newUnit, 0.89] call FUNC(setStructuralDamage); _newUnit; diff --git a/addons/medical/functions/fnc_setDead.sqf b/addons/medical/functions/fnc_setDead.sqf index c29edcd5e3..1423d594ad 100644 --- a/addons/medical/functions/fnc_setDead.sqf +++ b/addons/medical/functions/fnc_setDead.sqf @@ -82,5 +82,5 @@ if (isPLayer _unit) then { ["medical_onSetDead", [_unit]] call EFUNC(common,localEvent); -_unit setdamage 1; +[_unit, 1] call FUNC(setStructuralDamage); true; diff --git a/addons/medical/functions/fnc_setStructuralDamage.sqf b/addons/medical/functions/fnc_setStructuralDamage.sqf new file mode 100644 index 0000000000..b4dc74eac1 --- /dev/null +++ b/addons/medical/functions/fnc_setStructuralDamage.sqf @@ -0,0 +1,25 @@ +/* + * Author: commy2 + * Set the structural damage of a soldier without changing the individual hitpoints. Unit has to be local. Not safe to use with vehicles! + * + * Arguments: + * 0: The unit + * + * ReturnValue: + * + * + * Public: no? + */ + +params ["_unit", "_damage"]; + +if (!local _unit) exitWith {}; + +private "_allHitPoints"; +_allHitPoints = getAllHitPointsDamage _unit select 2; + +_unit setDamage _damage; + +{ + _unit setHitIndex [_forEachIndex, _x]; +} forEach _allHitPoints; From 37aec2b3c3e984417ff0de0227806a61b5661a8b Mon Sep 17 00:00:00 2001 From: commy2 Date: Mon, 31 Aug 2015 21:22:22 +0200 Subject: [PATCH 056/132] enable repairing while on ladder --- addons/repair/CfgVehicles.hpp | 1 + addons/repair/functions/fnc_canRepairTrack.sqf | 2 +- addons/repair/functions/fnc_canReplaceTrack.sqf | 2 +- addons/repair/functions/fnc_canReplaceWheel.sqf | 2 +- addons/repair/functions/fnc_doRepairTrack.sqf | 2 +- addons/repair/functions/fnc_doReplaceTrack.sqf | 2 +- addons/repair/functions/fnc_doReplaceWheel.sqf | 2 +- addons/repair/functions/fnc_repair.sqf | 2 +- 8 files changed, 8 insertions(+), 7 deletions(-) diff --git a/addons/repair/CfgVehicles.hpp b/addons/repair/CfgVehicles.hpp index 47459f532d..27e8890dbc 100644 --- a/addons/repair/CfgVehicles.hpp +++ b/addons/repair/CfgVehicles.hpp @@ -10,6 +10,7 @@ priority = 2; \ icon = "\A3\ui_f\data\igui\cfg\actions\repair_ca.paa"; \ distance = 4; \ + exceptions[] = {"isNotOnLadder"}; \ }; \ }; \ }; diff --git a/addons/repair/functions/fnc_canRepairTrack.sqf b/addons/repair/functions/fnc_canRepairTrack.sqf index 34165068d7..806fa14b2e 100644 --- a/addons/repair/functions/fnc_canRepairTrack.sqf +++ b/addons/repair/functions/fnc_canRepairTrack.sqf @@ -30,7 +30,7 @@ if (typeName _wheel == "OBJECT") then { _wheel = objNull; { - if ([_unit, _x, ["isNotDragging", "isNotCarrying"]] call EFUNC(common,canInteractWith)) exitWith { + if ([_unit, _x, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) exitWith { _wheel = _x; }; } forEach nearestObjects [_unit, ["ACE_Track"], 5]; diff --git a/addons/repair/functions/fnc_canReplaceTrack.sqf b/addons/repair/functions/fnc_canReplaceTrack.sqf index 94a62a5289..3f4ae77581 100644 --- a/addons/repair/functions/fnc_canReplaceTrack.sqf +++ b/addons/repair/functions/fnc_canReplaceTrack.sqf @@ -31,7 +31,7 @@ if (typeName _track == "OBJECT") then { _track = objNull; { - if ([_unit, _x, ["isNotDragging", "isNotCarrying"]] call EFUNC(common,canInteractWith)) exitWith { + if ([_unit, _x, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) exitWith { _track = _x; }; } forEach nearestObjects [_unit, ["ACE_Track"], 5]; diff --git a/addons/repair/functions/fnc_canReplaceWheel.sqf b/addons/repair/functions/fnc_canReplaceWheel.sqf index 9497504370..e0a2fbbed2 100644 --- a/addons/repair/functions/fnc_canReplaceWheel.sqf +++ b/addons/repair/functions/fnc_canReplaceWheel.sqf @@ -37,7 +37,7 @@ if (typeName _wheel == "OBJECT") then { _wheel = objNull; { - if ([_unit, _x, ["isNotDragging", "isNotCarrying"]] call EFUNC(common,canInteractWith)) exitWith { + if ([_unit, _x, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) exitWith { _wheel = _x; }; } forEach nearestObjects [_unit, ["ACE_Wheel"], 5]; diff --git a/addons/repair/functions/fnc_doRepairTrack.sqf b/addons/repair/functions/fnc_doRepairTrack.sqf index 4803518e3d..de04e71920 100644 --- a/addons/repair/functions/fnc_doRepairTrack.sqf +++ b/addons/repair/functions/fnc_doRepairTrack.sqf @@ -27,7 +27,7 @@ private ["_hitPointDamage", "_newDamage", "_wheel"]; _wheel = objNull; { - if ([_unit, _x, ["isNotDragging", "isNotCarrying"]] call EFUNC(common,canInteractWith)) exitWith { + if ([_unit, _x, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) exitWith { _wheel = _x; }; } forEach nearestObjects [_unit, ["ACE_Track"], 5]; diff --git a/addons/repair/functions/fnc_doReplaceTrack.sqf b/addons/repair/functions/fnc_doReplaceTrack.sqf index 13e53b3f3a..a95a669159 100644 --- a/addons/repair/functions/fnc_doReplaceTrack.sqf +++ b/addons/repair/functions/fnc_doReplaceTrack.sqf @@ -27,7 +27,7 @@ private["_hitPointDamage", "_wheel"]; _wheel = objNull; { - if ([_unit, _x, ["isNotDragging", "isNotCarrying"]] call EFUNC(common,canInteractWith)) exitWith { + if ([_unit, _x, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) exitWith { _wheel = _x; }; } forEach nearestObjects [_unit, ["ACE_Track"], 5]; diff --git a/addons/repair/functions/fnc_doReplaceWheel.sqf b/addons/repair/functions/fnc_doReplaceWheel.sqf index 62db39aa6d..f10712d65d 100644 --- a/addons/repair/functions/fnc_doReplaceWheel.sqf +++ b/addons/repair/functions/fnc_doReplaceWheel.sqf @@ -27,7 +27,7 @@ private ["_hitPointDamage", "_wheel"]; _wheel = objNull; { - if ([_unit, _x, ["isNotDragging", "isNotCarrying"]] call EFUNC(common,canInteractWith)) exitWith { + if ([_unit, _x, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) exitWith { _wheel = _x; }; } forEach nearestObjects [_unit, ["ACE_Wheel"], 5]; diff --git a/addons/repair/functions/fnc_repair.sqf b/addons/repair/functions/fnc_repair.sqf index 8fa7f498bd..4fa1c2d903 100644 --- a/addons/repair/functions/fnc_repair.sqf +++ b/addons/repair/functions/fnc_repair.sqf @@ -177,7 +177,7 @@ _processText = getText (_config >> "displayNameProgress"); DFUNC(repair_failure), _text, _callbackProgress, - [] + ["isNotOnLadder"] ] call EFUNC(common,progressBar); // Display Icon From 5a164c5cdcd0cdb606b91510696029ad13a74963 Mon Sep 17 00:00:00 2001 From: commy2 Date: Mon, 31 Aug 2015 23:36:59 +0200 Subject: [PATCH 057/132] fix UBC issues, simplify uniform hitpoint config --- addons/medical/CfgVehicles.hpp | 746 +++++++++------------------------ 1 file changed, 209 insertions(+), 537 deletions(-) diff --git a/addons/medical/CfgVehicles.hpp b/addons/medical/CfgVehicles.hpp index 278d3523e0..0764d2f1ea 100644 --- a/addons/medical/CfgVehicles.hpp +++ b/addons/medical/CfgVehicles.hpp @@ -2,12 +2,12 @@ #define MEDICAL_ACTION_DISTANCE 1.75 class CfgVehicles { - class Logic; class Module_F: Logic { class ArgumentsBaseUnits { }; }; + class ACE_Module; class ACE_moduleMedicalSettings: ACE_Module { scope = 2; @@ -19,6 +19,7 @@ class CfgVehicles { isGlobal = 1; isTriggerActivated = 0; author = ECSTRING(common,ACETeam); + class Arguments { class level { displayName = CSTRING(MedicalSettings_level_DisplayName); @@ -137,6 +138,7 @@ class CfgVehicles { defaultValue = 1; }; }; + class ModuleDescription { description = CSTRING(MedicalSettings_Module_Description); sync[] = {}; @@ -154,6 +156,7 @@ class CfgVehicles { isTriggerActivated = 0; isDisposable = 0; author = ECSTRING(common,ACETeam); + class Arguments { class enableFor { displayName = CSTRING(AdvancedMedicalSettings_enableFor_DisplayName); @@ -256,13 +259,13 @@ class CfgVehicles { defaultValue = 1; }; }; + class ModuleDescription { description = CSTRING(AdvancedMedicalSettings_Module_Description); sync[] = {}; }; }; - class ACE_moduleReviveSettings: ACE_Module { scope = 2; displayName = CSTRING(ReviveSettings_Module_DisplayName); @@ -273,6 +276,7 @@ class CfgVehicles { isGlobal = 1; isTriggerActivated = 0; author = ECSTRING(common,ACETeam); + class Arguments { class enableRevive { displayName = CSTRING(ReviveSettings_enableRevive_DisplayName); @@ -298,11 +302,13 @@ class CfgVehicles { defaultValue = -1; }; }; + class ModuleDescription { description = CSTRING(ReviveSettings_Module_Description); sync[] = {}; }; }; + class ACE_moduleAssignMedicRoles: Module_F { scope = 2; displayName = CSTRING(AssignMedicRoles_Module_DisplayName); @@ -314,6 +320,7 @@ class CfgVehicles { isTriggerActivated = 0; isDisposable = 0; author = ECSTRING(common,ACETeam); + class Arguments { class EnableList { displayName = CSTRING(AssignMedicRoles_EnableList_DisplayName); @@ -342,6 +349,7 @@ class CfgVehicles { }; }; }; + class ModuleDescription { description = CSTRING(AssignMedicRoles_Module_Description); sync[] = {}; @@ -359,6 +367,7 @@ class CfgVehicles { isTriggerActivated = 0; isDisposable = 0; author = ECSTRING(common,ACETeam); + class Arguments { class EnableList { displayName = CSTRING(AssignMedicVehicle_EnableList_DisplayName); @@ -384,11 +393,13 @@ class CfgVehicles { }; }; }; + class ModuleDescription { description = CSTRING(AssignMedicVehicle_Module_Description); sync[] = {}; }; }; + class ACE_moduleAssignMedicalFacility: Module_F { scope = 2; displayName = CSTRING(AssignMedicalFacility_Module_DisplayName); @@ -400,6 +411,7 @@ class CfgVehicles { isTriggerActivated = 0; isDisposable = 0; author = ECSTRING(common,ACETeam); + class Arguments { class enabled { displayName = CSTRING(AssignMedicalFacility_enabled_DisplayName); @@ -407,199 +419,56 @@ class CfgVehicles { typeName = "BOOL"; }; }; + class ModuleDescription { description = CSTRING(AssignMedicalFacility_Module_Description); sync[] = {}; }; }; - #define ARM_LEG_ARMOR_DEFAULT 2 - #define ARM_LEG_ARMOR_BETTER 3 - #define ARM_LEG_ARMOR_CSAT 4 + #define ARM_LEG_ARMOR_DEFAULT 1 + #define ARM_LEG_ARMOR_BETTER 8 + #define ARM_LEG_ARMOR_CSAT 6 class Land; class Man: Land { class HitPoints { - class HitHead { - visual = ""; - armor = 1; - material = -1; - name = "head"; - passThrough = 1; - radius = 0.1; - explosionShielding = 0.5; - minimalHit = 0; - }; - class HitBody { - armor = 1; - material = -1; - name = "body"; - passThrough = 1; - radius = 0.15; - explosionShielding = 10; - visual = "injury_body"; - minimalHit = 0; - }; - class HitHands { - armor = 999; //armor = 2; - explosionShielding = 0; //explosionShielding = 1; - material = -1; - minimalHit = 0; - name = ""; - passThrough = 1; - radius = 0; //radius = 0.06; - visual = "injury_hands"; - }; - class HitLegs { - armor = 999; //armor = 2; - explosionShielding = 0; //explosionShielding = 1; - material = -1; - minimalHit = 0; - name = ""; - passThrough = 1; - radius = 0; //radius = 0.08; - visual = "injury_legs"; - }; + class HitHead; + class HitBody; + class HitHands; + class HitLegs; }; }; + class CAManBase: Man { class HitPoints: HitPoints { - - class HitFace: HitHead { - armor = 999; - material = -1; - name = "face_hub"; - passThrough = 1; - radius = 0.08; - explosionShielding = 0.1; - minimalHit = 0.01; - }; - class HitNeck: HitFace { - armor = 999; - material = -1; - name = "neck"; - passThrough = 1; - radius = 0.08; - explosionShielding = 0.5; - minimalHit = 0.01; - }; - class HitHead: HitNeck { - armor = 1; - material = -1; - name = "head"; - passThrough = 1; - radius = 0.1; - explosionShielding = 0.5; - minimalHit = 0.01; - }; - class HitPelvis: HitBody { - armor = 999; - material = -1; - name = "pelvis"; - passThrough = 1; - radius = 0.15; - explosionShielding = 0.5; - visual = "injury_body"; - minimalHit = 0.01; - }; - class HitAbdomen: HitPelvis { - armor = 999; - material = -1; - name = "spine1"; - passThrough = 1; - radius = 0.15; - explosionShielding = 1; - visual = "injury_body"; - minimalHit = 0.01; - }; - class HitDiaphragm: HitAbdomen { - armor = 999; - material = -1; - name = "spine2"; - passThrough = 1; - radius = 0.15; - explosionShielding = 6; - visual = "injury_body"; - minimalHit = 0.01; - }; - class HitChest: HitDiaphragm { - armor = 999; - material = -1; - name = "spine3"; - passThrough = 1; - radius = 0.15; - explosionShielding = 6; - visual = "injury_body"; - minimalHit = 0.01; - }; - class HitBody: HitChest { - armor = 1; - material = -1; - name = "body"; - passThrough = 1; - radius = 0.15; - explosionShielding = 10; - visual = "injury_body"; - minimalHit = 0.01; - }; - class HitArms: HitHands { - armor = 999; - material = -1; - name = "arms"; - passThrough = 1; - radius = 0.08; - explosionShielding = 1; - visual = "injury_hands"; - minimalHit = 0.01; - }; - class HitHands: HitArms { - armor = 999; - material = -1; - name = "hands"; - passThrough = 1; - radius = 0.08; - explosionShielding = 1; - visual = "injury_hands"; - minimalHit = 0.01; - }; - class HitLegs: HitLegs { - armor = 999; - material = -1; - name = "legs"; - passThrough = 1; - radius = 0.1; - explosionShielding = 1; - visual = "injury_legs"; - minimalHit = 0.01; - }; - - class HitLeftArm { - armor = ARM_LEG_ARMOR_DEFAULT; //2; - explosionShielding = 1; - material = -1; - minimalHit = 0; - name = "hand_l"; - passThrough = 1; - radius = 0.06; - visual = "injury_hands"; + class HitFace; + class HitNeck; + class HitHead; + class HitPelvis; + class HitAbdomen; + class HitDiaphragm; + class HitChest; + class HitBody; + class HitArms; + class HitHands; + class HitLegs; + class HitLeftArm: HitHands { + armor = ARM_LEG_ARMOR_DEFAULT; + name = "hand_l"; // @todo hopefully these still include the whole arm + hands }; class HitRightArm: HitLeftArm { - name = "hand_r"; + name = "hand_r"; // @todo hopefully these still include the whole arm + hands }; - class HitLeftLeg { - armor = ARM_LEG_ARMOR_DEFAULT; //2; - explosionShielding = 1; - material = -1; - minimalHit = 0; + class HitLeftLeg: HitLegs { + armor = ARM_LEG_ARMOR_DEFAULT; name = "leg_l"; - passThrough = 1; - radius = 0.08; - visual = "injury_legs"; }; class HitRightLeg: HitLeftLeg { name = "leg_r"; }; }; + class ACE_SelfActions { #include "ACE_Medical_SelfActions.hpp" }; @@ -658,141 +527,60 @@ class CfgVehicles { class B_Soldier_04_f: B_Soldier_base_F { class HitPoints: HitPoints { - class HitFace: HitHead { - armor = 999; - }; - class HitNeck: HitFace { - armor = 999; - }; - class HitHead: HitNeck { - armor = 1; - }; - class HitPelvis: HitBody { - armor = 999; - passThrough = 0.5; - explosionShielding = 2.4; - }; - class HitAbdomen: HitPelvis { - armor = 999; - passThrough = 0.5; - explosionShielding = 2.4; - }; - class HitDiaphragm: HitAbdomen { - armor = 999; - passThrough = 0.5; - explosionShielding = 2.4; - }; - class HitChest: HitDiaphragm { - armor = 999; - passThrough = 0.5; - explosionShielding = 2.4; - }; - class HitBody: HitChest { - armor = 2; - passThrough = 0.5; - explosionShielding = 2.4; - }; - class HitArms: HitHands { - armor = 999; - passThrough = 0.5; - explosionShielding = 1.2; - }; - class HitHands: HitArms { - armor = 999; - passThrough = 0.5; - explosionShielding = 1.2; - }; - class HitLegs: HitLegs { - armor = 999; - passThrough = 0.5; - explosionShielding = 1.2; - }; - - class HitLeftArm: HitLeftArm { + class HitFace; + class HitNeck; + class HitHead; + class HitPelvis; + class HitAbdomen; + class HitDiaphragm; + class HitChest; + class HitBody; + class HitArms; + class HitHands; + class HitLegs; + class HitLeftArm: HitHands { armor = ARM_LEG_ARMOR_BETTER; + name = "hand_l"; // @todo hopefully these still include the whole arm + hands }; - - class HitRightArm: HitRightArm { - armor = ARM_LEG_ARMOR_BETTER; + class HitRightArm: HitLeftArm { + name = "hand_r"; // @todo hopefully these still include the whole arm + hands }; - - class HitLeftLeg: HitLeftLeg { + class HitLeftLeg: HitLegs { armor = ARM_LEG_ARMOR_BETTER; + name = "leg_l"; }; - - class HitRightLeg: HitRightLeg { - armor = ARM_LEG_ARMOR_BETTER; + class HitRightLeg: HitLeftLeg { + name = "leg_r"; }; }; }; class B_Soldier_05_f: B_Soldier_base_F { class HitPoints: HitPoints { - class HitFace: HitHead { - armor = 999; - }; - class HitNeck: HitFace { - armor = 999; - }; - class HitHead: HitNeck { - armor = 1; - }; - class HitPelvis: HitBody { - armor = 999; - passThrough = 0.5; - explosionShielding = 2.4; - }; - class HitAbdomen: HitPelvis { - armor = 999; - passThrough = 0.5; - explosionShielding = 2.4; - }; - class HitDiaphragm: HitAbdomen { - armor = 999; - passThrough = 0.5; - explosionShielding = 2.4; - }; - class HitChest: HitDiaphragm { - armor = 999; - passThrough = 0.5; - explosionShielding = 2.4; - }; - class HitBody: HitChest { - armor = 3; - passThrough = 0.5; - explosionShielding = 2.4; - }; - class HitArms: HitHands { - armor = 999; - passThrough = 0.5; - explosionShielding = 1.2; - }; - class HitHands: HitArms { - armor = 999; - passThrough = 0.5; - explosionShielding = 1.2; - }; - class HitLegs: HitLegs { - armor = 999; - passThrough = 0.5; - explosionShielding = 1.2; - }; - - - class HitLeftArm: HitLeftArm { + class HitFace; + class HitNeck; + class HitHead; + class HitPelvis; + class HitAbdomen; + class HitDiaphragm; + class HitChest; + class HitBody; + class HitArms; + class HitHands; + class HitLegs; + class HitLeftArm: HitHands { armor = ARM_LEG_ARMOR_BETTER; + name = "hand_l"; }; - - class HitRightArm: HitRightArm { - armor = ARM_LEG_ARMOR_BETTER; + class HitRightArm: HitLeftArm { + name = "hand_r"; }; - - class HitLeftLeg: HitLeftLeg { + class HitLeftLeg: HitLegs { armor = ARM_LEG_ARMOR_BETTER; + name = "leg_l"; }; - - class HitRightLeg: HitRightLeg { - armor = ARM_LEG_ARMOR_BETTER; + class HitRightLeg: HitLeftLeg { + name = "leg_r"; }; }; }; @@ -801,293 +589,177 @@ class CfgVehicles { class I_Soldier_03_F: I_Soldier_base_F { class HitPoints: HitPoints { - class HitFace: HitHead { - armor = 999; - }; - class HitNeck: HitFace { - armor = 999; - }; - class HitHead: HitNeck { - armor = 1; - }; - class HitPelvis: HitBody { - armor = 999; - passThrough = 0.5; - explosionShielding = 2.4; - }; - class HitAbdomen: HitPelvis { - armor = 999; - passThrough = 0.5; - explosionShielding = 2.4; - }; - class HitDiaphragm: HitAbdomen { - armor = 999; - passThrough = 0.5; - explosionShielding = 2.4; - }; - class HitChest: HitDiaphragm { - armor = 999; - passThrough = 0.5; - explosionShielding = 2.4; - }; - class HitBody: HitChest { - armor = 2; - passThrough = 0.5; - explosionShielding = 2.4; - }; - class HitArms: HitHands { - armor = 999; - passThrough = 0.5; - explosionShielding = 1.2; - }; - class HitHands: HitArms { - armor = 999; - passThrough = 0.5; - explosionShielding = 1.2; - }; - class HitLegs: HitLegs { - armor = 999; - passThrough = 0.5; - explosionShielding = 1.2; - }; - - class HitLeftArm: HitLeftArm { + class HitFace; + class HitNeck; + class HitHead; + class HitPelvis; + class HitAbdomen; + class HitDiaphragm; + class HitChest; + class HitBody; + class HitArms; + class HitHands; + class HitLegs; + class HitLeftArm: HitHands { armor = ARM_LEG_ARMOR_BETTER; + name = "hand_l"; // @todo hopefully these still include the whole arm + hands }; - - class HitRightArm: HitRightArm { - armor = ARM_LEG_ARMOR_BETTER; + class HitRightArm: HitLeftArm { + name = "hand_r"; // @todo hopefully these still include the whole arm + hands }; - - class HitLeftLeg: HitLeftLeg { + class HitLeftLeg: HitLegs { armor = ARM_LEG_ARMOR_BETTER; + name = "leg_l"; }; - - class HitRightLeg: HitRightLeg { - armor = ARM_LEG_ARMOR_BETTER; + class HitRightLeg: HitLeftLeg { + name = "leg_r"; }; }; }; class I_Soldier_04_F: I_Soldier_base_F { class HitPoints: HitPoints { - class HitFace: HitHead { - armor = 999; - }; - class HitNeck: HitFace { - armor = 999; - }; - class HitHead: HitNeck { - armor = 1; - }; - class HitPelvis: HitBody { - armor = 999; - passThrough = 0.5; - explosionShielding = 2.4; - }; - class HitAbdomen: HitPelvis { - armor = 999; - passThrough = 0.5; - explosionShielding = 2.4; - }; - class HitDiaphragm: HitAbdomen { - armor = 999; - passThrough = 0.5; - explosionShielding = 2.4; - }; - class HitChest: HitDiaphragm { - armor = 999; - passThrough = 0.5; - explosionShielding = 2.4; - }; - class HitBody: HitChest { - armor = 3; - passThrough = 0.5; - explosionShielding = 2.4; - }; - class HitArms: HitHands { - armor = 999; - passThrough = 0.5; - explosionShielding = 1.2; - }; - class HitHands: HitArms { - armor = 999; - passThrough = 0.5; - explosionShielding = 1.2; - }; - class HitLegs: HitLegs { - armor = 999; - passThrough = 0.5; - explosionShielding = 1.2; - }; - - - class HitLeftArm: HitLeftArm { + class HitFace; + class HitNeck; + class HitHead; + class HitPelvis; + class HitAbdomen; + class HitDiaphragm; + class HitChest; + class HitBody; + class HitArms; + class HitHands; + class HitLegs; + class HitLeftArm: HitHands { armor = ARM_LEG_ARMOR_BETTER; + name = "hand_l"; // @todo hopefully these still include the whole arm + hands }; - - class HitRightArm: HitRightArm { - armor = ARM_LEG_ARMOR_BETTER; + class HitRightArm: HitLeftArm { + name = "hand_r"; // @todo hopefully these still include the whole arm + hands }; - - class HitLeftLeg: HitLeftLeg { + class HitLeftLeg: HitLegs { armor = ARM_LEG_ARMOR_BETTER; + name = "leg_l"; }; - - class HitRightLeg: HitRightLeg { - armor = ARM_LEG_ARMOR_BETTER; + class HitRightLeg: HitLeftLeg { + name = "leg_r"; }; }; }; class O_Soldier_base_F: SoldierEB { class HitPoints: HitPoints { - class HitFace: HitHead { - armor = 999; - }; - class HitNeck: HitFace { - armor = 999; - }; - class HitHead: HitNeck { - armor = 1; - }; - class HitPelvis: HitBody { - armor = 999; - passThrough = 0.5; - explosionShielding = 2.4; - }; - class HitAbdomen: HitPelvis { - armor = 999; - passThrough = 0.5; - explosionShielding = 2.4; - }; - class HitDiaphragm: HitAbdomen { - armor = 999; - passThrough = 0.5; - explosionShielding = 2.4; - }; - class HitChest: HitDiaphragm { - armor = 999; - passThrough = 0.5; - explosionShielding = 2.4; - }; - class HitBody: HitChest { - armor = 4; - passThrough = 0.5; - explosionShielding = 2.4; - }; - class HitArms: HitHands { - armor = 999; - passThrough = 0.5; - explosionShielding = 1.2; - }; - class HitHands: HitArms { - armor = 999; - passThrough = 0.5; - explosionShielding = 1.2; - }; - class HitLegs: HitLegs { - armor = 999; - passThrough = 0.5; - explosionShielding = 1.2; - }; - - - class HitLeftArm: HitLeftArm { + class HitFace; + class HitNeck; + class HitHead; + class HitPelvis; + class HitAbdomen; + class HitDiaphragm; + class HitChest; + class HitBody; + class HitArms; + class HitHands; + class HitLegs; + class HitLeftArm: HitHands { armor = ARM_LEG_ARMOR_CSAT; - passThrough = 0.85; + name = "hand_l"; // @todo hopefully these still include the whole arm + hands }; - - class HitRightArm: HitRightArm { - armor = ARM_LEG_ARMOR_CSAT; - passThrough = 0.85; + class HitRightArm: HitLeftArm { + name = "hand_r"; // @todo hopefully these still include the whole arm + hands }; - - class HitLeftLeg: HitLeftLeg { + class HitLeftLeg: HitLegs { armor = ARM_LEG_ARMOR_CSAT; - passThrough = 0.85; + name = "leg_l"; }; - - class HitRightLeg: HitRightLeg { - armor = ARM_LEG_ARMOR_CSAT; - passThrough = 0.85; + class HitRightLeg: HitLeftLeg { + name = "leg_r"; }; }; }; class O_Soldier_02_F: O_Soldier_base_F { class HitPoints: HitPoints { - class HitFace: HitHead { - armor = 999; - }; - class HitNeck: HitFace { - armor = 999; - }; - class HitHead: HitNeck { - armor = 1; - }; - class HitPelvis: HitBody { - armor = 999; - passThrough = 0.5; - explosionShielding = 2.4; - }; - class HitAbdomen: HitPelvis { - armor = 999; - passThrough = 0.5; - explosionShielding = 2.4; - }; - class HitDiaphragm: HitAbdomen { - armor = 999; - passThrough = 0.5; - explosionShielding = 2.4; - }; - class HitChest: HitDiaphragm { - armor = 999; - passThrough = 0.5; - explosionShielding = 2.4; - }; - class HitBody: HitChest { - armor = 4; - passThrough = 0.5; - explosionShielding = 2.4; - }; - class HitArms: HitHands { - armor = 999; - passThrough = 0.5; - explosionShielding = 1.2; - }; - class HitHands: HitArms { - armor = 999; - passThrough = 0.5; - explosionShielding = 1.2; - }; - class HitLegs: HitLegs { - armor = 999; - passThrough = 0.5; - explosionShielding = 1.2; - }; - - class HitLeftArm: HitLeftArm { + class HitFace; + class HitNeck; + class HitHead; + class HitPelvis; + class HitAbdomen; + class HitDiaphragm; + class HitChest; + class HitBody; + class HitArms; + class HitHands; + class HitLegs; + class HitLeftArm: HitHands { armor = ARM_LEG_ARMOR_CSAT; - passThrough = 0.85; + name = "hand_l"; // @todo hopefully these still include the whole arm + hands }; - - class HitRightArm: HitRightArm { - armor = ARM_LEG_ARMOR_CSAT; - passThrough = 0.85; + class HitRightArm: HitLeftArm { + name = "hand_r"; // @todo hopefully these still include the whole arm + hands }; - - class HitLeftLeg: HitLeftLeg { + class HitLeftLeg: HitLegs { armor = ARM_LEG_ARMOR_CSAT; - passThrough = 0.85; + name = "leg_l"; }; - - class HitRightLeg: HitRightLeg { - armor = ARM_LEG_ARMOR_CSAT; - passThrough = 0.85; + class HitRightLeg: HitLeftLeg { + name = "leg_r"; }; }; }; + + class O_officer_F: O_Soldier_base_F { + class HitPoints: HitPoints { + class HitFace; + class HitNeck; + class HitHead; + class HitPelvis; + class HitAbdomen; + class HitDiaphragm; + class HitChest; + class HitBody; + class HitArms; + class HitHands; + class HitLegs; + class HitLeftArm: HitHands { + armor = ARM_LEG_ARMOR_CSAT; // @todo is that suppossed to be the case? + name = "hand_l"; // @todo hopefully these still include the whole arm + hands + }; + class HitRightArm: HitLeftArm { + name = "hand_r"; // @todo hopefully these still include the whole arm + hands + }; + class HitLeftLeg: HitLegs { + armor = ARM_LEG_ARMOR_CSAT; // @todo is that suppossed to be the case? + name = "leg_l"; + }; + class HitRightLeg: HitLeftLeg { + name = "leg_r"; + }; + }; + }; + + class O_Protagonist_VR_F: O_Soldier_base_F { + class HitPoints: HitPoints { + class HitHead; + class HitBody; + class HitHands; + class HitLegs; + class HitLeftArm: HitHands { + armor = 2; + name = "hand_l"; // @todo hopefully these still include the whole arm + hands + }; + class HitRightArm: HitLeftArm { + name = "hand_r"; // @todo hopefully these still include the whole arm + hands + }; + class HitLeftLeg: HitLegs { + armor = 2; + name = "leg_l"; + }; + class HitRightLeg: HitLeftLeg { + name = "leg_r"; + }; + }; + }; + class MapBoard_altis_F; class ACE_bodyBagObject: MapBoard_altis_F { XEH_ENABLED; From 3362bbf0bf41bb496c469d549fae034d81239c51 Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 1 Sep 2015 00:01:42 +0200 Subject: [PATCH 058/132] fix protection 1.50 ubc issues --- addons/protection/FixUniforms.hpp | 569 ------------------------------ 1 file changed, 569 deletions(-) diff --git a/addons/protection/FixUniforms.hpp b/addons/protection/FixUniforms.hpp index 24c02b79aa..e69de29bb2 100644 --- a/addons/protection/FixUniforms.hpp +++ b/addons/protection/FixUniforms.hpp @@ -1,569 +0,0 @@ - -class Man; -class CAManBase: Man { - class HitPoints { - class HitHead { - /*armor = 1; - passThrough = 1; - radius = 0.1; - explosionShielding = 0.5; - minimalHit = 0;*/ - }; - - class HitBody { - /*armor = 1; - passThrough = 1; - radius = 0.15; - explosionShielding = 10; - minimalHit = 0;*/ - }; - - class HitHands { - /*armor = 1; - passThrough = 1; - radius = 0.08; - explosionShielding = 1; - minimalHit = 0;*/ - }; - - class HitLegs { - /*armor = 1; - passThrough = 1; - radius = 0.1; - explosionShielding = 1; - minimalHit = 0;*/ - }; - }; - - /*armor = 2; - armorStructural = 5;*/ -}; - -class Civilian: CAManBase { - /*class HitPoints: HitPoints { - class HitHead: HitHead { - armor = 1; - }; - - class HitBody: HitBody { - armor = 2; - }; - - class HitHands: HitHands { - armor = 2; - }; - - class HitLegs: HitLegs { - armor = 2; - }; - };*/ -}; - -/*class Civilian_F: Civilian {}; -class C_man_1: Civilian_F {};*/ - -class SoldierWB: CAManBase {}; -class SoldierEB: CAManBase {}; -class SoldierGB: CAManBase {}; - -class B_Soldier_base_F: SoldierWB { - /*class HitPoints: HitPoints { - class HitHead: HitHead { - armor = 1; - }; - - class HitBody: HitBody { - armor = 2; - }; - - class HitHands: HitHands { - armor = 2; - }; - - class HitLegs: HitLegs { - armor = 2; - }; - }; - - armor = 2; - armorStructural = 5;*/ -}; - -class B_Soldier_02_f: B_Soldier_base_F { // t-shirt - /*class HitPoints: HitPoints { - class HitHead: HitHead { - armor = 1; - }; - - class HitBody: HitBody { - armor = 1; - }; - - class HitHands: HitHands { - armor = 1; - }; - - class HitLegs: HitLegs { - armor = 2; - }; - };*/ - - armorStructural = 5; //7; -}; - -class B_Soldier_03_f: B_Soldier_base_F { // sleeves - /*class HitPoints: HitPoints { - class HitHead: HitHead { - armor = 1; - }; - - class HitBody: HitBody { - armor = 2; - }; - - class HitHands: HitHands { - armor = 1; - }; - - class HitLegs: HitLegs { - armor = 2; - }; - };*/ - - armorStructural = 5; //7; -}; - -class B_Soldier_04_f: B_Soldier_base_F { // heli pilot - class HitPoints: HitPoints { - class HitHead: HitHead { - /*armor = 1; - passThrough = 1; - explosionShielding = 0.5;*/ - }; - - class HitBody: HitBody { - /*armor = 2;*/ - passThrough = 1; //0.5; - /*explosionShielding = 2.4;*/ - }; - - class HitHands: HitHands { - armor = 2; //8; - passThrough = 1; //0.5; - /*explosionShielding = 1.2;*/ - }; - - class HitLegs: HitLegs { - armor = 2; //8; - passThrough = 1; //0.5; - /*explosionShielding = 1.2;*/ - }; - }; -}; - -class B_Soldier_05_f: B_Soldier_base_F { // cas pilot - armorStructural = 5; //3; - - class HitPoints: HitPoints { - class HitHead: HitHead { - /*armor = 1; - passThrough = 1; - explosionShielding = 0.5;*/ - }; - - class HitBody: HitBody { - armor = 3; //2; - passThrough = 1; //0.5; - /*explosionShielding = 2.4;*/ - }; - - class HitHands: HitHands { - armor = 3; //8; - /*passThrough = 1; - explosionShielding = 1.2;*/ - }; - - class HitLegs: HitLegs { - armor = 3; //8; - /*passThrough = 1; - explosionShielding = 1.2;*/ - }; - }; -}; - -class B_Soldier_diver_base_F: B_Soldier_base_F { - /*class HitPoints: HitPoints { - class HitHead: HitHead { - armor = 2; - }; - - class HitBody: HitBody { - armor = 2; - }; - - class HitHands: HitHands { - armor = 2; - }; - - class HitLegs: HitLegs { - armor = 2; - }; - };*/ -}; - -// these appear to be broken, remnants from A2? -/*class C_man_p_fugitive_F: C_man_1 { - class HitPoints: HitPoints { - class HitBody: HitBody { - armor = "0.3*10"; - }; - - class HitLegs: HitLegs { - armor = "0.3*5"; - }; - }; -}; - -class C_man_w_worker_F: C_man_1 { - class HitPoints: HitPoints { - class HitBody: HitBody { - armor = "0.6*10"; - }; - - class HitHands: HitHands { - armor = "0.5*5"; - }; - - class HitLegs: HitLegs { - armor = "0.5*5"; - }; - }; -}; - -class C_man_hunter_1_F: C_man_1 { - class HitPoints: HitPoints { - class HitBody: HitBody { - armor = "0.6*10"; - }; - - class HitHands: HitHands { - armor = "0.5*5"; - }; - - class HitLegs: HitLegs { - armor = "0.5*5"; - }; - }; -}; - -class C_man_p_shorts_1_F: C_man_1 { - class HitPoints: HitPoints { - class HitLegs: HitLegs { - armor = "0.3*5"; - }; - }; -}; - -class C_man_pilot_F: C_man_1 { - class HitPoints: HitPoints { - class HitBody: HitBody { - armor = "0.6*10"; - }; - - class HitHands: HitHands { - armor = "0.5*5"; - }; - - class HitLegs: HitLegs { - armor = "0.5*5"; - }; - }; -};*/ - -class I_Soldier_base_F: SoldierGB { - /*class HitPoints: HitPoints { - class HitHead: HitHead { - armor = 1; - }; - - class HitBody: HitBody { - armor = 2; - }; - - class HitHands: HitHands { - armor = 2; - }; - - class HitLegs: HitLegs { - armor = 2; - }; - };*/ - - /*armor = 2;*/ - armorStructural = 5; //7; -}; - -class I_Soldier_02_F: I_Soldier_base_F { // sleeves - /*class HitPoints: HitPoints { - class HitHead: HitHead { - armor = 1; - }; - - class HitBody: HitBody { - armor = 2; - }; - - class HitHands: HitHands { - armor = 1; - }; - - class HitLegs: HitLegs { - armor = 2; - }; - };*/ -}; - -class I_Soldier_03_F: I_Soldier_base_F { // heli pilot - /*armorStructural = 5;*/ - - class HitPoints: HitPoints { - class HitHead: HitHead { - /*armor = 1; - passThrough = 1; - explosionShielding = 0.5;*/ - }; - - class HitBody: HitBody { - /*armor = 2;*/ - passThrough = 1; //0.5; - /*explosionShielding = 2.4;*/ - }; - - class HitHands: HitHands { - armor = 2; //8; - passThrough = 1; //0.5; - /*explosionShielding = 1.2;*/ - }; - - class HitLegs: HitLegs { - armor = 2; //8; - passThrough = 1; //0.5; - /*explosionShielding = 1.2;*/ - }; - }; -}; - -class I_Soldier_04_F: I_Soldier_base_F { // cas pilot - armorStructural = 5; //3; - - class HitPoints: HitPoints { - class HitHead: HitHead { - /*armor = 1; - passThrough = 1; - explosionShielding = 0.5;*/ - }; - - class HitBody: HitBody { - armor = 3; //2; - passThrough = 1; //0.5; - /*explosionShielding = 2.4;*/ - }; - - class HitHands: HitHands { - armor = 3; //8; - /*passThrough = 1; - explosionShielding = 1.2;*/ - }; - - class HitLegs: HitLegs { - armor = 3; //8; - /*passThrough = 1; - explosionShielding = 1.2;*/ - }; - }; -}; - -class I_Soldier_diver_base_F: I_Soldier_base_F { - /*class HitPoints: HitPoints { - class HitHead: HitHead { - armor = 2; - }; - - class HitBody: HitBody { - armor = 2; - }; - - class HitHands: HitHands { - armor = 2; - }; - - class HitLegs: HitLegs { - armor = 2; - }; - };*/ -}; - -class O_Soldier_base_F: SoldierEB { - class HitPoints: HitPoints { - class HitHead: HitHead { - /*armor = 1; - passThrough = 1; - explosionShielding = 0.5;*/ - }; - - class HitBody: HitBody { - armor = 4; //6; - passThrough = 0.85; //0.5; - /*explosionShielding = 1.5;*/ - }; - - class HitHands: HitHands { - armor = 4; //8; - passThrough = 0.85; //0.5; - /*explosionShielding = 0.8;*/ - }; - - class HitLegs: HitLegs { - armor = 4; //8; - passThrough = 0.85; //0.5; - /*explosionShielding = 0.8;*/ - }; - }; - - /*armor = 2; - armorStructural = 5;*/ -}; - -class O_officer_F: O_Soldier_base_F { - class HitPoints: HitPoints { - class HitHead: HitHead { - /*armor = 1; - passThrough = 1; - explosionShielding = 0.5;*/ - }; - - class HitBody: HitBody { - /*armor = 2; - passThrough = 1; - explosionShielding = 10;*/ - }; - - class HitHands: HitHands { - /*armor = 2; - passThrough = 1; - explosionShielding = 1;*/ - }; - - class HitLegs: HitLegs { - armor = 2; //8; - passThrough = 1; //0.5; - /*explosionShielding = 1;*/ - }; - }; -}; - -class O_Soldier_02_F: O_Soldier_base_F { // crew ? - armorStructural = 5; //3; - - class HitPoints: HitPoints { - class HitHead: HitHead { - /*armor = 1; - passThrough = 1; - explosionShielding = 0.5;*/ - }; - - class HitBody: HitBody { - armor = 4; //6; - passThrough = 0.85; //0.5; - /*explosionShielding = 1.5;*/ - }; - - class HitHands: HitHands { - armor = 4; //8; - passThrough = 0.85; //1; - /*explosionShielding = 0.8;*/ - }; - - class HitLegs: HitLegs { - armor = 4; //8; - passThrough = 0.85; //1; - /*explosionShielding = 0.8;*/ - }; - }; -}; - -class O_Soldier_diver_base_F: O_Soldier_base_F { - /*class HitPoints: HitPoints { - class HitHead: HitHead { - armor = 2; - }; - - class HitBody: HitBody { - armor = 2; - }; - - class HitHands: HitHands { - armor = 2; - }; - - class HitLegs: HitLegs { - armor = 2; - }; - };*/ -}; - -class O_Soldier_VR_F: O_Soldier_base_F { - /*class HitPoints: HitPoints { - class HitHead: HitHead { - armor = 1; - passThrough = 1; - explosionShielding = 0.5; - }; - - class HitBody: HitBody { - armor = 2; - passThrough = 1; - explosionShielding = 10; - }; - - class HitHands: HitHands { - armor = 2; - passThrough = 1; - explosionShielding = 1; - }; - - class HitLegs: HitLegs { - armor = 2; - passThrough = 1; - explosionShielding = 1; - }; - };*/ -}; - -class O_Protagonist_VR_F: O_Soldier_base_F { - /*class HitPoints: HitPoints { - class HitHead: HitHead { - armor = 1; - passThrough = 1; - explosionShielding = 0.5; - }; - - class HitBody: HitBody { - armor = 2; - passThrough = 1; - explosionShielding = 10; - }; - - class HitHands: HitHands { - armor = 2; - passThrough = 1; - explosionShielding = 1; - }; - - class HitLegs: HitLegs { - armor = 2; - passThrough = 1; - explosionShielding = 1; - }; - };*/ -}; From c97e0eb500825394dc63894ea11922bfc4d9dcd5 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Mon, 31 Aug 2015 22:50:01 -0500 Subject: [PATCH 059/132] MapTools - Handle Bad Aspect Ratio --- addons/maptools/functions/fnc_updateMapToolMarkers.sqf | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/addons/maptools/functions/fnc_updateMapToolMarkers.sqf b/addons/maptools/functions/fnc_updateMapToolMarkers.sqf index 5c88d907b8..5d11c6a6e9 100644 --- a/addons/maptools/functions/fnc_updateMapToolMarkers.sqf +++ b/addons/maptools/functions/fnc_updateMapToolMarkers.sqf @@ -18,7 +18,7 @@ params ["_theMap"]; -private ["_rotatingTexture", "_textureWidth", "_scale", "_xPos", "_yPos"]; +private ["_rotatingTexture", "_textureWidth", "_scaleX", "_scaleY", "_xPos", "_yPos"]; // Show/Hide draw buttons if ([] call FUNC(canDraw)) then { @@ -43,16 +43,18 @@ if (GVAR(mapTool_Shown) == 1) then { }; // Update scale of both parts -_scale = _textureWidth * CONSTANT_SCALE * (call FUNC(calculateMapScale)); +getResolution params ["_resWidth", "_resHeight", "", "", "_aspectRatio"]; +_scaleX = 32 * _textureWidth * CONSTANT_SCALE * (call FUNC(calculateMapScale)); +_scaleY = _scaleX * ((_resWidth / _resHeight) / _aspectRatio); //handle bad aspect ratios // Position of the fixed part _xPos = GVAR(mapTool_pos) select 0; _yPos = (GVAR(mapTool_pos) select 1) + _textureWidth * CENTER_OFFSET_Y_PERC; -_theMap drawIcon [QUOTE(PATHTOF(data\mapToolFixed.paa)), [1,1,1,1], [_xPos,_yPos], (32 * _scale), (32 * _scale), 0, "", 0]; +_theMap drawIcon [QUOTE(PATHTOF(data\mapToolFixed.paa)), [1,1,1,1], [_xPos,_yPos], _scaleX, _scaleY, 0, "", 0]; // Position and rotation of the rotating part _xPos = (GVAR(mapTool_pos) select 0) + sin(GVAR(mapTool_angle)) * _textureWidth * CENTER_OFFSET_Y_PERC; _yPos = (GVAR(mapTool_pos) select 1) + cos(GVAR(mapTool_angle)) * _textureWidth * CENTER_OFFSET_Y_PERC; -_theMap drawIcon [_rotatingTexture, [1,1,1,1], [_xPos,_yPos], (32 * _scale), (32 * _scale), GVAR(mapTool_angle), "", 0]; +_theMap drawIcon [_rotatingTexture, [1,1,1,1], [_xPos,_yPos], _scaleX, _scaleY, GVAR(mapTool_angle), "", 0]; From 73911f701d4319633c2f316fd3e5a766a02ed727 Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 1 Sep 2015 08:53:11 +0200 Subject: [PATCH 060/132] add debug messages for #2134 --- addons/common/functions/fnc_checkFiles.sqf | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/addons/common/functions/fnc_checkFiles.sqf b/addons/common/functions/fnc_checkFiles.sqf index 647a1b00a6..468a5c906c 100644 --- a/addons/common/functions/fnc_checkFiles.sqf +++ b/addons/common/functions/fnc_checkFiles.sqf @@ -63,24 +63,33 @@ if (isMultiplayer) then { // send servers version of ACE to all clients GVAR(ServerVersion) = _version; GVAR(ServerAddons) = _addons; + diag_log text format ["[ACE] DEBUG: ServerVersion - %1", GVAR(ServerVersion)]; + diag_log text format ["[ACE] DEBUG: ServerAddons - %1", GVAR(ServerAddons)]; publicVariable QGVAR(ServerVersion); publicVariable QGVAR(ServerAddons); } else { // clients have to wait for the variables [{ - if (isNil QGVAR(ServerVersion) || isNil QGVAR(ServerAddons)) exitWith {}; + if (isNil QGVAR(ServerVersion) || isNil QGVAR(ServerAddons)) exitWith { + diag_log text "[ACE] DEBUG: Waiting for file info from server."; + }; private ["_version","_addons"]; _version = (_this select 0) select 0; _addons = (_this select 0) select 1; + diag_log text format ["[ACE] DEBUG: ServerVersion - %1", GVAR(ServerVersion)]; + diag_log text format ["[ACE] DEBUG: ServerAddons - %1", GVAR(ServerAddons)]; + diag_log text format ["[ACE] DEBUG: ClientVersion - %1", _version]; + diag_log text format ["[ACE] DEBUG: ClientAddons - %1", _addons]; + if (_version != GVAR(ServerVersion)) then { private "_errorMsg"; _errorMsg = format ["Client/Server Version Mismatch. Server: %1, Client: %2.", GVAR(ServerVersion), _version]; diag_log text format ["[ACE] ERROR: %1", _errorMsg]; - if (hasInterface) then {diag_log str "1"; + if (hasInterface) then { ["[ACE] ERROR", _errorMsg, {findDisplay 46 closeDisplay 0}] call FUNC(errorMessage); }; }; @@ -91,7 +100,7 @@ if (isMultiplayer) then { diag_log text format ["[ACE] ERROR: %1", _errorMsg]; - if (hasInterface) then {diag_log str "1"; + if (hasInterface) then { ["[ACE] ERROR", _errorMsg, {findDisplay 46 closeDisplay 0}] call FUNC(errorMessage); }; }; From 5e68486233b8e56418d9a235215b9d046ea77ed9 Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 1 Sep 2015 10:06:01 +0200 Subject: [PATCH 061/132] high command module breaks ace, fix #2134 --- addons/common/functions/fnc_checkFiles.sqf | 18 ++++++++++-------- addons/main/config.cpp | 1 - addons/winddeflection/config.cpp | 1 - 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/addons/common/functions/fnc_checkFiles.sqf b/addons/common/functions/fnc_checkFiles.sqf index 468a5c906c..3205209130 100644 --- a/addons/common/functions/fnc_checkFiles.sqf +++ b/addons/common/functions/fnc_checkFiles.sqf @@ -20,7 +20,9 @@ _version = getText (configFile >> "CfgPatches" >> "ace_main" >> "versionStr"); diag_log text format ["[ACE]: ACE is version %1.", _version]; private "_addons"; -_addons = activatedAddons; +//_addons = activatedAddons; // broken with High-Command module, see #2134 +_addons = "true" configClasses (configFile >> "CfgPatches");// +_addons = [_addons, {toLower configName _this}] call FUNC(map);// _addons = [_addons, {_this find "ace_" == 0}] call FUNC(filter); { @@ -63,25 +65,25 @@ if (isMultiplayer) then { // send servers version of ACE to all clients GVAR(ServerVersion) = _version; GVAR(ServerAddons) = _addons; - diag_log text format ["[ACE] DEBUG: ServerVersion - %1", GVAR(ServerVersion)]; - diag_log text format ["[ACE] DEBUG: ServerAddons - %1", GVAR(ServerAddons)]; + //diag_log text format ["[ACE] DEBUG: ServerVersion - %1", GVAR(ServerVersion)]; + //diag_log text format ["[ACE] DEBUG: ServerAddons - %1", GVAR(ServerAddons)]; publicVariable QGVAR(ServerVersion); publicVariable QGVAR(ServerAddons); } else { // clients have to wait for the variables [{ if (isNil QGVAR(ServerVersion) || isNil QGVAR(ServerAddons)) exitWith { - diag_log text "[ACE] DEBUG: Waiting for file info from server."; + //diag_log text "[ACE] DEBUG: Waiting for file info from server."; }; private ["_version","_addons"]; _version = (_this select 0) select 0; _addons = (_this select 0) select 1; - diag_log text format ["[ACE] DEBUG: ServerVersion - %1", GVAR(ServerVersion)]; - diag_log text format ["[ACE] DEBUG: ServerAddons - %1", GVAR(ServerAddons)]; - diag_log text format ["[ACE] DEBUG: ClientVersion - %1", _version]; - diag_log text format ["[ACE] DEBUG: ClientAddons - %1", _addons]; + //diag_log text format ["[ACE] DEBUG: ServerVersion - %1", GVAR(ServerVersion)]; + //diag_log text format ["[ACE] DEBUG: ServerAddons - %1", GVAR(ServerAddons)]; + //diag_log text format ["[ACE] DEBUG: ClientVersion - %1", _version]; + //diag_log text format ["[ACE] DEBUG: ClientAddons - %1", _addons]; if (_version != GVAR(ServerVersion)) then { private "_errorMsg"; diff --git a/addons/main/config.cpp b/addons/main/config.cpp index c6f487aa53..a013d8e971 100644 --- a/addons/main/config.cpp +++ b/addons/main/config.cpp @@ -545,7 +545,6 @@ class CfgPatches { }; author[] = {ECSTRING(common,ACETeam)}; authorUrl = "http://ace3mod.com/"; - versionDesc = "ACE3"; VERSION_CONFIG; }; }; diff --git a/addons/winddeflection/config.cpp b/addons/winddeflection/config.cpp index df2b55d221..a7bedbb9ef 100644 --- a/addons/winddeflection/config.cpp +++ b/addons/winddeflection/config.cpp @@ -6,7 +6,6 @@ class CfgPatches { weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_weather"}; - versionDesc = "ACE Wind Deflection"; author[] = {ECSTRING(common,ACETeam), "Glowbal", "Ruthberg"}; authorUrl = "http://ace3mod.com/"; VERSION_CONFIG; From b1fbbcc49f1be5ad84aedf39d679cae08885a7a5 Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 1 Sep 2015 12:46:15 +0200 Subject: [PATCH 062/132] bouncing flashbangs, fix #1907 --- addons/grenades/CfgAmmo.hpp | 41 ++++++++++++++++++++++--------------- addons/grenades/Effects.hpp | 4 ++++ addons/grenades/config.cpp | 2 ++ 3 files changed, 30 insertions(+), 17 deletions(-) create mode 100644 addons/grenades/Effects.hpp diff --git a/addons/grenades/CfgAmmo.hpp b/addons/grenades/CfgAmmo.hpp index 61f20eb935..120d3ab5ea 100644 --- a/addons/grenades/CfgAmmo.hpp +++ b/addons/grenades/CfgAmmo.hpp @@ -5,28 +5,28 @@ class CfgAmmo { flareSize = 12; timeToLive = 60; }; + class F_40mm_White: FlareBase { intensity = 40000; flareSize = 12; }; + class F_20mm_White: FlareBase { intensity = 20000; flareSize = 6; }; + class F_Signal_Green: FlareBase { intensity = 20000; flareSize = 12; }; + class Flare_82mm_AMOS_White: FlareCore { intensity = 80000; flareSize = 12; timeToLive = 60; }; - class F_20mm_Red: F_20mm_White {}; - class F_20mm_Green: F_20mm_White {}; - class F_20mm_Yellow: F_20mm_White {}; - class ACE_F_Hand_White: F_20mm_White { grenadeBurningSound[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; grenadeFireSound[] = {"SmokeShellSoundHit1",0.25,"SmokeShellSoundHit2",0.25,"SmokeShellSoundHit3",0.5}; @@ -38,6 +38,8 @@ class CfgAmmo { SmokeShellSoundLoop2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop2",0.125893,1,70}; timeToLive = 60; }; + + class F_20mm_Red; class ACE_F_Hand_Red: F_20mm_Red { grenadeBurningSound[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; grenadeFireSound[] = {"SmokeShellSoundHit1",0.25,"SmokeShellSoundHit2",0.25,"SmokeShellSoundHit3",0.5}; @@ -49,6 +51,8 @@ class CfgAmmo { SmokeShellSoundLoop2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop2",0.125893,1,70}; timeToLive = 60; }; + + class F_20mm_Green; class ACE_F_Hand_Green: F_20mm_Green { grenadeBurningSound[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; grenadeFireSound[] = {"SmokeShellSoundHit1",0.25,"SmokeShellSoundHit2",0.25,"SmokeShellSoundHit3",0.5}; @@ -60,6 +64,8 @@ class CfgAmmo { SmokeShellSoundLoop2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop2",0.125893,1,70}; timeToLive = 60; }; + + class F_20mm_Yellow; class ACE_F_Hand_Yellow: F_20mm_Yellow { grenadeBurningSound[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; grenadeFireSound[] = {"SmokeShellSoundHit1",0.25,"SmokeShellSoundHit2",0.25,"SmokeShellSoundHit3",0.5}; @@ -72,20 +78,21 @@ class CfgAmmo { timeToLive = 60; }; - class ACE_G_M84: F_20mm_Yellow { - useFlare = 0; - flareSize = 0; - intensity = 0; - grenadeBurningSound[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; - grenadeFireSound[] = {"SmokeShellSoundHit1",0.25,"SmokeShellSoundHit2",0.25,"SmokeShellSoundHit3",0.5}; - soundTrigger[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; - SmokeShellSoundHit1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_1",1.25893,1,100}; - SmokeShellSoundHit2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_2",1.25893,1,100}; - SmokeShellSoundHit3[] = {"A3\Sounds_F\weapons\smokeshell\smoke_3",1.25893,1,100}; - SmokeShellSoundLoop1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop1",0.125893,1,70}; - SmokeShellSoundLoop2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop2",0.125893,1,70}; + class SmokeShell; + class ACE_G_M84: SmokeShell { + model = PATHTOF(models\ACE_m84_thrown.p3d); + dangerRadiusHit = -1; + suppressionRadiusHit = 20; + typicalSpeed = 22; + cost = 40; + deflecting = 15; timeToLive = 6; fuseDistance = 2.3; - model = PATHTOF(models\ACE_m84_thrown.p3d); + grenadeFireSound[] = {}; + grenadeBurningSound[] = {}; + aiAmmoUsageFlags = "0"; + smokeColor[] = {0,0,0,0}; + effectsSmoke = "ACE_M84FlashbangEffect"; + whistleDist = 0; }; }; diff --git a/addons/grenades/Effects.hpp b/addons/grenades/Effects.hpp new file mode 100644 index 0000000000..c9e214de5c --- /dev/null +++ b/addons/grenades/Effects.hpp @@ -0,0 +1,4 @@ + +class ACE_M84FlashbangEffect { + // empty +}; diff --git a/addons/grenades/config.cpp b/addons/grenades/config.cpp index c2a899d66c..2f9e631fe1 100644 --- a/addons/grenades/config.cpp +++ b/addons/grenades/config.cpp @@ -17,3 +17,5 @@ class CfgPatches { #include "CfgWeapons.hpp" #include "CfgMagazines.hpp" #include "CfgVehicles.hpp" + +#include "Effects.hpp" From de66c2be7b19d951394fa6303fffda569fbd9071 Mon Sep 17 00:00:00 2001 From: bux578 Date: Tue, 1 Sep 2015 13:16:58 +0200 Subject: [PATCH 063/132] add commy's newest issue --- documentation/development/arma-3-issues.md | 1 + 1 file changed, 1 insertion(+) diff --git a/documentation/development/arma-3-issues.md b/documentation/development/arma-3-issues.md index 16f9988409..c28dc2f118 100644 --- a/documentation/development/arma-3-issues.md +++ b/documentation/development/arma-3-issues.md @@ -18,6 +18,7 @@ Keeping track of Arma 3 issues that need to be fixed. If you want to support us * [bux578: 0022000: Add/Alter script command to add perfectly configured weapons to cargo](http://feedback.arma3.com/view.php?id=22000) * [commy2: 0021443: Unexpected behavior of += array in configs](http://feedback.arma3.com/view.php?id=21443) * [commy2: 0022671: setVariable is not always JIP persistent](http://feedback.arma3.com/view.php?id=22671) +* [commy2: 0025404: splitString scripting command causes game crash] (http://feedback.arma3.com/view.php?id=25404) * [CorruptedHeart: 0022318: Can no longer use "MenuBack" shortcut in AddAction](http://feedback.arma3.com/view.php?id=22318) * [James2464: 0023725: All Environment Rocks Should Have PhysX LODs](http://feedback.arma3.com/view.php?id=23725) * [Jaynus: 0023679: Display event handler return values for mouse buttons should be respected](http://feedback.arma3.com/view.php?id=23679) From dd788342fe80576dfeb5614b95b56e87b350997c Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 1 Sep 2015 16:37:46 +0200 Subject: [PATCH 064/132] remove commented debug messages --- addons/common/functions/fnc_checkFiles.sqf | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/addons/common/functions/fnc_checkFiles.sqf b/addons/common/functions/fnc_checkFiles.sqf index 3205209130..c1a0b1cb89 100644 --- a/addons/common/functions/fnc_checkFiles.sqf +++ b/addons/common/functions/fnc_checkFiles.sqf @@ -65,26 +65,17 @@ if (isMultiplayer) then { // send servers version of ACE to all clients GVAR(ServerVersion) = _version; GVAR(ServerAddons) = _addons; - //diag_log text format ["[ACE] DEBUG: ServerVersion - %1", GVAR(ServerVersion)]; - //diag_log text format ["[ACE] DEBUG: ServerAddons - %1", GVAR(ServerAddons)]; publicVariable QGVAR(ServerVersion); publicVariable QGVAR(ServerAddons); } else { // clients have to wait for the variables [{ - if (isNil QGVAR(ServerVersion) || isNil QGVAR(ServerAddons)) exitWith { - //diag_log text "[ACE] DEBUG: Waiting for file info from server."; - }; + if (isNil QGVAR(ServerVersion) || isNil QGVAR(ServerAddons)) exitWith {}; private ["_version","_addons"]; _version = (_this select 0) select 0; _addons = (_this select 0) select 1; - //diag_log text format ["[ACE] DEBUG: ServerVersion - %1", GVAR(ServerVersion)]; - //diag_log text format ["[ACE] DEBUG: ServerAddons - %1", GVAR(ServerAddons)]; - //diag_log text format ["[ACE] DEBUG: ClientVersion - %1", _version]; - //diag_log text format ["[ACE] DEBUG: ClientAddons - %1", _addons]; - if (_version != GVAR(ServerVersion)) then { private "_errorMsg"; _errorMsg = format ["Client/Server Version Mismatch. Server: %1, Client: %2.", GVAR(ServerVersion), _version]; From 264091957a53995e320b29edd4c4b972d5e58739 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 1 Sep 2015 10:09:08 -0500 Subject: [PATCH 065/132] #1917 - Pointing Update Circle Icon --- addons/finger/functions/fnc_perFrameEH.sqf | 2 +- addons/finger/ui/fp_icon2.paa | Bin 0 -> 66500 bytes 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 addons/finger/ui/fp_icon2.paa diff --git a/addons/finger/functions/fnc_perFrameEH.sqf b/addons/finger/functions/fnc_perFrameEH.sqf index d6297a4095..7f0150c492 100644 --- a/addons/finger/functions/fnc_perFrameEH.sqf +++ b/addons/finger/functions/fnc_perFrameEH.sqf @@ -41,7 +41,7 @@ _iconSize = BASE_SIZE * _fovCorrection; _drawColor set [3, ((_drawColor select 3) * (_timeLeftToShow / 0.5))]; }; - drawIcon3D [QUOTE(PATHTOF(UI\fp_icon.paa)), _drawColor, _pos, _iconSize, _iconSize, 0, _name, 1, 0.03, "PuristaMedium"]; + drawIcon3D [QUOTE(PATHTOF(UI\fp_icon2.paa)), _drawColor, _pos, _iconSize, _iconSize, 0, _name, 1, 0.03, "PuristaMedium"]; }; } count (GVAR(fingersHash) select 0); diff --git a/addons/finger/ui/fp_icon2.paa b/addons/finger/ui/fp_icon2.paa new file mode 100644 index 0000000000000000000000000000000000000000..4f7fde9f10bc96e84a1a076ff8ffbcea57ea3e7d GIT binary patch literal 66500 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%0D}Va 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 F{{YsY(?9?K literal 0 HcmV?d00001 From 405d85eaaa0369a65b0523e7dd7f806f264cf629 Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 1 Sep 2015 19:06:20 +0200 Subject: [PATCH 066/132] fix leaning back through chair while sitting, fix #1795 --- addons/sitting/CfgMoves.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/sitting/CfgMoves.hpp b/addons/sitting/CfgMoves.hpp index fc902032e2..5cef0fbc6d 100644 --- a/addons/sitting/CfgMoves.hpp +++ b/addons/sitting/CfgMoves.hpp @@ -1,6 +1,9 @@ // Enable visual head movement while free-looking #define MACRO_ANIMATION \ - head = "headDefault"; + head = "headDefault"; \ + aimingBody = "aimingNo"; \ + forceAim = 1; \ + static = 1; class CfgMovesBasic; class CfgMovesMaleSdr: CfgMovesBasic { From acfc48efc22591784905b56b7f4804b821e74c34 Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 1 Sep 2015 20:00:28 +0200 Subject: [PATCH 067/132] animate head when surrendered and handcuffed --- addons/captives/CfgMoves.hpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/addons/captives/CfgMoves.hpp b/addons/captives/CfgMoves.hpp index 161fcce9a4..8fa3440706 100644 --- a/addons/captives/CfgMoves.hpp +++ b/addons/captives/CfgMoves.hpp @@ -35,6 +35,12 @@ class CfgMovesMaleSdr: CfgMovesBasic { class CutSceneAnimationBase; + #define MACRO_ANIMATION \ + head = "headDefault"; \ + aimingBody = "aimingNo"; \ + forceAim = 1; \ + static = 1; + //Handcuffed Anims: class ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon: CutSceneAnimationBase { actions = "ACE_CivilStandHandcuffedActions"; @@ -45,6 +51,7 @@ class CfgMovesMaleSdr: CfgMovesBasic { ConnectTo[] = {"ACE_AmovPercMstpScapWnonDnon",0.1}; InterpolateTo[] = {"Unconscious",0.01,"ACE_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon",0.1}; canReload = 0; + MACRO_ANIMATION }; class ACE_AmovPercMstpScapWnonDnon: ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon { file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\non\non\AmovPercMstpSnonWnonDnon_Ease"; @@ -52,12 +59,14 @@ class CfgMovesMaleSdr: CfgMovesBasic { ConnectTo[] = {"ACE_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon",0.1}; InterpolateTo[] = {"Unconscious",0.01}; looped = 1; + MACRO_ANIMATION }; class ACE_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon: ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon { actions = "CivilStandActions"; file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\non\non\amovpercmstpsnonwnondnon_easeout"; ConnectTo[] = {"AmovPercMstpSnonWnonDnon",0.1}; InterpolateTo[] = {"Unconscious",0.01,"ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon",0.1}; + MACRO_ANIMATION }; //Handcuffed-FFV: @@ -65,6 +74,7 @@ class CfgMovesMaleSdr: CfgMovesBasic { file = "\A3\cargoposes_F_heli\anim\passenger_flatground_3idleunarmed.rtm"; actions = "ACE_CivilHandCuffedFFVActions"; ConnectTo[] = {}; + MACRO_ANIMATION }; @@ -78,6 +88,7 @@ class CfgMovesMaleSdr: CfgMovesBasic { ConnectTo[] = {"ACE_AmovPercMstpSsurWnonDnon",0.1}; InterpolateTo[] = {"Unconscious",0.01,"ACE_AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon",0.1}; canReload = 0; + MACRO_ANIMATION }; class ACE_AmovPercMstpSsurWnonDnon: ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon { file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\sur\non\AmovPercMstpSsurWnonDnon"; @@ -85,6 +96,7 @@ class CfgMovesMaleSdr: CfgMovesBasic { looped = 1; ConnectTo[] = {"ACE_AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon",0.1}; InterpolateTo[] = {"Unconscious",0.01}; + MACRO_ANIMATION }; class ACE_AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon: ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon { speed = 0.5; //for gameplay reasons, slow this down @@ -92,6 +104,7 @@ class CfgMovesMaleSdr: CfgMovesBasic { file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\sur\non\AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon"; ConnectTo[] = {"AmovPercMstpSnonWnonDnon",0.1}; InterpolateTo[] = {"Unconscious",0.01,"ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon",0.1}; + MACRO_ANIMATION }; }; }; From 237d5b6536f8e79f8f2cff2127196e8be10fd448 Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 1 Sep 2015 21:03:28 +0200 Subject: [PATCH 068/132] stand up action (uses get out shortcut) and less awkward standing animaton --- addons/sitting/functions/fnc_sit.sqf | 22 +++++++++++++++++++++- addons/sitting/functions/fnc_stand.sqf | 13 ++++++++++++- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/addons/sitting/functions/fnc_sit.sqf b/addons/sitting/functions/fnc_sit.sqf index 0c6825ed58..e0692af951 100644 --- a/addons/sitting/functions/fnc_sit.sqf +++ b/addons/sitting/functions/fnc_sit.sqf @@ -16,7 +16,7 @@ */ #include "script_component.hpp" -private ["_configFile", "_sitDirection", "_sitPosition", "_sitRotation", "_sitDirectionVisual"]; +private ["_actionID", "_configFile", "_sitDirection", "_sitPosition", "_sitRotation", "_sitDirectionVisual"]; params ["_seat", "_player"]; @@ -26,6 +26,26 @@ GVAR(seat) = _seat; // Overwrite weird position, because Arma decides to set it differently based on current animation/stance... _player switchMove "amovpknlmstpsraswrfldnon"; +// add scrollwheel action to release object +_actionID = _player getVariable [QGVAR(StandUpActionID), -1]; + +if (_actionID != -1) then { + _player removeAction _actionID; +}; + +_actionID = _player addAction [ + format ["%1", localize LSTRING(Stand)], + QUOTE((_this select 0) call FUNC(stand)), + nil, + 20, + false, + true, + "GetOut", + QUOTE(_this call FUNC(canStand)) +]; + +_player setVariable [QGVAR(StandUpActionID), _actionID]; + // Read config _configFile = configFile >> "CfgVehicles" >> typeOf _seat; _sitDirection = (getDir _seat) + getNumber (_configFile >> QGVAR(sitDirection)); diff --git a/addons/sitting/functions/fnc_stand.sqf b/addons/sitting/functions/fnc_stand.sqf index 978bcaf279..ef19d5f586 100644 --- a/addons/sitting/functions/fnc_stand.sqf +++ b/addons/sitting/functions/fnc_stand.sqf @@ -17,8 +17,19 @@ params ["_player"]; +// remove scroll wheel action +_player removeAction (_player getVariable [QGVAR(StandUpActionID), -1]); + // Restore animation -[_player, "", 2] call EFUNC(common,doAnimation); +private "_animation"; +_animation = switch (currentWeapon _player) do { + case "": {"amovpercmstpsnonwnondnon"}; + case (primaryWeapon _player): {"amovpercmstpslowwrfldnon"}; + case (handgunWeapon _player): {"amovpercmstpslowwpstdnon"}; + default {"amovpercmstpsnonwnondnon"}; +}; + +[_player, _animation, 2] call EFUNC(common,doAnimation); // Set variables to nil _player setVariable [QGVAR(isSitting), nil]; From 471d54f6748905e57303800305322808d59dd0ac Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 1 Sep 2015 21:48:40 +0200 Subject: [PATCH 069/132] better saling for tracer sizes, fix #1008 --- addons/ballistics/CfgAmmo.hpp | 68 ++++++++++++++++++++++++++++------- 1 file changed, 55 insertions(+), 13 deletions(-) diff --git a/addons/ballistics/CfgAmmo.hpp b/addons/ballistics/CfgAmmo.hpp index 5ffe94ac45..eeb64fec47 100644 --- a/addons/ballistics/CfgAmmo.hpp +++ b/addons/ballistics/CfgAmmo.hpp @@ -6,23 +6,11 @@ class CfgAmmo { timeToLive=6; }; - class B_20mm : BulletBase { - timeToLive=30; - }; - class B_25mm : BulletBase { - timeToLive=30; - }; - class B_35mm_AA : BulletBase { - timeToLive=30; - }; - class B_30mm_AP : BulletBase { - timeToLive=30; - }; - class B_556x45_Ball : BulletBase { airFriction=-0.00126466; hit=8; typicalSpeed=750; + tracerScale = 1; tracerStartTime=0.073; // M856 tracer burns out to 800m tracerEndTime=1.57123; // Time in seconds calculated with ballistics calculator ACE_caliber=5.69; @@ -128,9 +116,13 @@ class CfgAmmo { ACE_muzzleVelocities[]={785, 883, 925}; ACE_barrelLengths[]={254.0, 414.02, 508.0}; }; + class B_56x15_dual: BulletBase { + tracerScale = 0.5; + }; class B_65x39_Caseless : BulletBase { airFriction=-0.00075308; typicalSpeed=800; + tracerScale = 1.1; //1.0; ACE_caliber=6.706; ACE_bulletLength=32.893; ACE_bulletMass=7.9704; @@ -180,10 +172,15 @@ class CfgAmmo { ACE_muzzleVelocities[]={750, 820, 840, 852, 860}; ACE_barrelLengths[]={254.0, 406.4, 508.0, 609.6, 660.4}; }; + class SubmunitionBullet; + class B_65x39_Minigun_Caseless: SubmunitionBullet { + tracerScale = 1.1; //1.0; + }; class B_762x51_Ball : BulletBase { airFriction=-0.00100957; typicalSpeed=833; hit=9; + tracerScale = 1.2; //0.6; tracerStartTime=0.073; // Based on the British L5A1 which burns out to 1000m tracerEndTime=2.15957; // Time in seconds calculated with ballistics calculator ACE_caliber=7.823; @@ -479,6 +476,7 @@ class CfgAmmo { class B_9x21_Ball : BulletBase { airFriction=-0.00226847; typicalSpeed=390; + tracerScale = 0.5; hit=6; ACE_caliber=9.042; ACE_bulletLength=15.494; @@ -491,6 +489,9 @@ class CfgAmmo { ACE_muzzleVelocities[]={440, 460, 480}; ACE_barrelLengths[]={101.6, 127.0, 228.6}; }; + class B_9x21_Ball_Tracer_Green: B_9x21_Ball { + tracerScale = 0.5; + }; class ACE_9x18_Ball_57N181S : B_9x21_Ball { hit=5; airFriction=-0.00190333; @@ -584,6 +585,7 @@ class CfgAmmo { timeToLive=10; airFriction=-0.00038944; typicalSpeed=910; + tracerScale = 1.3; //1.2; ACE_caliber=10.363; ACE_bulletLength=54.0; ACE_bulletMass=26.568; @@ -670,9 +672,13 @@ class CfgAmmo { ACE_muzzleVelocities[]={880, 915, 925}; ACE_barrelLengths[]={508.0, 660.4, 711.2}; }; + class B_127x33_Ball: BulletBase { + tracerScale = 1.3; //1.2; + }; class B_127x54_Ball : BulletBase { airFriction=-0.00019268; typicalSpeed=300; + tracerScale = 1.3;// ACE_caliber=12.954; ACE_bulletLength=64.516; ACE_bulletMass=48.6; @@ -688,6 +694,7 @@ class CfgAmmo { timeToLive=10; airFriction=-0.00057503; typicalSpeed=900; + tracerScale = 1.3; //1.2; ACE_caliber=12.954; ACE_bulletLength=58.674; ACE_bulletMass=41.9256; @@ -703,6 +710,7 @@ class CfgAmmo { timeToLive=10; airFriction=-0.00057503; typicalSpeed=900; + tracerScale = 1.3;// hit=25; caliber=4.0; ACE_caliber=12.954; @@ -736,6 +744,7 @@ class CfgAmmo { timeToLive=10; airFriction=-0.00063800; typicalSpeed=820; + tracerScale = 1.3; //1.5; ACE_caliber=12.979; ACE_bulletLength=64.008; ACE_bulletMass=48.276; @@ -750,6 +759,7 @@ class CfgAmmo { class B_45ACP_Ball : BulletBase { airFriction=-0.00081221; typicalSpeed=250; + tracerScale = 0.6; ACE_caliber=11.481; ACE_bulletLength=17.272; ACE_bulletMass=14.904; @@ -761,4 +771,36 @@ class CfgAmmo { ACE_muzzleVelocities[]={230, 250, 285}; ACE_barrelLengths[]={101.6, 127.0, 228.6}; }; + class B_19mm_HE: BulletBase { + tracerScale = 1; + }; + class B_30mm_HE: B_19mm_HE { + tracerScale = 2.5; + }; + class B_20mm: BulletBase { + timeToLive=30; + tracerScale = 1.5; //1; + }; + class B_25mm: BulletBase { + timeToLive=30; + tracerScale = 2.0; //1; + }; + class B_30mm_AP: BulletBase { + timeToLive=30; + tracerScale = 2.5; + }; + class B_35mm_AA: BulletBase { + timeToLive=30; + tracerScale = 2.75; //1.85; + }; + class ShellBase; + class Sh_120mm_HE: ShellBase { + tracerScale = 3; + }; + class Sh_120mm_APFSDS: ShellBase { + tracerScale = 3; + }; + class Gatling_30mm_HE_Plane_CAS_01_F: BulletBase { + tracerScale = 2.5; + }; }; From be56fd7d466a85a04e35bdac2d4a3922944597d6 Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 1 Sep 2015 23:19:49 +0200 Subject: [PATCH 070/132] scripted approach to hand flares, fix #1079 --- addons/grenades/CfgAmmo.hpp | 66 +++++++++---------- addons/grenades/CfgMagazines.hpp | 19 ++++-- addons/grenades/Effects.hpp | 4 ++ addons/grenades/XEH_preInit.sqf | 1 + addons/grenades/functions/fnc_flare.sqf | 23 +++++++ .../grenades/functions/fnc_throwGrenade.sqf | 45 +++++++++---- 6 files changed, 105 insertions(+), 53 deletions(-) create mode 100644 addons/grenades/functions/fnc_flare.sqf diff --git a/addons/grenades/CfgAmmo.hpp b/addons/grenades/CfgAmmo.hpp index 120d3ab5ea..b14a806b4c 100644 --- a/addons/grenades/CfgAmmo.hpp +++ b/addons/grenades/CfgAmmo.hpp @@ -28,66 +28,66 @@ class CfgAmmo { }; class ACE_F_Hand_White: F_20mm_White { - grenadeBurningSound[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; - grenadeFireSound[] = {"SmokeShellSoundHit1",0.25,"SmokeShellSoundHit2",0.25,"SmokeShellSoundHit3",0.5}; - soundTrigger[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; - SmokeShellSoundHit1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_1",1.25893,1,100}; - SmokeShellSoundHit2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_2",1.25893,1,100}; - SmokeShellSoundHit3[] = {"A3\Sounds_F\weapons\smokeshell\smoke_3",1.25893,1,100}; - SmokeShellSoundLoop1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop1",0.125893,1,70}; - SmokeShellSoundLoop2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop2",0.125893,1,70}; timeToLive = 60; }; class F_20mm_Red; class ACE_F_Hand_Red: F_20mm_Red { - grenadeBurningSound[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; - grenadeFireSound[] = {"SmokeShellSoundHit1",0.25,"SmokeShellSoundHit2",0.25,"SmokeShellSoundHit3",0.5}; - soundTrigger[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; - SmokeShellSoundHit1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_1",1.25893,1,100}; - SmokeShellSoundHit2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_2",1.25893,1,100}; - SmokeShellSoundHit3[] = {"A3\Sounds_F\weapons\smokeshell\smoke_3",1.25893,1,100}; - SmokeShellSoundLoop1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop1",0.125893,1,70}; - SmokeShellSoundLoop2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop2",0.125893,1,70}; timeToLive = 60; }; class F_20mm_Green; class ACE_F_Hand_Green: F_20mm_Green { - grenadeBurningSound[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; - grenadeFireSound[] = {"SmokeShellSoundHit1",0.25,"SmokeShellSoundHit2",0.25,"SmokeShellSoundHit3",0.5}; - soundTrigger[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; - SmokeShellSoundHit1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_1",1.25893,1,100}; - SmokeShellSoundHit2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_2",1.25893,1,100}; - SmokeShellSoundHit3[] = {"A3\Sounds_F\weapons\smokeshell\smoke_3",1.25893,1,100}; - SmokeShellSoundLoop1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop1",0.125893,1,70}; - SmokeShellSoundLoop2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop2",0.125893,1,70}; timeToLive = 60; }; class F_20mm_Yellow; class ACE_F_Hand_Yellow: F_20mm_Yellow { - grenadeBurningSound[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; - grenadeFireSound[] = {"SmokeShellSoundHit1",0.25,"SmokeShellSoundHit2",0.25,"SmokeShellSoundHit3",0.5}; - soundTrigger[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; - SmokeShellSoundHit1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_1",1.25893,1,100}; - SmokeShellSoundHit2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_2",1.25893,1,100}; - SmokeShellSoundHit3[] = {"A3\Sounds_F\weapons\smokeshell\smoke_3",1.25893,1,100}; - SmokeShellSoundLoop1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop1",0.125893,1,70}; - SmokeShellSoundLoop2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop2",0.125893,1,70}; timeToLive = 60; }; class SmokeShell; + class ACE_G_Handflare_White: SmokeShell { + GVAR(flare) = 1; + GVAR(color)[] = {0.5,0.5,0.5,0.5}; + model = "\A3\weapons_f\ammo\flare_white"; + dangerRadiusHit = -1; + suppressionRadiusHit = -1; + typicalSpeed = 22; + cost = 100; + deflecting = 30; + explosionTime = 3; + timeToLive = 60; + grenadeFireSound[] = {}; + grenadeBurningSound[] = {}; + aiAmmoUsageFlags = "4 + 2"; + smokeColor[] = {0,0,0,0}; + effectsSmoke = "ACE_HandFlareEffect"; + whistleDist = 0; + }; + class ACE_G_Handflare_Red: ACE_G_Handflare_White { + GVAR(color)[] = {0.5,0.25,0.25,0.5}; + model = "\A3\weapons_f\ammo\flare_red"; + }; + class ACE_G_Handflare_Green: ACE_G_Handflare_White { + GVAR(color)[] = {0.25,0.5,0.25,0.5}; + model = "\A3\weapons_f\ammo\flare_green"; + }; + class ACE_G_Handflare_Yellow: ACE_G_Handflare_White { + GVAR(color)[] = {0.5,0.5,0.25,0.5}; + model = "\A3\weapons_f\ammo\flare_yellow"; + }; + class ACE_G_M84: SmokeShell { + GVAR(flashbang) = 1; model = PATHTOF(models\ACE_m84_thrown.p3d); dangerRadiusHit = -1; suppressionRadiusHit = 20; typicalSpeed = 22; cost = 40; deflecting = 15; + explosionTime = 2.3; timeToLive = 6; - fuseDistance = 2.3; grenadeFireSound[] = {}; grenadeBurningSound[] = {}; aiAmmoUsageFlags = "0"; diff --git a/addons/grenades/CfgMagazines.hpp b/addons/grenades/CfgMagazines.hpp index 31e80dc545..16dd9929ff 100644 --- a/addons/grenades/CfgMagazines.hpp +++ b/addons/grenades/CfgMagazines.hpp @@ -1,3 +1,4 @@ + class CfgMagazines { class HandGrenade; class ACE_HandFlare_Base: HandGrenade { @@ -8,55 +9,60 @@ class CfgMagazines { mass = 4; initSpeed = 22; }; + class ACE_HandFlare_White: ACE_HandFlare_Base { author = ECSTRING(common,ACETeam); scope = 2; - ammo = "ACE_F_Hand_White"; displayname = CSTRING(M127A1_White_Name); descriptionshort = CSTRING(M127A1_White_Description); displayNameShort = CSTRING(M127A1_White_NameShort); model = "\A3\weapons_f\ammo\flare_white"; picture = "\A3\Weapons_F\Data\UI\gear_flare_white_ca.paa"; + ammo = "ACE_G_Handflare_White"; }; + class ACE_HandFlare_Red: ACE_HandFlare_Base { author = ECSTRING(common,ACETeam); scope = 2; - ammo = "ACE_F_Hand_Red"; displayname = CSTRING(M127A1_Red_Name); descriptionshort = CSTRING(M127A1_Red_Description); displayNameShort = CSTRING(M127A1_Red_NameShort); model = "\A3\weapons_f\ammo\flare_red"; picture = "\A3\Weapons_F\Data\UI\gear_flare_red_ca.paa"; + ammo = "ACE_G_Handflare_Red"; }; + class ACE_HandFlare_Green: ACE_HandFlare_Base { author = ECSTRING(common,ACETeam); scope = 2; - ammo = "ACE_F_Hand_Green"; displayname = CSTRING(M127A1_Green_Name); descriptionshort = CSTRING(M127A1_Green_Description); displayNameShort = CSTRING(M127A1_Green_NameShort); model = "\A3\weapons_f\ammo\flare_green"; picture = "\A3\Weapons_F\Data\UI\gear_flare_green_ca.paa"; + ammo = "ACE_G_Handflare_Green"; }; + class ACE_HandFlare_Yellow: ACE_HandFlare_Base { author = ECSTRING(common,ACETeam); scope = 2; - ammo = "ACE_F_Hand_Yellow"; displayname = CSTRING(M127A1_Yellow_Name); descriptionshort = CSTRING(M127A1_Yellow_Description); displayNameShort = CSTRING(M127A1_Yellow_NameShort); model = "\A3\weapons_f\ammo\flare_yellow"; picture = "\A3\Weapons_F\Data\UI\gear_flare_yellow_ca.paa"; + ammo = "ACE_G_Handflare_Yellow"; }; + class ACE_M84: HandGrenade { author = ECSTRING(common,ACETeam); - ammo = "ACE_G_M84"; displayname = CSTRING(M84_Name); descriptionshort = CSTRING(M84_Description); displayNameShort = "M84"; - mass = 4; model = PATHTOF(models\ACE_m84.p3d); picture = PATHTOF(UI\ACE_m84_x_ca.paa); + ammo = "ACE_G_M84"; + mass = 4; }; class 3Rnd_UGL_FlareGreen_F; @@ -65,6 +71,7 @@ class CfgMagazines { ammo = "F_40mm_Green"; initSpeed = 120; }; + class 6Rnd_RedSignal_F: 6Rnd_GreenSignal_F { author = ECSTRING(common,ACETeam); ammo = "F_40mm_Red"; diff --git a/addons/grenades/Effects.hpp b/addons/grenades/Effects.hpp index c9e214de5c..3cbcef9a38 100644 --- a/addons/grenades/Effects.hpp +++ b/addons/grenades/Effects.hpp @@ -2,3 +2,7 @@ class ACE_M84FlashbangEffect { // empty }; + +class ACE_HandFlareEffect { + // empty +}; diff --git a/addons/grenades/XEH_preInit.sqf b/addons/grenades/XEH_preInit.sqf index 0df2e235fd..631cecca85 100644 --- a/addons/grenades/XEH_preInit.sqf +++ b/addons/grenades/XEH_preInit.sqf @@ -2,6 +2,7 @@ ADDON = false; +PREP(flare); PREP(flashbangExplosionEH); PREP(flashbangThrownFuze); PREP(nextMode); diff --git a/addons/grenades/functions/fnc_flare.sqf b/addons/grenades/functions/fnc_flare.sqf new file mode 100644 index 0000000000..d7a8b54f51 --- /dev/null +++ b/addons/grenades/functions/fnc_flare.sqf @@ -0,0 +1,23 @@ +// by commy2 +#include "script_component.hpp" + +params ["_projectile", "_color", "_intensity", "_timeToLive"]; + +private "_light"; +_light = "#lightpoint" createVehicleLocal position _projectile; + +_light setLightColor _color; +_light setLightAmbient _color; +_light setLightIntensity _intensity; +_light setLightBrightness 0.8; + +_light setLightUseFlare true; +_light setLightFlareSize 3.0; +_light setLightFlareMaxDistance 1000; + +_light setLightDayLight true; + +_light lightAttachObject [_projectile, [0,0,0]]; +//_light attachTo [_projectile, [0,0,0]]; + +[{deleteVehicle _this}, _light, _timeToLive, 1] call EFUNC(common,waitAndExecute); diff --git a/addons/grenades/functions/fnc_throwGrenade.sqf b/addons/grenades/functions/fnc_throwGrenade.sqf index 03e67a152a..5f8f31994a 100644 --- a/addons/grenades/functions/fnc_throwGrenade.sqf +++ b/addons/grenades/functions/fnc_throwGrenade.sqf @@ -21,22 +21,45 @@ */ #include "script_component.hpp" -private ["_mode", "_fuzeTime"]; -params ["_unit", "_weapon", "", "", "", "", "_projectile"]; +params ["_unit", "_weapon", "", "", "_ammo", "", "_projectile"]; -if (_unit != ACE_player) exitWith {}; if (_weapon != "Throw") exitWith {}; +// handle speial grenades +if (local _unit) then { + if (getNumber (configFile >> "CfgAmmo" >> _ammo >> QGVAR(flashbang)) == 1) then { + private "_fuzeTime"; + _fuzeTime = getNumber (configFile >> "CfgAmmo" >> _ammo >> "explosionTime"); + + [FUNC(flashbangThrownFuze), [_projectile], _fuzeTime, 0] call EFUNC(common,waitAndExecute); + }; + + if (getNumber (configFile >> "CfgAmmo" >> _ammo >> QGVAR(flare)) == 1) then { + private ["_fuzeTime", "_timeToLive", "_color", "_intensity"]; + + _fuzeTime = getNumber (configFile >> "CfgAmmo" >> _ammo >> "explosionTime"); + _timeToLive = getNumber (configFile >> "CfgAmmo" >> _ammo >> "timeToLive"); + _color = getArray (configFile >> "CfgAmmo" >> _ammo >> QGVAR(color)); + _intensity = _color select 3; + _color resize 3; + + [FUNC(flare), [_projectile, _color, _intensity, _timeToLive], _fuzeTime, 0] call EFUNC(common,waitAndExecute); + }; +}; + +// handle throw modes +if (_unit != ACE_player) exitWith {}; + +private "_mode"; _mode = missionNamespace getVariable [QGVAR(currentThrowMode), 0]; if (_mode != 0) then { private "_velocity"; - _velocity = velocity _projectile; switch (_mode) do { //high throw - case 1 : { + case 1 : { _velocity = [ 0.5 * (_velocity select 0), 0.5 * (_velocity select 1), @@ -44,24 +67,18 @@ if (_mode != 0) then { ]; }; //precise throw - case 2 : { + case 2 : { _velocity = (_unit weaponDirection _weapon) vectorMultiply (vectorMagnitude _velocity); }; //roll grande - case 3 : { + case 3 : { //@todo }; //drop grenade - case 4 : { + case 4 : { _velocity = [0, 0, 0]; }; }; _projectile setVelocity _velocity; }; - -if (typeOf _projectile == "ACE_G_M84") then { - _fuzeTime = getNumber (configFile >> "CfgAmmo" >> typeOf _projectile >> "fuseDistance"); - // _fuzeTime = getNumber (configFile >> "CfgAmmo" >> typeOf _projectile >> "explosionTime"); //@toDo pretty sure this should be explosionTime not fuseDistance - [FUNC(flashbangThrownFuze), [_projectile], _fuzeTime, 0] call EFUNC(common,waitAndExecute); -}; From 7ce606740ca83c259d0f1c7a5ef331316dd6c075 Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 1 Sep 2015 23:56:25 +0200 Subject: [PATCH 071/132] make flares work in mp --- .../grenades/functions/fnc_throwGrenade.sqf | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/addons/grenades/functions/fnc_throwGrenade.sqf b/addons/grenades/functions/fnc_throwGrenade.sqf index 5f8f31994a..17c0fb78cc 100644 --- a/addons/grenades/functions/fnc_throwGrenade.sqf +++ b/addons/grenades/functions/fnc_throwGrenade.sqf @@ -25,6 +25,11 @@ params ["_unit", "_weapon", "", "", "_ammo", "", "_projectile"]; if (_weapon != "Throw") exitWith {}; +// http://feedback.arma3.com/view.php?id=12340 +if (isNull _projectile) then { + _projectile = nearestObject [_unit, _ammo]; +}; + // handle speial grenades if (local _unit) then { if (getNumber (configFile >> "CfgAmmo" >> _ammo >> QGVAR(flashbang)) == 1) then { @@ -33,18 +38,18 @@ if (local _unit) then { [FUNC(flashbangThrownFuze), [_projectile], _fuzeTime, 0] call EFUNC(common,waitAndExecute); }; +}; - if (getNumber (configFile >> "CfgAmmo" >> _ammo >> QGVAR(flare)) == 1) then { - private ["_fuzeTime", "_timeToLive", "_color", "_intensity"]; +if (getNumber (configFile >> "CfgAmmo" >> _ammo >> QGVAR(flare)) == 1) then { + private ["_fuzeTime", "_timeToLive", "_color", "_intensity"]; - _fuzeTime = getNumber (configFile >> "CfgAmmo" >> _ammo >> "explosionTime"); - _timeToLive = getNumber (configFile >> "CfgAmmo" >> _ammo >> "timeToLive"); - _color = getArray (configFile >> "CfgAmmo" >> _ammo >> QGVAR(color)); - _intensity = _color select 3; - _color resize 3; + _fuzeTime = getNumber (configFile >> "CfgAmmo" >> _ammo >> "explosionTime"); + _timeToLive = getNumber (configFile >> "CfgAmmo" >> _ammo >> "timeToLive"); + _color = getArray (configFile >> "CfgAmmo" >> _ammo >> QGVAR(color)); + _intensity = _color select 3; + _color resize 3; - [FUNC(flare), [_projectile, _color, _intensity, _timeToLive], _fuzeTime, 0] call EFUNC(common,waitAndExecute); - }; + [FUNC(flare), [_projectile, _color, _intensity, _timeToLive], _fuzeTime, 0] call EFUNC(common,waitAndExecute); }; // handle throw modes From 83424cdcab91b999ea263f855211f30cf18d1b92 Mon Sep 17 00:00:00 2001 From: commy2 Date: Wed, 2 Sep 2015 00:03:16 +0200 Subject: [PATCH 072/132] header for fnc_flare --- addons/grenades/functions/fnc_flare.sqf | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/addons/grenades/functions/fnc_flare.sqf b/addons/grenades/functions/fnc_flare.sqf index d7a8b54f51..bf1d571640 100644 --- a/addons/grenades/functions/fnc_flare.sqf +++ b/addons/grenades/functions/fnc_flare.sqf @@ -1,4 +1,21 @@ -// by commy2 +/* + * Author: commy2 + * Makes flare shine. + * + * Arguments: + * 0: The flare + * 1: Color of flare + * 2: Intensity of flare + * 3: Flare lifetime + * + * Return Value: + * None + * + * Example: + * [_nade, [0.5,0.5,0.5], 0.5, 60] call ace_grenades_fnc_flare + * + * Public: No + */ #include "script_component.hpp" params ["_projectile", "_color", "_intensity", "_timeToLive"]; From 43c54d51e810d78d0eb1902dfcf243e9a0a2c873 Mon Sep 17 00:00:00 2001 From: commy2 Date: Wed, 2 Sep 2015 01:40:38 +0200 Subject: [PATCH 073/132] hide clock on map if no watch in inventory, #414 --- addons/map/functions/fnc_onDrawMap.sqf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/addons/map/functions/fnc_onDrawMap.sqf b/addons/map/functions/fnc_onDrawMap.sqf index bc147884e4..0c95e903e6 100644 --- a/addons/map/functions/fnc_onDrawMap.sqf +++ b/addons/map/functions/fnc_onDrawMap.sqf @@ -2,3 +2,8 @@ #include "script_component.hpp" ((_this select 0) displayCtrl 1016) ctrlShow GVAR(mapShowCursorCoordinates); + +// hide time when no map in inventory +if (!isNull ACE_player) then { + ((_this select 0) displayCtrl 101) ctrlShow ("ItemWatch" in assignedItems ACE_player); +}; From 29efc13556657ba74e00357c09ef789f7c3dd7f2 Mon Sep 17 00:00:00 2001 From: commy2 Date: Wed, 2 Sep 2015 01:59:07 +0200 Subject: [PATCH 074/132] hide clock, use eventhandler --- addons/map/XEH_postInitClient.sqf | 13 ++++++++++++- addons/map/functions/fnc_onDrawMap.sqf | 4 +--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/addons/map/XEH_postInitClient.sqf b/addons/map/XEH_postInitClient.sqf index ef528d5233..b85d91bf16 100644 --- a/addons/map/XEH_postInitClient.sqf +++ b/addons/map/XEH_postInitClient.sqf @@ -98,4 +98,15 @@ call FUNC(determineZoom); }] call EFUNC(common,addEventHandler); }; }; -}] call EFUNC(common,addEventHandler); \ No newline at end of file +}] call EFUNC(common,addEventHandler); + +// hide clock on map if player has no watch +GVAR(hasWatch) = true; + +["playerInventoryChanged", { + if (isNull (_this select 0)) exitWith { + GVAR(hasWatch) = true; + }; + + GVAR(hasWatch) = "ItemWatch" in (_this select 1 select 17); +}] call ace_common_fnc_addEventhandler diff --git a/addons/map/functions/fnc_onDrawMap.sqf b/addons/map/functions/fnc_onDrawMap.sqf index 0c95e903e6..cc0824919a 100644 --- a/addons/map/functions/fnc_onDrawMap.sqf +++ b/addons/map/functions/fnc_onDrawMap.sqf @@ -4,6 +4,4 @@ ((_this select 0) displayCtrl 1016) ctrlShow GVAR(mapShowCursorCoordinates); // hide time when no map in inventory -if (!isNull ACE_player) then { - ((_this select 0) displayCtrl 101) ctrlShow ("ItemWatch" in assignedItems ACE_player); -}; +((_this select 0) displayCtrl 101) ctrlShow GVAR(hasWatch); From 07ab7d1c35fc9d263a152c7b1816115c408b4dcf Mon Sep 17 00:00:00 2001 From: commy2 Date: Wed, 2 Sep 2015 02:00:53 +0200 Subject: [PATCH 075/132] correct comment --- addons/map/functions/fnc_onDrawMap.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/map/functions/fnc_onDrawMap.sqf b/addons/map/functions/fnc_onDrawMap.sqf index cc0824919a..37ec5a7000 100644 --- a/addons/map/functions/fnc_onDrawMap.sqf +++ b/addons/map/functions/fnc_onDrawMap.sqf @@ -3,5 +3,5 @@ ((_this select 0) displayCtrl 1016) ctrlShow GVAR(mapShowCursorCoordinates); -// hide time when no map in inventory +// hide clock when no watch in inventory, or whatever never ever ((_this select 0) displayCtrl 101) ctrlShow GVAR(hasWatch); From 7d2f1f52a4cc0de2e8eff4ba922e90ed6d456514 Mon Sep 17 00:00:00 2001 From: commy2 Date: Wed, 2 Sep 2015 20:13:51 +0200 Subject: [PATCH 076/132] remove protection, hitpoint config (fix ubc), some debug stuff --- addons/medical/CfgVehicles.hpp | 213 +++++------- addons/medical/XEH_respawn.sqf | 3 +- addons/medical/functions/fnc_handleDamage.sqf | 37 ++- addons/medical/functions/fnc_init.sqf | 120 +++---- addons/medical/script_component.hpp | 2 + addons/protection/$PBOPREFIX$ | 1 - addons/protection/CfgVehicles.hpp | 5 - addons/protection/CfgWeapons.hpp | 4 - addons/protection/FixHelmets.hpp | 230 ------------- addons/protection/FixUniforms.hpp | 0 addons/protection/FixVests.hpp | 303 ------------------ addons/protection/README.md | 12 - addons/protection/config.cpp | 16 - addons/protection/script_component.hpp | 12 - 14 files changed, 161 insertions(+), 797 deletions(-) delete mode 100644 addons/protection/$PBOPREFIX$ delete mode 100644 addons/protection/CfgVehicles.hpp delete mode 100644 addons/protection/CfgWeapons.hpp delete mode 100644 addons/protection/FixHelmets.hpp delete mode 100644 addons/protection/FixUniforms.hpp delete mode 100644 addons/protection/FixVests.hpp delete mode 100644 addons/protection/README.md delete mode 100644 addons/protection/config.cpp delete mode 100644 addons/protection/script_component.hpp diff --git a/addons/medical/CfgVehicles.hpp b/addons/medical/CfgVehicles.hpp index 0764d2f1ea..61168ca541 100644 --- a/addons/medical/CfgVehicles.hpp +++ b/addons/medical/CfgVehicles.hpp @@ -432,37 +432,33 @@ class CfgVehicles { class Land; class Man: Land { - class HitPoints { - class HitHead; - class HitBody; - class HitHands; - class HitLegs; - }; + class HitPoints; }; class CAManBase: Man { - class HitPoints: HitPoints { - class HitFace; - class HitNeck; - class HitHead; - class HitPelvis; - class HitAbdomen; - class HitDiaphragm; - class HitChest; - class HitBody; - class HitArms; - class HitHands; - class HitLegs; - class HitLeftArm: HitHands { + class HitPoints: HitPoints { // custom hitpoints. addons might want to adjust these accordingly + class HitLeftArm { armor = ARM_LEG_ARMOR_DEFAULT; + material = -1; name = "hand_l"; // @todo hopefully these still include the whole arm + hands + passThrough = 1; + radius = 0.08; + explosionShielding = 1; + visual = "injury_hands"; + minimalHit = 0.01; }; class HitRightArm: HitLeftArm { name = "hand_r"; // @todo hopefully these still include the whole arm + hands }; - class HitLeftLeg: HitLegs { + class HitLeftLeg { armor = ARM_LEG_ARMOR_DEFAULT; + material = -1; name = "leg_l"; + passThrough = 1; + radius = 0.1; + explosionShielding = 1; + visual = "injury_legs"; + minimalHit = 0.01; }; class HitRightLeg: HitLeftLeg { name = "leg_r"; @@ -527,60 +523,42 @@ class CfgVehicles { class B_Soldier_04_f: B_Soldier_base_F { class HitPoints: HitPoints { - class HitFace; - class HitNeck; class HitHead; - class HitPelvis; - class HitAbdomen; - class HitDiaphragm; - class HitChest; class HitBody; - class HitArms; class HitHands; class HitLegs; - class HitLeftArm: HitHands { + class HitLeftArm: HitLeftArm { armor = ARM_LEG_ARMOR_BETTER; - name = "hand_l"; // @todo hopefully these still include the whole arm + hands }; - class HitRightArm: HitLeftArm { - name = "hand_r"; // @todo hopefully these still include the whole arm + hands - }; - class HitLeftLeg: HitLegs { + class HitRightArm: HitRightArm { armor = ARM_LEG_ARMOR_BETTER; - name = "leg_l"; }; - class HitRightLeg: HitLeftLeg { - name = "leg_r"; + class HitLeftLeg: HitLeftLeg { + armor = ARM_LEG_ARMOR_BETTER; + }; + class HitRightLeg: HitRightLeg { + armor = ARM_LEG_ARMOR_BETTER; }; }; }; class B_Soldier_05_f: B_Soldier_base_F { class HitPoints: HitPoints { - class HitFace; - class HitNeck; class HitHead; - class HitPelvis; - class HitAbdomen; - class HitDiaphragm; - class HitChest; class HitBody; - class HitArms; class HitHands; class HitLegs; - class HitLeftArm: HitHands { + class HitLeftArm: HitLeftArm { armor = ARM_LEG_ARMOR_BETTER; - name = "hand_l"; }; - class HitRightArm: HitLeftArm { - name = "hand_r"; - }; - class HitLeftLeg: HitLegs { + class HitRightArm: HitRightArm { armor = ARM_LEG_ARMOR_BETTER; - name = "leg_l"; }; - class HitRightLeg: HitLeftLeg { - name = "leg_r"; + class HitLeftLeg: HitLeftLeg { + armor = ARM_LEG_ARMOR_BETTER; + }; + class HitRightLeg: HitRightLeg { + armor = ARM_LEG_ARMOR_BETTER; }; }; }; @@ -589,150 +567,105 @@ class CfgVehicles { class I_Soldier_03_F: I_Soldier_base_F { class HitPoints: HitPoints { - class HitFace; - class HitNeck; class HitHead; - class HitPelvis; - class HitAbdomen; - class HitDiaphragm; - class HitChest; class HitBody; - class HitArms; class HitHands; class HitLegs; - class HitLeftArm: HitHands { + class HitLeftArm: HitLeftArm { armor = ARM_LEG_ARMOR_BETTER; - name = "hand_l"; // @todo hopefully these still include the whole arm + hands }; - class HitRightArm: HitLeftArm { - name = "hand_r"; // @todo hopefully these still include the whole arm + hands - }; - class HitLeftLeg: HitLegs { + class HitRightArm: HitRightArm { armor = ARM_LEG_ARMOR_BETTER; - name = "leg_l"; }; - class HitRightLeg: HitLeftLeg { - name = "leg_r"; + class HitLeftLeg: HitLeftLeg { + armor = ARM_LEG_ARMOR_BETTER; + }; + class HitRightLeg: HitRightLeg { + armor = ARM_LEG_ARMOR_BETTER; }; }; }; class I_Soldier_04_F: I_Soldier_base_F { class HitPoints: HitPoints { - class HitFace; - class HitNeck; class HitHead; - class HitPelvis; - class HitAbdomen; - class HitDiaphragm; - class HitChest; class HitBody; - class HitArms; class HitHands; class HitLegs; - class HitLeftArm: HitHands { + class HitLeftArm: HitLeftArm { armor = ARM_LEG_ARMOR_BETTER; - name = "hand_l"; // @todo hopefully these still include the whole arm + hands }; - class HitRightArm: HitLeftArm { - name = "hand_r"; // @todo hopefully these still include the whole arm + hands - }; - class HitLeftLeg: HitLegs { + class HitRightArm: HitRightArm { armor = ARM_LEG_ARMOR_BETTER; - name = "leg_l"; }; - class HitRightLeg: HitLeftLeg { - name = "leg_r"; + class HitLeftLeg: HitLeftLeg { + armor = ARM_LEG_ARMOR_BETTER; + }; + class HitRightLeg: HitRightLeg { + armor = ARM_LEG_ARMOR_BETTER; }; }; }; class O_Soldier_base_F: SoldierEB { class HitPoints: HitPoints { - class HitFace; - class HitNeck; class HitHead; - class HitPelvis; - class HitAbdomen; - class HitDiaphragm; - class HitChest; class HitBody; - class HitArms; class HitHands; class HitLegs; - class HitLeftArm: HitHands { + class HitLeftArm: HitLeftArm { armor = ARM_LEG_ARMOR_CSAT; - name = "hand_l"; // @todo hopefully these still include the whole arm + hands }; - class HitRightArm: HitLeftArm { - name = "hand_r"; // @todo hopefully these still include the whole arm + hands - }; - class HitLeftLeg: HitLegs { + class HitRightArm: HitRightArm { armor = ARM_LEG_ARMOR_CSAT; - name = "leg_l"; }; - class HitRightLeg: HitLeftLeg { - name = "leg_r"; + class HitLeftLeg: HitLeftLeg { + armor = ARM_LEG_ARMOR_CSAT; + }; + class HitRightLeg: HitRightLeg { + armor = ARM_LEG_ARMOR_CSAT; }; }; }; class O_Soldier_02_F: O_Soldier_base_F { class HitPoints: HitPoints { - class HitFace; - class HitNeck; class HitHead; - class HitPelvis; - class HitAbdomen; - class HitDiaphragm; - class HitChest; class HitBody; - class HitArms; class HitHands; class HitLegs; - class HitLeftArm: HitHands { + class HitLeftArm: HitLeftArm { armor = ARM_LEG_ARMOR_CSAT; - name = "hand_l"; // @todo hopefully these still include the whole arm + hands }; - class HitRightArm: HitLeftArm { - name = "hand_r"; // @todo hopefully these still include the whole arm + hands - }; - class HitLeftLeg: HitLegs { + class HitRightArm: HitRightArm { armor = ARM_LEG_ARMOR_CSAT; - name = "leg_l"; }; - class HitRightLeg: HitLeftLeg { - name = "leg_r"; + class HitLeftLeg: HitLeftLeg { + armor = ARM_LEG_ARMOR_CSAT; + }; + class HitRightLeg: HitRightLeg { + armor = ARM_LEG_ARMOR_CSAT; }; }; }; class O_officer_F: O_Soldier_base_F { class HitPoints: HitPoints { - class HitFace; - class HitNeck; class HitHead; - class HitPelvis; - class HitAbdomen; - class HitDiaphragm; - class HitChest; class HitBody; - class HitArms; class HitHands; class HitLegs; - class HitLeftArm: HitHands { + class HitLeftArm: HitLeftArm { armor = ARM_LEG_ARMOR_CSAT; // @todo is that suppossed to be the case? - name = "hand_l"; // @todo hopefully these still include the whole arm + hands }; - class HitRightArm: HitLeftArm { - name = "hand_r"; // @todo hopefully these still include the whole arm + hands + class HitRightArm: HitRightArm { + armor = ARM_LEG_ARMOR_CSAT; }; - class HitLeftLeg: HitLegs { - armor = ARM_LEG_ARMOR_CSAT; // @todo is that suppossed to be the case? - name = "leg_l"; + class HitLeftLeg: HitLeftLeg { + armor = ARM_LEG_ARMOR_CSAT; }; - class HitRightLeg: HitLeftLeg { - name = "leg_r"; + class HitRightLeg: HitRightLeg { + armor = ARM_LEG_ARMOR_CSAT; }; }; }; @@ -743,19 +676,17 @@ class CfgVehicles { class HitBody; class HitHands; class HitLegs; - class HitLeftArm: HitHands { + class HitLeftArm: HitLeftArm { armor = 2; - name = "hand_l"; // @todo hopefully these still include the whole arm + hands }; - class HitRightArm: HitLeftArm { - name = "hand_r"; // @todo hopefully these still include the whole arm + hands - }; - class HitLeftLeg: HitLegs { + class HitRightArm: HitRightArm { armor = 2; - name = "leg_l"; }; - class HitRightLeg: HitLeftLeg { - name = "leg_r"; + class HitLeftLeg: HitLeftLeg { + armor = 2; + }; + class HitRightLeg: HitRightLeg { + armor = 2; }; }; }; diff --git a/addons/medical/XEH_respawn.sqf b/addons/medical/XEH_respawn.sqf index bd8a7a105b..b5b07bf141 100644 --- a/addons/medical/XEH_respawn.sqf +++ b/addons/medical/XEH_respawn.sqf @@ -2,8 +2,7 @@ params ["_unit"]; -if !(local _unit) exitWith {}; - +// reset all variables. @todo GROUP respawn? [_unit] call FUNC(init); // Reset captive status for respawning unit diff --git a/addons/medical/functions/fnc_handleDamage.sqf b/addons/medical/functions/fnc_handleDamage.sqf index 1f484ab056..df53996e94 100644 --- a/addons/medical/functions/fnc_handleDamage.sqf +++ b/addons/medical/functions/fnc_handleDamage.sqf @@ -1,5 +1,5 @@ /* - * Author: KoffeinFlummi, Glowbal + * Author: KoffeinFlummi, Glowbal, commy2 * Main HandleDamage EH function. * * Arguments: @@ -14,28 +14,39 @@ * * Public: No */ - #include "script_component.hpp" -private ["_damageReturn", "_typeOfDamage", "_minLethalDamage", "_newDamage", "_typeIndex", "_preventDeath"]; params ["_unit", "_selection", "_damage", "_shooter", "_projectile"]; -if !(local _unit) exitWith {nil}; - -if (typeName _projectile == "OBJECT") then { - _projectile = typeOf _projectile; - _this set [4, _projectile]; +// bug, apparently can fire for remote units in special cases +if !(local _unit) exitWith { + #ifdef DEBUG_ENABLED_MEDICAL + ACE_LOGDEBUG_3("HandleDamage on remote unit! - %1 - %2 - %3",diag_frameno,_unit,isServer); + #endif + nil }; -// If the damage is being weird, we just tell it to fuck off. -if !(_selection in (GVAR(SELECTIONS) + [""])) exitWith {0}; +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]; +};*/ + +#ifdef DEBUG_ENABLED_MEDICAL + ACE_LOGDEBUG_3("HandleDamage - %1 - %2 - %3",diag_frameno,_selection,_damage); +#endif + +// 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" // Exit if we disable damage temporarily if !(_unit getVariable [QGVAR(allowDamage), true]) exitWith { - if (_selection in GVAR(SELECTIONS)) then { - _unit getHit _selection - } else { + if (_selection == "") then { damage _unit + } else { + _unit getHit _selection }; }; diff --git a/addons/medical/functions/fnc_init.sqf b/addons/medical/functions/fnc_init.sqf index fe8715c352..7d3ebd21d5 100644 --- a/addons/medical/functions/fnc_init.sqf +++ b/addons/medical/functions/fnc_init.sqf @@ -1,5 +1,5 @@ /* - * Author: KoffeinFlummi + * Author: KoffeinFlummi, commy2 * Initializes unit variables. * * Arguments: @@ -10,73 +10,77 @@ * * Public: No */ - #include "script_component.hpp" -private ["_allUsedMedication", "_logs"]; params ["_unit"]; +// basic _unit setVariable [QGVAR(pain), 0, true]; _unit setVariable [QGVAR(morphine), 0, true]; _unit setVariable [QGVAR(bloodVolume), 100, true]; - -// tourniquets -_unit setvariable [QGVAR(tourniquets), [0,0,0,0,0,0], true]; - -// wounds and injuries -_unit setvariable [QGVAR(openWounds), [], true]; -_unit setvariable [QGVAR(bandagedWounds), [], true]; -_unit setVariable [QGVAR(internalWounds), [], true]; -_unit setvariable [QGVAR(lastUniqueWoundID), 1, true]; - -// vitals -_unit setVariable [QGVAR(heartRate), 80]; -_unit setvariable [QGVAR(heartRateAdjustments), []]; -_unit setvariable [QGVAR(bloodPressure), [80, 120]]; -_unit setVariable [QGVAR(peripheralResistance), 100]; - -// fractures -_unit setVariable [QGVAR(fractures), [], true]; - -// triage card and logs -_unit setvariable [QGVAR(triageLevel), 0, true]; -_unit setvariable [QGVAR(triageCard), [], true]; - -// IVs -_unit setVariable [QGVAR(salineIVVolume), 0, true]; -_unit setVariable [QGVAR(plasmaIVVolume), 0, true]; -_unit setVariable [QGVAR(bloodIVVolume), 0, true]; - -// damage storage -_unit setvariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0], true]; - -// airway -_unit setvariable [QGVAR(airwayStatus), 100]; -_unit setVariable [QGVAR(airwayOccluded), false]; -_unit setvariable [QGVAR(airwayCollapsed), false]; - -// generic medical admin -_unit setvariable [QGVAR(addedToUnitLoop), false, true]; -_unit setvariable [QGVAR(inCardiacArrest), false, true]; _unit setVariable ["ACE_isUnconscious", false, true]; -_unit setvariable [QGVAR(hasLostBlood), 0, true]; -_unit setvariable [QGVAR(isBleeding), false, true]; -_unit setvariable [QGVAR(hasPain), false, true]; -_unit setvariable [QGVAR(amountOfReviveLives), GVAR(amountOfReviveLives), true]; -_unit setvariable [QGVAR(painSuppress), 0, true]; -// medication -_allUsedMedication = _unit getVariable [QGVAR(allUsedMedication), []]; -{ - _unit setvariable [_x select 0, nil]; -} foreach _allUsedMedication; -_unit setVariable [QGVAR(allUsedMedication), [], true]; +// advanced +if (GVAR(level) > 1) then { + // tourniquets + _unit setvariable [QGVAR(tourniquets), [0,0,0,0,0,0], true]; -_logs = _unit getvariable [QGVAR(allLogs), []]; -{ - _unit setvariable [_x, nil]; -} foreach _logs; -_unit setvariable [QGVAR(allLogs), [], true]; + // wounds and injuries + _unit setvariable [QGVAR(openWounds), [], true]; + _unit setvariable [QGVAR(bandagedWounds), [], true]; + _unit setVariable [QGVAR(internalWounds), [], true]; + _unit setvariable [QGVAR(lastUniqueWoundID), 1, true]; + + // vitals + _unit setVariable [QGVAR(heartRate), 80]; + _unit setvariable [QGVAR(heartRateAdjustments), []]; + _unit setvariable [QGVAR(bloodPressure), [80, 120]]; + _unit setVariable [QGVAR(peripheralResistance), 100]; + + // fractures + _unit setVariable [QGVAR(fractures), [], true]; + + // triage card and logs + _unit setvariable [QGVAR(triageLevel), 0, true]; + _unit setvariable [QGVAR(triageCard), [], true]; + + // IVs + _unit setVariable [QGVAR(salineIVVolume), 0, true]; + _unit setVariable [QGVAR(plasmaIVVolume), 0, true]; + _unit setVariable [QGVAR(bloodIVVolume), 0, true]; + + // damage storage + _unit setvariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0], true]; + + // airway + _unit setvariable [QGVAR(airwayStatus), 100]; + _unit setVariable [QGVAR(airwayOccluded), false]; + _unit setvariable [QGVAR(airwayCollapsed), false]; + + // generic medical admin + _unit setvariable [QGVAR(addedToUnitLoop), false, true]; + _unit setvariable [QGVAR(inCardiacArrest), false, true]; + _unit setvariable [QGVAR(hasLostBlood), 0, true]; + _unit setvariable [QGVAR(isBleeding), false, true]; + _unit setvariable [QGVAR(hasPain), false, true]; + _unit setvariable [QGVAR(amountOfReviveLives), GVAR(amountOfReviveLives), true]; + _unit setvariable [QGVAR(painSuppress), 0, true]; + + private ["_allUsedMedication", "_logs"]; + + // medication + _allUsedMedication = _unit getVariable [QGVAR(allUsedMedication), []]; + { + _unit setvariable [_x select 0, nil]; + } foreach _allUsedMedication; + _unit setVariable [QGVAR(allUsedMedication), [], true]; + + _logs = _unit getvariable [QGVAR(allLogs), []]; + { + _unit setvariable [_x, nil]; + } foreach _logs; + _unit setvariable [QGVAR(allLogs), [], true]; +}; // items [{ diff --git a/addons/medical/script_component.hpp b/addons/medical/script_component.hpp index 939a811a41..910728c12b 100644 --- a/addons/medical/script_component.hpp +++ b/addons/medical/script_component.hpp @@ -1,6 +1,8 @@ #define COMPONENT medical #include "\z\ace\addons\main\script_mod.hpp" +#define DEBUG_ENABLED_MEDICAL true + #ifdef DEBUG_ENABLED_MEDICAL #define DEBUG_MODE_FULL #endif diff --git a/addons/protection/$PBOPREFIX$ b/addons/protection/$PBOPREFIX$ deleted file mode 100644 index 7ba9736ebe..0000000000 --- a/addons/protection/$PBOPREFIX$ +++ /dev/null @@ -1 +0,0 @@ -z\ace\addons\protection \ No newline at end of file diff --git a/addons/protection/CfgVehicles.hpp b/addons/protection/CfgVehicles.hpp deleted file mode 100644 index bce583e2ec..0000000000 --- a/addons/protection/CfgVehicles.hpp +++ /dev/null @@ -1,5 +0,0 @@ - -class CfgVehicles { - #include - #include -}; diff --git a/addons/protection/CfgWeapons.hpp b/addons/protection/CfgWeapons.hpp deleted file mode 100644 index 3f706fed41..0000000000 --- a/addons/protection/CfgWeapons.hpp +++ /dev/null @@ -1,4 +0,0 @@ - -class CfgWeapons { - #include -}; diff --git a/addons/protection/FixHelmets.hpp b/addons/protection/FixHelmets.hpp deleted file mode 100644 index eb2c515e50..0000000000 --- a/addons/protection/FixHelmets.hpp +++ /dev/null @@ -1,230 +0,0 @@ - -// INTEGER -#define HELMET_ARMOR_NO_PROTECTION 0 - -// FLOAT, 0-1 -#define HELMET_PASSTHROUGH_NO_PROTECTION 1 - -/*class InventoryItem_Base_F; -class HeadgearItem: InventoryItem_Base_F { - armor = 0; - passThrough = 1; -}; - -class H_HelmetB: ItemCore { - class ItemInfo: HeadgearItem { - //mass = 40; - armor = 4; - passThrough = 0.5; - }; -}; - -class H_HelmetB_camo: H_HelmetB { - class ItemInfo: HeadgearItem { - //mass = 40; - armor = 4; - passThrough = 0.5; - }; -}; - -class H_HelmetB_light: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 30; - armor = 3; - passThrough = 0.5; - }; -}; - -class H_Booniehat_khk: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 10; - armor = 0; - passThrough = 1; - }; -}; - -class H_HelmetB_plain_mcamo: H_HelmetB {}; - -class H_HelmetSpecB: H_HelmetB_plain_mcamo { - class ItemInfo: ItemInfo { - //mass = 50; - armor = 5; - passThrough = 0.5; - }; -}; - -class H_HelmetIA: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 40; - armor = 4; - passThrough = 0.5; - }; -}; - -class H_Cap_red: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 4; - armor = 0; - passThrough = 1; - }; -}; - -class H_Cap_headphones: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 8; - armor = 0; - passThrough = 1; - }; -}; - -class H_HelmetCrew_B: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 40; - armor = 4; - passThrough = 0.5; - }; -}; - -class H_PilotHelmetFighter_B: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 50; - armor = 5; - passThrough = 0.5; - }; -}; - -class H_PilotHelmetHeli_B: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 30; - armor = 3; - passThrough = 0.5; - }; -}; - -class H_CrewHelmetHeli_B: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 30; - armor = 3; - passThrough = 0.5; - }; -}; - -class H_HelmetO_ocamo: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 50; - armor = 5; - passThrough = 0.5; - }; -}; - -class H_HelmetLeaderO_ocamo: H_HelmetO_ocamo { - class ItemInfo: ItemInfo { - //mass = 60; - armor = 6; - passThrough = 0.5; - }; -}; - -class H_MilCap_ocamo: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 6; - armor = 0; - passThrough = 1; - }; -}; - -class H_BandMask_blk: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 8; - armor = 0; - passThrough = 1; - }; -}; - -class H_HelmetSpecO_ocamo: H_HelmetO_ocamo { - class ItemInfo: ItemInfo { - //mass = 40; - armor = 4; - passThrough = 0.5; - }; -}; - -class H_Bandanna_surfer: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 8; - armor = 0; - passThrough = 1; - }; -}; - -class H_Shemag_khk: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 6; - armor = 0; - passThrough = 1; - }; -}; - -class H_ShemagOpen_khk: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 6; - armor = 0; - passThrough = 1; - }; -}; - -class H_Beret_blk: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 6; - armor = 0; - passThrough = 1; - }; -}; - -class H_Beret_02: H_Beret_blk { - class ItemInfo: ItemInfo { - //mass = 6; - armor = 0; - passThrough = 1; - }; -}; - -class H_Watchcap_blk: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 6; - armor = 0; - passThrough = 1; - }; -}; - -class H_TurbanO_blk: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 8; - armor = 0; - passThrough = 1; - }; -}; - -class H_StrawHat: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 6; - armor = 0; - passThrough = 1; - }; -}; - -class H_Hat_blue: H_HelmetB { - class ItemInfo: ItemInfo { - //mass = 6; - armor = 0; - passThrough = 1; - }; -}; - -class H_RacingHelmet_1_F: H_HelmetB_camo { - class ItemInfo: ItemInfo { - //mass = 50; - armor = 5; - passThrough = 0.5; - }; -};*/ diff --git a/addons/protection/FixUniforms.hpp b/addons/protection/FixUniforms.hpp deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/addons/protection/FixVests.hpp b/addons/protection/FixVests.hpp deleted file mode 100644 index f3d1ad2b3d..0000000000 --- a/addons/protection/FixVests.hpp +++ /dev/null @@ -1,303 +0,0 @@ - -class ItemCore; -class VestItem; - -class Vest_Camo_Base: ItemCore { - class ItemInfo: VestItem { - /*containerClass = "Supply0"; - mass = 0; - armor = 0; - passThrough = 1;*/ - }; -}; -class Vest_NoCamo_Base: ItemCore { - class ItemInfo: VestItem { - /*containerClass = "Supply0"; - mass = 0; - armor = 0; - passThrough = 1;*/ - }; -}; - -// belts -class V_Rangemaster_belt: Vest_NoCamo_Base { - class ItemInfo: ItemInfo { - /*containerClass = "Supply40"; - mass = 10; - armor = 0; - passThrough = 1;*/ - }; -}; - -// bandolliers -class V_BandollierB_khk: Vest_Camo_Base { - class ItemInfo: ItemInfo { - /*containerClass = "Supply80"; - mass = 15; - armor = 0;*/ - passThrough = 0.85; //1; - }; -}; -/*class V_BandollierB_cbr: V_BandollierB_khk { - class ItemInfo: ItemInfo {}; -}; -class V_BandollierB_rgr: V_BandollierB_khk { - class ItemInfo: ItemInfo {}; -}; -class V_BandollierB_blk: V_BandollierB_khk { - class ItemInfo: ItemInfo {}; -}; -class V_BandollierB_oli: V_BandollierB_khk { - class ItemInfo: ItemInfo {}; -};*/ - -// plate carriers -class V_PlateCarrier1_rgr: Vest_NoCamo_Base { // lite - class ItemInfo: ItemInfo { - /*containerClass = "Supply140"; - mass = 80;*/ - armor = 8; //20; - passThrough = 0.75; //0.5; - }; -}; -class V_PlateCarrier2_rgr: V_PlateCarrier1_rgr { // heavy - class ItemInfo: ItemInfo { - /*containerClass = "Supply140"; - mass = 100;*/ - armor = 12; //30; - passThrough = 0.75; //0.5; - }; -}; -class V_PlateCarrier3_rgr: Vest_NoCamo_Base { // heavy (us) - class ItemInfo: ItemInfo { - /*containerClass = "Supply140"; - mass = 100;*/ - armor = 12; //30; - passThrough = 0.75; //0.5; - }; -}; -class V_PlateCarrierGL_rgr: Vest_NoCamo_Base { // lite (gl) - class ItemInfo: ItemInfo { - containerClass = "Supply160"; //"Supply140"; - /*mass = 100;*/ - armor = 8; //100; - passThrough = 0.75; //0.7; - }; -}; -class V_PlateCarrier1_blk: Vest_Camo_Base { // heavy (black) - class ItemInfo: ItemInfo { - /*containerClass = "Supply140";*/ - mass = 100; //80; - armor = 12; //20; - passThrough = 0.75; //0.5; - }; -}; -class V_PlateCarrierSpec_rgr: Vest_NoCamo_Base { // lite (special) - class ItemInfo: ItemInfo { - /*containerClass = "Supply100"; - mass = 120;*/ - armor = 16; //40; - passThrough = 0.75; //0.1; - }; -}; - -// chestrigs -/*class V_Chestrig_khk: Vest_Camo_Base { - class ItemInfo: ItemInfo { - containerClass = "Supply140"; - mass = 20; - armor = 0; - passThrough = 1; - }; -}; -class V_Chestrig_rgr: V_Chestrig_khk {}; -class V_Chestrig_blk: V_Chestrig_khk {}; -class V_Chestrig_oli: Vest_Camo_Base { - class ItemInfo: ItemInfo { - containerClass = "Supply140"; - mass = 20; - armor = 0; - passThrough = 1; - }; -};*/ - -// tactical vests -class V_TacVest_khk: Vest_Camo_Base { - class ItemInfo: ItemInfo { - /*containerClass = "Supply100"; - mass = 40;*/ - armor = 8; //20; - /*passThrough = 1;*/ - }; -}; -class V_TacVest_brn: V_TacVest_khk {}; -class V_TacVest_oli: V_TacVest_khk {}; -class V_TacVest_blk: V_TacVest_khk {}; -class V_TacVest_camo: Vest_Camo_Base { - class ItemInfo: ItemInfo { - /*containerClass = "Supply100"; - mass = 40;*/ - armor = 8; //20; - /*passThrough = 1;*/ - }; -}; -class V_TacVest_blk_POLICE: Vest_Camo_Base { - class ItemInfo: ItemInfo { - /*containerClass = "Supply100";*/ - mass = 40; //60; - armor = 8; //100; - passThrough = 1; //0.7; - }; -}; -class V_TacVestIR_blk: Vest_NoCamo_Base { // raven vest - class ItemInfo: VestItem { - /*containerClass = "Supply100"; - mass = 50;*/ - armor = 8; //20; - passThrough = 0.85; //0.5; - }; -}; -class V_TacVestCamo_khk: Vest_Camo_Base { - class ItemInfo: VestItem { - /*containerClass = "Supply100"; - mass = 40;*/ - armor = 8; //20; - /*passThrough = 1;*/ - }; -}; - -// harnesses -class V_HarnessO_brn: Vest_NoCamo_Base { - class ItemInfo: ItemInfo { - /*containerClass = "Supply160"; - mass = 30; - armor = 0;*/ - passThrough = 0.85; //0.5; - }; -}; -class V_HarnessOGL_brn: Vest_NoCamo_Base { // gl - class ItemInfo: ItemInfo { - /*containerClass = "Supply120"; - mass = 20; - armor = 0;*/ - passThrough = 0.85; //0.5; - }; -}; -class V_HarnessO_gry: V_HarnessO_brn { - class ItemInfo: ItemInfo { - /*containerClass = "Supply160"; - mass = 30; - armor = 0;*/ - passThrough = 0.85; //0.5; - }; -}; -class V_HarnessOGL_gry: V_HarnessO_gry { // gl - class ItemInfo: ItemInfo { - /*containerClass = "Supply120"; - mass = 20; - armor = 0;*/ - passThrough = 0.85; //0.5; - }; -}; -class V_HarnessOSpec_brn: V_HarnessO_brn { - class ItemInfo: VestItem { - /*containerClass = "Supply160"; - mass = 30; - armor = 0;*/ - passThrough = 0.85; //0.5; - }; -}; -class V_HarnessOSpec_gry: V_HarnessO_gry { - class ItemInfo: ItemInfo { - /*containerClass = "Supply160"; - mass = 30; - armor = 0;*/ - passThrough = 0.85; //0.5; - }; -}; - -// indep plate carriers -class V_PlateCarrierIA1_dgtl: Vest_NoCamo_Base { // lite - class ItemInfo: VestItem { - /*containerClass = "Supply120"; - mass = 60;*/ - armor = 8; //20; - passThrough = 0.75; //0.5; - }; -}; -class V_PlateCarrierIA2_dgtl: V_PlateCarrierIA1_dgtl { // heavy - class ItemInfo: VestItem { - /*containerClass = "Supply120"; - mass = 80;*/ - armor = 12; //30; - passThrough = 0.75; //0.5; - }; -}; -class V_PlateCarrierIAGL_dgtl: V_PlateCarrierIA2_dgtl { // heavy (gl) - class ItemInfo: VestItem { - containerClass = "Supply140"; //"Supply120"; - mass = 100; //80; - armor = 12; //100; - passThrough = 0.75; //0.7; - }; -}; - -// rebreather -/*class V_RebreatherB: Vest_Camo_Base { - class ItemInfo: ItemInfo { - containerClass = "Supply0"; - mass = 80; - armor = 20; - passThrough = 1; - }; -}; -class V_RebreatherIR: V_RebreatherB {}; -class V_RebreatherIA: V_RebreatherB {};*/ - -// more plate carriers -class V_PlateCarrier_Kerry: V_PlateCarrier1_rgr { // lighter - class ItemInfo: ItemInfo { - /*containerClass = "Supply140"; - mass = 80;*/ - armor = 8; //30; - passThrough = 0.75; //0.5; - }; -}; -class V_PlateCarrierL_CTRG: V_PlateCarrier1_rgr { // lite - class ItemInfo: ItemInfo { - /*containerClass = "Supply140"; - mass = 80;*/ - armor = 8; //20; - passThrough = 0.75; //0.5; - }; -}; -class V_PlateCarrierH_CTRG: V_PlateCarrier2_rgr { // heavy - class ItemInfo: ItemInfo { - /*containerClass = "Supply140"; - mass = 100;*/ - armor = 12; //30; - passThrough = 0.75; //0.5; - }; -}; - -// another tactical vest -class V_I_G_resistanceLeader_F: V_TacVest_camo { - class ItemInfo: ItemInfo {}; -}; - -// press vest -class V_Press_F: Vest_Camo_Base { - class ItemInfo: ItemInfo { - /*containerClass = "Supply40"; - mass = 20;*/ - armor = 8; //0; ? - /*passThrough = 1;*/ - }; -}; - -// marksman dlc -/*class V_PlateCarrierGL_blk: V_PlateCarrierGL_rgr {}; -class V_PlateCarrierGL_mtp: V_PlateCarrierGL_rgr {}; -class V_PlateCarrierSpec_blk: V_PlateCarrierSpec_rgr {}; -class V_PlateCarrierSpec_mtp: V_PlateCarrierSpec_rgr {}; -class V_PlateCarrierIAGL_oli: V_PlateCarrierIAGL_dgtl {};*/ diff --git a/addons/protection/README.md b/addons/protection/README.md deleted file mode 100644 index a6def1a1bc..0000000000 --- a/addons/protection/README.md +++ /dev/null @@ -1,12 +0,0 @@ -ace_protection -============== - -Fixes and tweaks the protection values of body armour. - - -## Maintainers - -The people responsible for merging changes to this component or answering potential questions. - -- [KoffeinFlummi](https://github.com/KoffeinFlummi) -- [commy2](https://github.com/commy2) diff --git a/addons/protection/config.cpp b/addons/protection/config.cpp deleted file mode 100644 index bb4ef3f739..0000000000 --- a/addons/protection/config.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include "script_component.hpp" - -class CfgPatches { - class ADDON { - units[] = {}; - weapons[] = {}; - requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ace_common"}; - author[] = {"commy2"}; - authorUrl = "https://github.com/commy2"; - VERSION_CONFIG; - }; -}; - -#include "CfgVehicles.hpp" -#include "CfgWeapons.hpp" diff --git a/addons/protection/script_component.hpp b/addons/protection/script_component.hpp deleted file mode 100644 index 1b2774a8ef..0000000000 --- a/addons/protection/script_component.hpp +++ /dev/null @@ -1,12 +0,0 @@ -#define COMPONENT protection -#include "\z\ace\addons\main\script_mod.hpp" - -#ifdef DEBUG_ENABLED_PROTECTION - #define DEBUG_MODE_FULL -#endif - -#ifdef DEBUG_ENABLED_PROTECTION - #define DEBUG_SETTINGS DEBUG_ENABLED_PROTECTION -#endif - -#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file From f939f9215e4388af4a63e88a0ff8fed53ceafdb5 Mon Sep 17 00:00:00 2001 From: commy2 Date: Wed, 2 Sep 2015 20:49:17 +0200 Subject: [PATCH 077/132] stop flickering of wounds, fix #346 --- addons/medical/functions/fnc_handleDamage.sqf | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/addons/medical/functions/fnc_handleDamage.sqf b/addons/medical/functions/fnc_handleDamage.sqf index df53996e94..9b612757b4 100644 --- a/addons/medical/functions/fnc_handleDamage.sqf +++ b/addons/medical/functions/fnc_handleDamage.sqf @@ -21,7 +21,7 @@ params ["_unit", "_selection", "_damage", "_shooter", "_projectile"]; // bug, apparently can fire for remote units in special cases if !(local _unit) exitWith { #ifdef DEBUG_ENABLED_MEDICAL - ACE_LOGDEBUG_3("HandleDamage on remote unit! - %1 - %2 - %3",diag_frameno,_unit,isServer); + ACE_LOGDEBUG_3("HandleDamage on remote unit! - %1 - %2 - %3", diag_frameno, _unit, isServer); #endif nil }; @@ -35,9 +35,13 @@ private ["_damageReturn", "_typeOfDamage", "_minLethalDamage", "_newDamage", "_ };*/ #ifdef DEBUG_ENABLED_MEDICAL - ACE_LOGDEBUG_3("HandleDamage - %1 - %2 - %3",diag_frameno,_selection,_damage); + ACE_LOGDEBUG_3("HandleDamage - %1 - %2 - %3", diag_frameno, _selection, _damage); #endif +// 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" @@ -48,8 +52,13 @@ if !(_unit getVariable [QGVAR(allowDamage), true]) exitWith { } else { _unit getHit _selection }; + #ifdef DEBUG_ENABLED_MEDICAL + ACE_LOGDEBUG_3("HandleDamage damage disabled. - %1 - %2 - %3", diag_frameno, _unit, _selection); + #endif }; +//if (true) exitWith {nil};// + // Get return damage _damageReturn = _damage; From f38d245771c198ed4285b88ddbf4aef096693af2 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Wed, 2 Sep 2015 21:56:00 +0200 Subject: [PATCH 078/132] fixed bloodloss for basic medical --- addons/medical/functions/fnc_getBloodLoss.sqf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/medical/functions/fnc_getBloodLoss.sqf b/addons/medical/functions/fnc_getBloodLoss.sqf index 9ac1083f03..a3fdbd5b94 100644 --- a/addons/medical/functions/fnc_getBloodLoss.sqf +++ b/addons/medical/functions/fnc_getBloodLoss.sqf @@ -43,6 +43,7 @@ if (GVAR(level) >= 2) then { // cap the blood loss to be no greater as the current cardiac output //(_totalBloodLoss min _cardiacOutput); } else { - _totalBloodLoss = BLOODLOSSRATE_BASIC * (damage _unit); + { _totalBloodLoss = _totalBloodLoss + _x } forEach (_unit getvariable [QGVAR(bodyPartStatus), []]); + _totalBloodLoss = (_totalBloodLoss / 6) * BLOODLOSSRATE_BASIC; }; _totalBloodLoss * ((_unit getVariable [QGVAR(bleedingCoefficient), GVAR(bleedingCoefficient)]) max 0); From 0bbf4d41287eff523ba8e09bd260d9d97873b155 Mon Sep 17 00:00:00 2001 From: jonpas Date: Wed, 2 Sep 2015 22:24:46 +0200 Subject: [PATCH 079/132] Prevent Cargo opening if vehicle is locked --- addons/cargo/functions/fnc_initVehicle.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/cargo/functions/fnc_initVehicle.sqf b/addons/cargo/functions/fnc_initVehicle.sqf index b817688336..efb3b9a5cf 100644 --- a/addons/cargo/functions/fnc_initVehicle.sqf +++ b/addons/cargo/functions/fnc_initVehicle.sqf @@ -41,7 +41,7 @@ if (getNumber (configFile >> "CfgVehicles" >> _type >> QGVAR(hasCargo)) != 1) ex private ["_text", "_condition", "_statement", "_icon", "_action"]; _condition = { params ["_target", "_player"]; - GVAR(enable) && {[_player, _target, []] call EFUNC(common,canInteractWith)} + GVAR(enable) && {locked _target < 2} && {[_player, _target, []] call EFUNC(common,canInteractWith)} }; _text = localize LSTRING(openMenu); _statement = {GVAR(interactionVehicle) = _target; createDialog QGVAR(menu);}; From def2d295012fbc08dbf360f1897428406acaffbc Mon Sep 17 00:00:00 2001 From: jonpas Date: Wed, 2 Sep 2015 22:51:31 +0200 Subject: [PATCH 080/132] Cleaned up slideshow privates --- addons/slideshow/functions/fnc_addSlideActions.sqf | 1 - addons/slideshow/functions/fnc_autoTransition.sqf | 1 - addons/slideshow/functions/fnc_createSlideshow.sqf | 3 +-- addons/slideshow/functions/fnc_makeList.sqf | 3 +-- addons/slideshow/functions/fnc_moduleInit.sqf | 1 - 5 files changed, 2 insertions(+), 7 deletions(-) diff --git a/addons/slideshow/functions/fnc_addSlideActions.sqf b/addons/slideshow/functions/fnc_addSlideActions.sqf index 1ebba306b4..a18249a4f8 100644 --- a/addons/slideshow/functions/fnc_addSlideActions.sqf +++ b/addons/slideshow/functions/fnc_addSlideActions.sqf @@ -20,7 +20,6 @@ #include "script_component.hpp" private "_actions"; - params ["_objects", "_images", "_names", "_controller", "_currentSlideshow"]; _actions = []; diff --git a/addons/slideshow/functions/fnc_autoTransition.sqf b/addons/slideshow/functions/fnc_autoTransition.sqf index c8b03a707a..4c31c4ff6a 100644 --- a/addons/slideshow/functions/fnc_autoTransition.sqf +++ b/addons/slideshow/functions/fnc_autoTransition.sqf @@ -19,7 +19,6 @@ #include "script_component.hpp" private "_currentSlide"; - params ["_objects", "_images", "_varString", "_duration"]; // Get current slide number of this slideshow diff --git a/addons/slideshow/functions/fnc_createSlideshow.sqf b/addons/slideshow/functions/fnc_createSlideshow.sqf index 665b954496..369593dd16 100644 --- a/addons/slideshow/functions/fnc_createSlideshow.sqf +++ b/addons/slideshow/functions/fnc_createSlideshow.sqf @@ -19,8 +19,7 @@ */ #include "script_component.hpp" -private ["_currentSlideshow", "_actionsObject", "_actionsClass", "_mainAction", "_slidesAction", "_varString"]; - +private ["_currentSlideshow", "_slidesAction", "_varString"]; params ["_objects", "_controllers", "_images", "_names", "_duration"]; // Verify data diff --git a/addons/slideshow/functions/fnc_makeList.sqf b/addons/slideshow/functions/fnc_makeList.sqf index 6736fabbdb..e550e462a7 100644 --- a/addons/slideshow/functions/fnc_makeList.sqf +++ b/addons/slideshow/functions/fnc_makeList.sqf @@ -17,9 +17,8 @@ */ #include "script_component.hpp" -params ["_list", "_trimWhitespace", "_checkNil"]; - private ["_splittedList", "_listTrimmedWhitespace", "_nilCheckPassedList"]; +params ["_list", "_trimWhitespace", "_checkNil"]; // Split using comma delimiter _splittedList = [_list, ","] call BIS_fnc_splitString; diff --git a/addons/slideshow/functions/fnc_moduleInit.sqf b/addons/slideshow/functions/fnc_moduleInit.sqf index da1724dfcc..a0b5386f97 100644 --- a/addons/slideshow/functions/fnc_moduleInit.sqf +++ b/addons/slideshow/functions/fnc_moduleInit.sqf @@ -18,7 +18,6 @@ if (!hasInterface && !isDedicated) exitWith {}; private ["_objects", "_controllers", "_images", "_names", "_duration"]; - params [["_logic", objNull, [objNull]], "_units", "_activated"]; if !(_activated) exitWith {}; From fbf00b9aa5e1065ee26c0f99bc7558382d7a7701 Mon Sep 17 00:00:00 2001 From: commy2 Date: Thu, 3 Sep 2015 02:55:40 +0200 Subject: [PATCH 081/132] correct comment --- addons/grenades/functions/fnc_throwGrenade.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/grenades/functions/fnc_throwGrenade.sqf b/addons/grenades/functions/fnc_throwGrenade.sqf index 17c0fb78cc..9439aef4bd 100644 --- a/addons/grenades/functions/fnc_throwGrenade.sqf +++ b/addons/grenades/functions/fnc_throwGrenade.sqf @@ -30,7 +30,7 @@ if (isNull _projectile) then { _projectile = nearestObject [_unit, _ammo]; }; -// handle speial grenades +// handle special grenades if (local _unit) then { if (getNumber (configFile >> "CfgAmmo" >> _ammo >> QGVAR(flashbang)) == 1) then { private "_fuzeTime"; From cbccd898ea312b5fe2f748097b648fdb21d86349 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Wed, 2 Sep 2015 23:58:24 -0500 Subject: [PATCH 082/132] Run functions after setting init --- addons/common/XEH_postInit.sqf | 10 +++++++++- addons/common/XEH_preInit.sqf | 3 +++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index ba014ff182..9fbe84362a 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -150,6 +150,14 @@ call FUNC(checkFiles); //Event that settings are safe to use: ["SettingsInitialized", []] call FUNC(localEvent); + //Set init finished and run all delayed functions: + GVAR(settingsInitFinished) = true; + diag_log text format ["%1 delayed functions", (count GVAR(runAtSettingsInitialized))]; + { + _x params ["_args", "_code"]; + _args call _code; + } forEach GVAR(runAtSettingsInitialized); + }, 0, [false]] call CBA_fnc_addPerFrameHandler; @@ -326,7 +334,7 @@ GVAR(OldIsCamera) = false; if (didJip) then { // We are jipping! Get ready and wait, and throw the event [{ - if(!(isNull player)) then { + if((!(isNull player)) && GVAR(settingsInitFinished)) then { ["PlayerJip", [player] ] call FUNC(localEvent); [(_this select 1)] call cba_fnc_removePerFrameHandler; }; diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index 6fdf99113c..12fdc5629d 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -303,6 +303,9 @@ GVAR(nextFrameNo) = diag_frameno; GVAR(nextFrameBufferA) = []; GVAR(nextFrameBufferB) = []; +GVAR(settingsInitFinished) = false; +GVAR(runAtSettingsInitialized) = []; + // @TODO: Generic local-managed global-synced objects (createVehicleLocal) //Debug From 789de9d111e7ca1deb5b548364cc879bc9776524 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Thu, 3 Sep 2015 00:11:49 -0500 Subject: [PATCH 083/132] runAfterSettingsInit helper func --- addons/common/XEH_postInit.sqf | 6 ++--- addons/common/XEH_preInit.sqf | 1 + .../functions/fnc_runAfterSettingsInit.sqf | 27 +++++++++++++++++++ 3 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 addons/common/functions/fnc_runAfterSettingsInit.sqf diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 9fbe84362a..24a9e4ab6e 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -152,10 +152,10 @@ call FUNC(checkFiles); //Set init finished and run all delayed functions: GVAR(settingsInitFinished) = true; - diag_log text format ["%1 delayed functions", (count GVAR(runAtSettingsInitialized))]; + diag_log text format ["[ACE] %1 delayed functions running", (count GVAR(runAtSettingsInitialized))]; { - _x params ["_args", "_code"]; - _args call _code; + _x params ["_func", "_params"]; + _params call _func; } forEach GVAR(runAtSettingsInitialized); }, 0, [false]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index 12fdc5629d..56e3062cd2 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -157,6 +157,7 @@ PREP(requestCallback); PREP(resetAllDefaults); PREP(restoreVariablesJIP); PREP(revertKeyCodeLocalized); +PREP(runAfterSettingsInit); PREP(sanitizeString); PREP(sendRequest); PREP(serverLog); diff --git a/addons/common/functions/fnc_runAfterSettingsInit.sqf b/addons/common/functions/fnc_runAfterSettingsInit.sqf new file mode 100644 index 0000000000..cf3faa1d7e --- /dev/null +++ b/addons/common/functions/fnc_runAfterSettingsInit.sqf @@ -0,0 +1,27 @@ +/* + * Author: PabstMirror + * Executes code after setting are initilized. + * + * Argument: + * 0: Code to execute + * 1: Parameters to run the code with + * + * Return value: + * None + * + * Example: + * [{if (GVAR(setting) then {x} else {y};}, []] call ace_common_fnc_runAfterSettingsInit + * + * Public: No + */ +#include "script_component.hpp" + +params ["_func", "_params"]; + +if (GVAR(settingsInitFinished)) then { + //Setting Already Finished, Direct Run the code + _params call _func; +} else { + //Waiting on settings, throw it on the delayed run array + GVAR(runAtSettingsInitialized) pushBack [_func, _params]; +}; From 024dc3effef60e91532ea832f7b35c16a17a9fe3 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Thu, 3 Sep 2015 00:16:48 -0500 Subject: [PATCH 084/132] Cleanup --- addons/common/XEH_postInit.sqf | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 24a9e4ab6e..4a194e0fe9 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -157,6 +157,7 @@ call FUNC(checkFiles); _x params ["_func", "_params"]; _params call _func; } forEach GVAR(runAtSettingsInitialized); + GVAR(runAtSettingsInitialized) = nil; //cleanup }, 0, [false]] call CBA_fnc_addPerFrameHandler; From a187be725540efdfbd03fd2fb7d76b5791442976 Mon Sep 17 00:00:00 2001 From: commy2 Date: Thu, 3 Sep 2015 13:23:15 +0200 Subject: [PATCH 085/132] sort flashbang under explosive grenades --- addons/grenades/CfgAmmo.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/grenades/CfgAmmo.hpp b/addons/grenades/CfgAmmo.hpp index 120d3ab5ea..7a3dd0476a 100644 --- a/addons/grenades/CfgAmmo.hpp +++ b/addons/grenades/CfgAmmo.hpp @@ -85,6 +85,7 @@ class CfgAmmo { suppressionRadiusHit = 20; typicalSpeed = 22; cost = 40; + explosive = 1E-7; deflecting = 15; timeToLive = 6; fuseDistance = 2.3; From 76bb2bd2b8e2942847bfcffcee08964d03c7b213 Mon Sep 17 00:00:00 2001 From: commy2 Date: Thu, 3 Sep 2015 13:37:36 +0200 Subject: [PATCH 086/132] replace function with FUNC macro --- addons/map/XEH_postInitClient.sqf | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/map/XEH_postInitClient.sqf b/addons/map/XEH_postInitClient.sqf index b85d91bf16..f832c89c7b 100644 --- a/addons/map/XEH_postInitClient.sqf +++ b/addons/map/XEH_postInitClient.sqf @@ -107,6 +107,5 @@ GVAR(hasWatch) = true; if (isNull (_this select 0)) exitWith { GVAR(hasWatch) = true; }; - GVAR(hasWatch) = "ItemWatch" in (_this select 1 select 17); -}] call ace_common_fnc_addEventhandler +}] call EFUNC(common,addEventHandler) From 6b7f84b297d9f6af0f1629b74ca5cc2c873efa50 Mon Sep 17 00:00:00 2001 From: commy2 Date: Thu, 3 Sep 2015 13:39:17 +0200 Subject: [PATCH 087/132] add missing ; --- addons/map/XEH_postInitClient.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/map/XEH_postInitClient.sqf b/addons/map/XEH_postInitClient.sqf index f832c89c7b..02800c2540 100644 --- a/addons/map/XEH_postInitClient.sqf +++ b/addons/map/XEH_postInitClient.sqf @@ -108,4 +108,4 @@ GVAR(hasWatch) = true; GVAR(hasWatch) = true; }; GVAR(hasWatch) = "ItemWatch" in (_this select 1 select 17); -}] call EFUNC(common,addEventHandler) +}] call EFUNC(common,addEventHandler); From a84be46ed4c34e8010b33972672d7c1ca6b41296 Mon Sep 17 00:00:00 2001 From: commy2 Date: Thu, 3 Sep 2015 15:49:49 +0200 Subject: [PATCH 088/132] fix errors from cleanup --- addons/medical/functions/fnc_canAccessMedicalEquipment.sqf | 2 +- addons/medical/functions/fnc_onMedicationUsage.sqf | 3 ++- addons/medical/functions/fnc_treatmentAdvanced_fullHeal.sqf | 2 +- addons/medical/functions/fnc_treatmentTourniquetLocal.sqf | 4 ++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/addons/medical/functions/fnc_canAccessMedicalEquipment.sqf b/addons/medical/functions/fnc_canAccessMedicalEquipment.sqf index 0be01ac492..2aecfb9a12 100644 --- a/addons/medical/functions/fnc_canAccessMedicalEquipment.sqf +++ b/addons/medical/functions/fnc_canAccessMedicalEquipment.sqf @@ -15,7 +15,7 @@ #include "script_component.hpp" private ["_accessLevel", "_return"]; -params ["_caller", "_targ"]; +params ["_caller", "_target"]; _accessLevel = _target getvariable [QGVAR(allowSharedEquipmentAccess), -1]; diff --git a/addons/medical/functions/fnc_onMedicationUsage.sqf b/addons/medical/functions/fnc_onMedicationUsage.sqf index d71896b6f0..db4ba737ea 100644 --- a/addons/medical/functions/fnc_onMedicationUsage.sqf +++ b/addons/medical/functions/fnc_onMedicationUsage.sqf @@ -78,7 +78,8 @@ _viscosityAdjustment = _viscosityChange / _timeInSystem; [{ params ["_args", "_idPFH"]; - _args params ["_target", "_timeInSystem", "_variable", "_amountDecreased","_decreaseAmount", "_usedMeds", "_viscosityAdjustment", "_painReduce"]; + _args params ["_target", "_timeInSystem", "_variable", "_amountDecreased","_decreaseAmount", "_viscosityAdjustment", "_painReduce"]; + private "_usedMeds"; _usedMeds = _target getvariable [_variable, 0]; _usedMeds = _usedMeds - _decreaseAmount; _target setvariable [_variable, _usedMeds]; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_fullHeal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_fullHeal.sqf index 64ce319341..a26876568d 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_fullHeal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_fullHeal.sqf @@ -10,7 +10,7 @@ #include "script_component.hpp" -params ["_target", "_caller", "_selectionName", "_className", "_items"]; +params ["_caller", "_target", "_selectionName", "_className", "_items"]; // TODO replace by event system [[_caller, _target], QUOTE(DFUNC(treatmentAdvanced_fullHealLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ diff --git a/addons/medical/functions/fnc_treatmentTourniquetLocal.sqf b/addons/medical/functions/fnc_treatmentTourniquetLocal.sqf index fb7394866e..d1ffd34e4b 100644 --- a/addons/medical/functions/fnc_treatmentTourniquetLocal.sqf +++ b/addons/medical/functions/fnc_treatmentTourniquetLocal.sqf @@ -13,8 +13,8 @@ */ #include "script_component.hpp" -private ["_tourniquetItem", "_part", "_applyingTo"]; -params ["_target", "_tourniquets", "_selectionName"]; +private ["_tourniquets", "_part", "_applyingTo"]; +params ["_target", "_tourniquetItem", "_selectionName"]; [_target] call FUNC(addToInjuredCollection); From e753131f2d4c0a48792448ab2b281a99447828ac Mon Sep 17 00:00:00 2001 From: commy2 Date: Thu, 3 Sep 2015 16:17:48 +0200 Subject: [PATCH 089/132] arms and legs to vulnerable, better scaling for pilots and csat --- addons/medical/CfgVehicles.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/medical/CfgVehicles.hpp b/addons/medical/CfgVehicles.hpp index 61168ca541..74f9d1a4e2 100644 --- a/addons/medical/CfgVehicles.hpp +++ b/addons/medical/CfgVehicles.hpp @@ -426,9 +426,9 @@ class CfgVehicles { }; }; - #define ARM_LEG_ARMOR_DEFAULT 1 - #define ARM_LEG_ARMOR_BETTER 8 - #define ARM_LEG_ARMOR_CSAT 6 + #define ARM_LEG_ARMOR_DEFAULT 2 + #define ARM_LEG_ARMOR_BETTER 4 + #define ARM_LEG_ARMOR_CSAT 3 class Land; class Man: Land { From 0bd92af072321d68fa512d82a7a6a1e559d75eb3 Mon Sep 17 00:00:00 2001 From: commy2 Date: Thu, 3 Sep 2015 17:17:54 +0200 Subject: [PATCH 090/132] fix variables not inited, csat armor scaleing --- addons/medical/CfgVehicles.hpp | 2 +- addons/medical/functions/fnc_init.sqf | 96 +++++++++++++-------------- 2 files changed, 48 insertions(+), 50 deletions(-) diff --git a/addons/medical/CfgVehicles.hpp b/addons/medical/CfgVehicles.hpp index 74f9d1a4e2..7112c82fc5 100644 --- a/addons/medical/CfgVehicles.hpp +++ b/addons/medical/CfgVehicles.hpp @@ -428,7 +428,7 @@ class CfgVehicles { #define ARM_LEG_ARMOR_DEFAULT 2 #define ARM_LEG_ARMOR_BETTER 4 - #define ARM_LEG_ARMOR_CSAT 3 + #define ARM_LEG_ARMOR_CSAT 4 class Land; class Man: Land { diff --git a/addons/medical/functions/fnc_init.sqf b/addons/medical/functions/fnc_init.sqf index 7d3ebd21d5..bd97203f33 100644 --- a/addons/medical/functions/fnc_init.sqf +++ b/addons/medical/functions/fnc_init.sqf @@ -21,66 +21,64 @@ _unit setVariable [QGVAR(bloodVolume), 100, true]; _unit setVariable ["ACE_isUnconscious", false, true]; // advanced -if (GVAR(level) > 1) then { - // tourniquets - _unit setvariable [QGVAR(tourniquets), [0,0,0,0,0,0], true]; +// tourniquets +_unit setvariable [QGVAR(tourniquets), [0,0,0,0,0,0], true]; - // wounds and injuries - _unit setvariable [QGVAR(openWounds), [], true]; - _unit setvariable [QGVAR(bandagedWounds), [], true]; - _unit setVariable [QGVAR(internalWounds), [], true]; - _unit setvariable [QGVAR(lastUniqueWoundID), 1, true]; +// wounds and injuries +_unit setvariable [QGVAR(openWounds), [], true]; +_unit setvariable [QGVAR(bandagedWounds), [], true]; +_unit setVariable [QGVAR(internalWounds), [], true]; +_unit setvariable [QGVAR(lastUniqueWoundID), 1, true]; - // vitals - _unit setVariable [QGVAR(heartRate), 80]; - _unit setvariable [QGVAR(heartRateAdjustments), []]; - _unit setvariable [QGVAR(bloodPressure), [80, 120]]; - _unit setVariable [QGVAR(peripheralResistance), 100]; +// vitals +_unit setVariable [QGVAR(heartRate), 80]; +_unit setvariable [QGVAR(heartRateAdjustments), []]; +_unit setvariable [QGVAR(bloodPressure), [80, 120]]; +_unit setVariable [QGVAR(peripheralResistance), 100]; - // fractures - _unit setVariable [QGVAR(fractures), [], true]; +// fractures +_unit setVariable [QGVAR(fractures), [], true]; - // triage card and logs - _unit setvariable [QGVAR(triageLevel), 0, true]; - _unit setvariable [QGVAR(triageCard), [], true]; +// triage card and logs +_unit setvariable [QGVAR(triageLevel), 0, true]; +_unit setvariable [QGVAR(triageCard), [], true]; - // IVs - _unit setVariable [QGVAR(salineIVVolume), 0, true]; - _unit setVariable [QGVAR(plasmaIVVolume), 0, true]; - _unit setVariable [QGVAR(bloodIVVolume), 0, true]; +// IVs +_unit setVariable [QGVAR(salineIVVolume), 0, true]; +_unit setVariable [QGVAR(plasmaIVVolume), 0, true]; +_unit setVariable [QGVAR(bloodIVVolume), 0, true]; - // damage storage - _unit setvariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0], true]; +// damage storage +_unit setvariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0], true]; - // airway - _unit setvariable [QGVAR(airwayStatus), 100]; - _unit setVariable [QGVAR(airwayOccluded), false]; - _unit setvariable [QGVAR(airwayCollapsed), false]; +// airway +_unit setvariable [QGVAR(airwayStatus), 100]; +_unit setVariable [QGVAR(airwayOccluded), false]; +_unit setvariable [QGVAR(airwayCollapsed), false]; - // generic medical admin - _unit setvariable [QGVAR(addedToUnitLoop), false, true]; - _unit setvariable [QGVAR(inCardiacArrest), false, true]; - _unit setvariable [QGVAR(hasLostBlood), 0, true]; - _unit setvariable [QGVAR(isBleeding), false, true]; - _unit setvariable [QGVAR(hasPain), false, true]; - _unit setvariable [QGVAR(amountOfReviveLives), GVAR(amountOfReviveLives), true]; - _unit setvariable [QGVAR(painSuppress), 0, true]; +// generic medical admin +_unit setvariable [QGVAR(addedToUnitLoop), false, true]; +_unit setvariable [QGVAR(inCardiacArrest), false, true]; +_unit setvariable [QGVAR(hasLostBlood), 0, true]; +_unit setvariable [QGVAR(isBleeding), false, true]; +_unit setvariable [QGVAR(hasPain), false, true]; +_unit setvariable [QGVAR(amountOfReviveLives), GVAR(amountOfReviveLives), true]; +_unit setvariable [QGVAR(painSuppress), 0, true]; - private ["_allUsedMedication", "_logs"]; +private ["_allUsedMedication", "_logs"]; - // medication - _allUsedMedication = _unit getVariable [QGVAR(allUsedMedication), []]; - { - _unit setvariable [_x select 0, nil]; - } foreach _allUsedMedication; - _unit setVariable [QGVAR(allUsedMedication), [], true]; +// medication +_allUsedMedication = _unit getVariable [QGVAR(allUsedMedication), []]; +{ + _unit setvariable [_x select 0, nil]; +} foreach _allUsedMedication; +_unit setVariable [QGVAR(allUsedMedication), [], true]; - _logs = _unit getvariable [QGVAR(allLogs), []]; - { - _unit setvariable [_x, nil]; - } foreach _logs; - _unit setvariable [QGVAR(allLogs), [], true]; -}; +_logs = _unit getvariable [QGVAR(allLogs), []]; +{ + _unit setvariable [_x, nil]; +} foreach _logs; +_unit setvariable [QGVAR(allLogs), [], true]; // items [{ From 6d28214287c290875255d7ee56dda116d2aeccb1 Mon Sep 17 00:00:00 2001 From: ViperMaul Date: Thu, 3 Sep 2015 08:18:37 -0700 Subject: [PATCH 091/132] Add some debug values. --- addons/medical/functions/fnc_handleUnitVitals.sqf | 13 +++++++++++-- addons/medical/script_component.hpp | 1 + 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/addons/medical/functions/fnc_handleUnitVitals.sqf b/addons/medical/functions/fnc_handleUnitVitals.sqf index db312eea34..ca5775cbe8 100644 --- a/addons/medical/functions/fnc_handleUnitVitals.sqf +++ b/addons/medical/functions/fnc_handleUnitVitals.sqf @@ -15,7 +15,7 @@ private ["_heartRate","_bloodPressure","_bloodVolume","_painStatus", "_lastTimeValuesSynced", "_syncValues", "_airwayStatus", "_blood"]; params ["_unit", "_interval"]; - +TRACE_3("ACE_DEBUG",_unit,_interval,_unit); if (_interval == 0) exitWith {}; _lastTimeValuesSynced = _unit getvariable [QGVAR(lastMomentValuesSynced), 0]; @@ -29,23 +29,28 @@ _bloodVolume = _bloodVolume max 0; _unit setvariable [QGVAR(bloodVolume), _bloodVolume, _syncValues]; +TRACE_3("ACE_DEBUG",_bloodVolume,_syncValues,_unit); // Set variables for synchronizing information across the net if (_bloodVolume < 100) then { if ((_bloodVolume < 90 && (GVAR(level) == 2)) || _bloodVolume <= 45) then { + TRACE_4("ACE_DEBUG_ADVANCED",_bloodVolume,_unit getVariable QGVAR(hasLostBlood),_syncValues,_unit); if (_unit getvariable [QGVAR(hasLostBlood), 0] != 2) then { _unit setvariable [QGVAR(hasLostBlood), 2, true]; }; } else { + TRACE_4("ACE_DEBUG", _bloodVolume,_unit getVariable QGVAR(hasLostBlood),_syncValues,_unit); if (_unit getvariable [QGVAR(hasLostBlood), 0] != 1) then { _unit setvariable [QGVAR(hasLostBlood), 1, true]; }; } } else { + TRACE_4("ACE_DEBUG",_bloodVolume,QGVAR(hasLostBlood),_syncValues,_unit); if (_unit getvariable [QGVAR(hasLostBlood), 0] != 0) then { _unit setvariable [QGVAR(hasLostBlood), 0, true]; }; }; +TRACE_3("ACE_DEBUG",[_unit] call FUNC(getBloodLoss),_unit getVariable QGVAR(isBleeding),_unit); if (([_unit] call FUNC(getBloodLoss)) > 0) then { if !(_unit getvariable [QGVAR(isBleeding), false]) then { _unit setvariable [QGVAR(isBleeding), true, true]; @@ -57,6 +62,7 @@ if (([_unit] call FUNC(getBloodLoss)) > 0) then { }; _painStatus = _unit getvariable [QGVAR(pain), 0]; +TRACE_4("ACE_DEBUG",_painStatus,[_unit] call FUNC(hasPain),_unit getVariable QGVAR(painSuppress),_unit); if (_painStatus > (_unit getvariable [QGVAR(painSuppress), 0])) then { if !(_unit getvariable [QGVAR(hasPain), false]) then { _unit setvariable [QGVAR(hasPain), true, true]; @@ -68,6 +74,7 @@ if (_painStatus > (_unit getvariable [QGVAR(painSuppress), 0])) then { }; if (GVAR(level) == 1) then { + TRACE_5("ACE_DEBUG_BASIC",_painStatus,[_unit] call FUNC(hasPain),_unit getVariable QGVAR(morphine),_syncValues,_unit); // reduce pain if (_painStatus > 0) then { _unit setVariable [QGVAR(pain), (_painStatus - 0.001 * _interval) max 0, _syncValues]; @@ -90,6 +97,7 @@ if (GVAR(level) == 1) then { // handle advanced medical, with vitals if (GVAR(level) >= 2) then { + TRACE_6("ACE_DEBUG_ADVANCED_VITALS",_painStatus,_bloodVolume, [_unit] call FUNC(hasPain),_unit getVariable QGVAR(morphine),_syncValues,_unit); if (_bloodVolume < 30) exitwith { [_unit] call FUNC(setDead); }; @@ -113,7 +121,7 @@ if (GVAR(level) >= 2) then { _painReduce = if (_painStatus > 5) then {0.002} else {0.001}; _unit setVariable [QGVAR(pain), (_painStatus - _painReduce * _interval) max 0, _syncValues]; }; - + TRACE_8("ACE_DEBUG_ADVANCED_VITALS",_painStatus,_painReduce,_heartRate,_bloodVolume,_bloodPressure,_interval,_syncValues,_unit); // TODO Disabled until implemented fully // Handle airway /*if (GVAR(setting_allowAirwayInjuries)) then { @@ -172,6 +180,7 @@ if (GVAR(level) >= 2) then { // syncing any remaining values if (_syncValues) then { + TRACE_3("ACE_DEBUG_IVBAGS_SYNC",GVAR(IVBags),_syncValues,_unit); { private "_value"; _value = _unit getvariable _x; diff --git a/addons/medical/script_component.hpp b/addons/medical/script_component.hpp index 910728c12b..54aea5beb9 100644 --- a/addons/medical/script_component.hpp +++ b/addons/medical/script_component.hpp @@ -2,6 +2,7 @@ #include "\z\ace\addons\main\script_mod.hpp" #define DEBUG_ENABLED_MEDICAL true +#define DEBUG_SETTINGS_MEDICAL true #ifdef DEBUG_ENABLED_MEDICAL #define DEBUG_MODE_FULL From 9e1ae58f4f8351a8fd6f945dd7ff749adc7c4ba0 Mon Sep 17 00:00:00 2001 From: bux578 Date: Thu, 3 Sep 2015 18:17:53 +0200 Subject: [PATCH 092/132] fix restore gear --- addons/respawn/functions/fnc_restoreGear.sqf | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/addons/respawn/functions/fnc_restoreGear.sqf b/addons/respawn/functions/fnc_restoreGear.sqf index 7e55c1d8e2..fd3f03d7aa 100644 --- a/addons/respawn/functions/fnc_restoreGear.sqf +++ b/addons/respawn/functions/fnc_restoreGear.sqf @@ -182,15 +182,18 @@ _activeWeapon = _activeWeaponAndMuzzle select 0; _activeMuzzle = _activeWeaponAndMuzzle select 1; _activeWeaponMode = _activeWeaponAndMuzzle select 2; -if (_activeMuzzle != "" and _activeMuzzle != _activeWeapon) then { +if (!(_activeMuzzle isEqualTo "") and + !(_activeMuzzle isEqualTo _activeWeapon) and + (_activeMuzzle in getArray (configfile >> "CfgWeapons" >> _activeWeapon >> "muzzles"))) then { + _unit selectWeapon _activeMuzzle; } else { - if (_activeWeapon != "") then { + if (!(_activeWeapon isEqualTo "")) then { _unit selectWeapon _activeWeapon; }; }; -if (currentWeapon _unit != "") then { +if (!(currentWeapon _unit isEqualTo "")) then { private ["_index"]; _index = 0; while { From b737f42777467a8fc8e1f5eadfd1de3924d6938a Mon Sep 17 00:00:00 2001 From: commy2 Date: Thu, 3 Sep 2015 18:30:29 +0200 Subject: [PATCH 093/132] fix error when opening triage card --- addons/medical/functions/fnc_displayTriageCard.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical/functions/fnc_displayTriageCard.sqf b/addons/medical/functions/fnc_displayTriageCard.sqf index 051efbfc70..9849242de1 100644 --- a/addons/medical/functions/fnc_displayTriageCard.sqf +++ b/addons/medical/functions/fnc_displayTriageCard.sqf @@ -66,7 +66,7 @@ if (_show) then { _triageStatus = [_target] call FUNC(getTriageStatus); - _triageStatus params ["_text", "_color"]; + _triageStatus params ["_text", "", "_color"]; (_display displayCtrl 2000) ctrlSetText _text; (_display displayCtrl 2000) ctrlSetBackgroundColor _color; From 89b0c05929ff0387ae74e3b92dcbef421c095297 Mon Sep 17 00:00:00 2001 From: ViperMaul Date: Thu, 3 Sep 2015 13:17:59 -0700 Subject: [PATCH 094/132] Fixed a debug statement. --- addons/medical/functions/fnc_handleUnitVitals.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical/functions/fnc_handleUnitVitals.sqf b/addons/medical/functions/fnc_handleUnitVitals.sqf index ca5775cbe8..43a2b1903b 100644 --- a/addons/medical/functions/fnc_handleUnitVitals.sqf +++ b/addons/medical/functions/fnc_handleUnitVitals.sqf @@ -44,7 +44,7 @@ if (_bloodVolume < 100) then { }; } } else { - TRACE_4("ACE_DEBUG",_bloodVolume,QGVAR(hasLostBlood),_syncValues,_unit); + TRACE_4("ACE_DEBUG",_bloodVolume,_unit getVariable QGVAR(hasLostBlood),_syncValues,_unit); if (_unit getvariable [QGVAR(hasLostBlood), 0] != 0) then { _unit setvariable [QGVAR(hasLostBlood), 0, true]; }; From 813e54a66825edcbd637603fb939a9836ee5e4ba Mon Sep 17 00:00:00 2001 From: ViperMaul Date: Fri, 4 Sep 2015 07:37:20 -0700 Subject: [PATCH 095/132] Fixing Debug for object variable hasPain --- addons/medical/functions/fnc_handleUnitVitals.sqf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/medical/functions/fnc_handleUnitVitals.sqf b/addons/medical/functions/fnc_handleUnitVitals.sqf index 43a2b1903b..5227bf20d1 100644 --- a/addons/medical/functions/fnc_handleUnitVitals.sqf +++ b/addons/medical/functions/fnc_handleUnitVitals.sqf @@ -62,7 +62,7 @@ if (([_unit] call FUNC(getBloodLoss)) > 0) then { }; _painStatus = _unit getvariable [QGVAR(pain), 0]; -TRACE_4("ACE_DEBUG",_painStatus,[_unit] call FUNC(hasPain),_unit getVariable QGVAR(painSuppress),_unit); +TRACE_4("ACE_DEBUG",_painStatus,_unit getVariable QGVAR(hasPain),_unit getVariable QGVAR(painSuppress),_unit); if (_painStatus > (_unit getvariable [QGVAR(painSuppress), 0])) then { if !(_unit getvariable [QGVAR(hasPain), false]) then { _unit setvariable [QGVAR(hasPain), true, true]; @@ -74,7 +74,7 @@ if (_painStatus > (_unit getvariable [QGVAR(painSuppress), 0])) then { }; if (GVAR(level) == 1) then { - TRACE_5("ACE_DEBUG_BASIC",_painStatus,[_unit] call FUNC(hasPain),_unit getVariable QGVAR(morphine),_syncValues,_unit); + TRACE_5("ACE_DEBUG_BASIC",_painStatus,_unit getVariable QGVAR(hasPain),_unit getVariable QGVAR(morphine),_syncValues,_unit); // reduce pain if (_painStatus > 0) then { _unit setVariable [QGVAR(pain), (_painStatus - 0.001 * _interval) max 0, _syncValues]; @@ -97,7 +97,7 @@ if (GVAR(level) == 1) then { // handle advanced medical, with vitals if (GVAR(level) >= 2) then { - TRACE_6("ACE_DEBUG_ADVANCED_VITALS",_painStatus,_bloodVolume, [_unit] call FUNC(hasPain),_unit getVariable QGVAR(morphine),_syncValues,_unit); + TRACE_6("ACE_DEBUG_ADVANCED_VITALS",_painStatus,_bloodVolume, _unit getVariable QGVAR(hasPain),_unit getVariable QGVAR(morphine),_syncValues,_unit); if (_bloodVolume < 30) exitwith { [_unit] call FUNC(setDead); }; From 2bc20501bc5ada7fca85c2979bef3f21682719e1 Mon Sep 17 00:00:00 2001 From: ViperMaul Date: Fri, 4 Sep 2015 07:46:35 -0700 Subject: [PATCH 096/132] Adding more debug --- addons/medical/XEH_postInit.sqf | 3 +++ addons/medical/functions/fnc_handleDamage.sqf | 13 ++++--------- addons/medical/functions/fnc_handleDamage_basic.sqf | 4 ++++ addons/medical/functions/fnc_unconsciousPFH.sqf | 7 +++++++ 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/addons/medical/XEH_postInit.sqf b/addons/medical/XEH_postInit.sqf index d55a66d2b1..e6e2ca5ceb 100644 --- a/addons/medical/XEH_postInit.sqf +++ b/addons/medical/XEH_postInit.sqf @@ -259,6 +259,7 @@ if (USE_WOUND_EVENT_SYNC) then { ["SettingsInitialized", { if (GVAR(level) == 2) exitwith { + TRACE_6("ACE_DEBUG: SettingsInitialized_EH_ADVANCED",(_this select 0), GVAR(level),(_this select 0) getvariable QGVAR(bloodVolume),(_this select 0) getvariable QGVAR(pain), (_this select 0) getvariable QGVAR(painSuppress), [_this select 0] call FUNC(getBloodLoss)); [ {(((_this select 0) getvariable [QGVAR(bloodVolume), 100]) < 65)}, {(((_this select 0) getvariable [QGVAR(pain), 0]) - ((_this select 0) getvariable [QGVAR(painSuppress), 0])) > 0.9}, @@ -270,6 +271,8 @@ if (USE_WOUND_EVENT_SYNC) then { ] call FUNC(addUnconsciousCondition); }; + TRACE_6("ACE_DEBUG: SettingsInitialized_EH_BASIC",(_this select 0), GVAR(level),(_this select 0) getvariable QGVAR(bloodVolume),(_this select 0) getvariable QGVAR(pain), (_this select 0) getvariable QGVAR(painSuppress), [_this select 0] call FUNC(getBloodLoss)); + [ {(((_this select 0) getvariable [QGVAR(bloodVolume), 100]) < 40)}, {(((_this select 0) getvariable [QGVAR(pain), 0]) - ((_this select 0) getvariable [QGVAR(painSuppress), 0])) > 0.6}, diff --git a/addons/medical/functions/fnc_handleDamage.sqf b/addons/medical/functions/fnc_handleDamage.sqf index 9b612757b4..7226926700 100644 --- a/addons/medical/functions/fnc_handleDamage.sqf +++ b/addons/medical/functions/fnc_handleDamage.sqf @@ -17,12 +17,11 @@ #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 { - #ifdef DEBUG_ENABLED_MEDICAL - ACE_LOGDEBUG_3("HandleDamage on remote unit! - %1 - %2 - %3", diag_frameno, _unit, isServer); - #endif + TRACE_2("ACE_DEBUG: HandleDamage on remote unit!",_unit, isServer); nil }; @@ -34,9 +33,7 @@ private ["_damageReturn", "_typeOfDamage", "_minLethalDamage", "_newDamage", "_ _this set [4, _projectile]; };*/ -#ifdef DEBUG_ENABLED_MEDICAL - ACE_LOGDEBUG_3("HandleDamage - %1 - %2 - %3", diag_frameno, _selection, _damage); -#endif +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"}; @@ -52,9 +49,7 @@ if !(_unit getVariable [QGVAR(allowDamage), true]) exitWith { } else { _unit getHit _selection }; - #ifdef DEBUG_ENABLED_MEDICAL - ACE_LOGDEBUG_3("HandleDamage damage disabled. - %1 - %2 - %3", diag_frameno, _unit, _selection); - #endif + TRACE_3("ACE_DEBUG: HandleDamage damage disabled.",_selection,damage _unit, _unit); }; //if (true) exitWith {nil};// diff --git a/addons/medical/functions/fnc_handleDamage_basic.sqf b/addons/medical/functions/fnc_handleDamage_basic.sqf index cf53ac100f..a37ccea2b3 100644 --- a/addons/medical/functions/fnc_handleDamage_basic.sqf +++ b/addons/medical/functions/fnc_handleDamage_basic.sqf @@ -14,11 +14,14 @@ private ["_damageBodyParts", "_cache_params", "_cache_damages"]; params ["_target"]; +TRACE_1("ACE_DEBUG: HandleDamage_BASIC Called",_target); _damageBodyParts = _target getvariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]]; _cache_params = _target getVariable [QGVAR(cachedHandleDamageParams), []]; _cache_damages = _target getVariable QGVAR(cachedDamages); +TRACE_4("ACE_DEBUG: HandleDamage BASIC",_unit, _damageBodyParts,_cache_params,_cache_damages); + { _x params ["_unit","_selectionName","_amountOfDamage","_sourceOfDamage","_typeOfProjectile","_typeOfDamage"]; if !(isNull _sourceOfDamage && {_typeOfProjectile == ""} && {vehicle _unit == _unit} && {(_selectionName == "head" || isBurning _unit)}) then { @@ -44,6 +47,7 @@ _cache_damages = _target getVariable QGVAR(cachedDamages); // We broadcast the value across the net here, in order to avoid broadcasting it multiple times earlier in the above code block _target setvariable [QGVAR(bodyPartStatus), _damageBodyParts, true]; +TRACE_2("ACE_DEBUG: HandleDamage BASIC Broadcast value here",_unit, _target getvariable QGVAR(bodyPartStatus)); EXPLODE_6_PVT(_damageBodyParts,_headDamage,_torsoDamage,_handsDamageR,_handsDamageL,_legsDamageR,_legsDamageL); _target setHitPointDamage ["hitHead", _headDamage min 0.95]; diff --git a/addons/medical/functions/fnc_unconsciousPFH.sqf b/addons/medical/functions/fnc_unconsciousPFH.sqf index f230b9dbf8..0e8c424ca3 100644 --- a/addons/medical/functions/fnc_unconsciousPFH.sqf +++ b/addons/medical/functions/fnc_unconsciousPFH.sqf @@ -23,6 +23,8 @@ private ["_unit", "_minWaitingTime", "_slotInfo", "_hasMovedOut", "_parachuteChe params ["_args", "_idPFH"]; _args params ["_unit", "_originalPos", "_startingTime", "_minWaitingTime", "_hasMovedOut", "_parachuteCheck"]; +TRACE_6("ACE_DEBUG_Unconscious_PFH",_unit, _originalPos, _startingTime, _minWaitingTime, _hasMovedOut, _parachuteCheck); + if (!alive _unit) exitwith { if ("ACE_FakePrimaryWeapon" in (weapons _unit)) then { TRACE_1("Removing fake weapon [on death]",_unit); @@ -39,11 +41,14 @@ if (!alive _unit) exitwith { [_unit, "isUnconscious"] call EFUNC(common,unmuteUnit); ["medical_onUnconscious", [_unit, false]] call EFUNC(common,globalEvent); + TRACE_3("ACE_DEBUG_Unconscious_Exit",_unit, (!alive _unit) , QGVAR(unconscious)); + [_idPFH] call CBA_fnc_removePerFrameHandler; }; // In case the unit is no longer in an unconscious state, we are going to check if we can already reset the animation if !(_unit getvariable ["ACE_isUnconscious",false]) exitwith { + TRACE_7("ACE_DEBUG_Unconscious_PFH",_unit, _args, [_unit] call FUNC(isBeingCarried), [_unit] call FUNC(isBeingDragged), _idPFH, _unit getvariable QGVAR(unconsciousArguments),animationState _unit); // TODO, handle this with carry instead, so we can remove the PFH here. // Wait until the unit isn't being carried anymore, so we won't end up with wierd animations if !(([_unit] call FUNC(isBeingCarried)) || ([_unit] call FUNC(isBeingDragged))) then { @@ -124,6 +129,7 @@ if (_parachuteCheck) then { }; if (!local _unit) exitwith { + TRACE_6("ACE_DEBUG_Unconscious_PFH",_unit, _args, _startingTime, _minWaitingTime, _idPFH, _unit getvariable QGVAR(unconsciousArguments)); _args set [3, _minWaitingTime - (ACE_time - _startingTime)]; _unit setvariable [QGVAR(unconsciousArguments), _args, true]; [_idPFH] call CBA_fnc_removePerFrameHandler; @@ -131,6 +137,7 @@ if (!local _unit) exitwith { // Ensure we are waiting at least a minimum period before checking if we can wake up the unit again, allows for temp knock outs if ((ACE_time - _startingTime) >= _minWaitingTime) exitwith { + TRACE_2("ACE_DEBUG_Unconscious_Temp knock outs",_unit, [_unit] call FUNC(getUnconsciousCondition)); if (!([_unit] call FUNC(getUnconsciousCondition))) then { _unit setvariable ["ACE_isUnconscious", false, true]; }; From bf267246bf50697943af3b95d0b05d0e4ce14cf9 Mon Sep 17 00:00:00 2001 From: ViperMaul Date: Fri, 4 Sep 2015 07:48:16 -0700 Subject: [PATCH 097/132] Adding same ADV special case to BASIC handle damage. --- addons/medical/functions/fnc_handleDamage_basic.sqf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/addons/medical/functions/fnc_handleDamage_basic.sqf b/addons/medical/functions/fnc_handleDamage_basic.sqf index a37ccea2b3..48786b4686 100644 --- a/addons/medical/functions/fnc_handleDamage_basic.sqf +++ b/addons/medical/functions/fnc_handleDamage_basic.sqf @@ -16,6 +16,12 @@ private ["_damageBodyParts", "_cache_params", "_cache_damages"]; params ["_target"]; TRACE_1("ACE_DEBUG: HandleDamage_BASIC Called",_target); +// bug, apparently can fire for remote units in special cases +if !(local _unit) exitWith { + TRACE_2("HandleDamage BASIC on remote unit!",_unit, isServer); + nil +}; + _damageBodyParts = _target getvariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]]; _cache_params = _target getVariable [QGVAR(cachedHandleDamageParams), []]; _cache_damages = _target getVariable QGVAR(cachedDamages); From 7f58d5a94d5fa335be89017b34cbdb0c7d656872 Mon Sep 17 00:00:00 2001 From: ViperMaul Date: Fri, 4 Sep 2015 10:20:34 -0700 Subject: [PATCH 098/132] Revert "Adding same ADV special case to BASIC handle damage." -Not Needed This reverts commit bf267246bf50697943af3b95d0b05d0e4ce14cf9. --- addons/medical/functions/fnc_handleDamage_basic.sqf | 6 ------ 1 file changed, 6 deletions(-) diff --git a/addons/medical/functions/fnc_handleDamage_basic.sqf b/addons/medical/functions/fnc_handleDamage_basic.sqf index 48786b4686..a37ccea2b3 100644 --- a/addons/medical/functions/fnc_handleDamage_basic.sqf +++ b/addons/medical/functions/fnc_handleDamage_basic.sqf @@ -16,12 +16,6 @@ private ["_damageBodyParts", "_cache_params", "_cache_damages"]; params ["_target"]; TRACE_1("ACE_DEBUG: HandleDamage_BASIC Called",_target); -// bug, apparently can fire for remote units in special cases -if !(local _unit) exitWith { - TRACE_2("HandleDamage BASIC on remote unit!",_unit, isServer); - nil -}; - _damageBodyParts = _target getvariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]]; _cache_params = _target getVariable [QGVAR(cachedHandleDamageParams), []]; _cache_damages = _target getVariable QGVAR(cachedDamages); From 4c0c7bc290faaada790b11d6932222bc9f3958b9 Mon Sep 17 00:00:00 2001 From: ViperMaul Date: Fri, 4 Sep 2015 10:21:10 -0700 Subject: [PATCH 099/132] debug change --- addons/medical/functions/fnc_handleUnitVitals.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical/functions/fnc_handleUnitVitals.sqf b/addons/medical/functions/fnc_handleUnitVitals.sqf index 5227bf20d1..fddf5489da 100644 --- a/addons/medical/functions/fnc_handleUnitVitals.sqf +++ b/addons/medical/functions/fnc_handleUnitVitals.sqf @@ -74,7 +74,7 @@ if (_painStatus > (_unit getvariable [QGVAR(painSuppress), 0])) then { }; if (GVAR(level) == 1) then { - TRACE_5("ACE_DEBUG_BASIC",_painStatus,_unit getVariable QGVAR(hasPain),_unit getVariable QGVAR(morphine),_syncValues,_unit); + TRACE_5("ACE_DEBUG_BASIC_VITALS",_painStatus,_unit getVariable QGVAR(hasPain),_unit getVariable QGVAR(morphine),_syncValues,_unit); // reduce pain if (_painStatus > 0) then { _unit setVariable [QGVAR(pain), (_painStatus - 0.001 * _interval) max 0, _syncValues]; From 3d342ece206108f3557aae0e51441002cf8620f0 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 5 Sep 2015 11:04:11 +0200 Subject: [PATCH 100/132] Fixes #2156 Animation is still played even if you cancel any treatment --- addons/medical/functions/fnc_treatment_failure.sqf | 3 +-- addons/medical/functions/fnc_treatment_success.sqf | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/addons/medical/functions/fnc_treatment_failure.sqf b/addons/medical/functions/fnc_treatment_failure.sqf index b31a9fd0de..e943485e0e 100644 --- a/addons/medical/functions/fnc_treatment_failure.sqf +++ b/addons/medical/functions/fnc_treatment_failure.sqf @@ -35,8 +35,7 @@ if (vehicle _caller == _caller) then { case "ainvppnemstpslaywpstdnon_medic": {_lastAnim = "AinvPpneMstpSlayWpstDnon"}; case "ainvpknlmstpslaywpstdnon_medic": {_lastAnim = "AmovPknlMstpSrasWpstDnon"}; }; - [_caller, _lastAnim, 1] call EFUNC(common,doAnimation); - [_caller, _lastAnim, 1] call EFUNC(common,doAnimation); + [_caller, _lastAnim, 2] call EFUNC(common,doAnimation); }; _caller setvariable [QGVAR(treatmentPrevAnimCaller), nil]; diff --git a/addons/medical/functions/fnc_treatment_success.sqf b/addons/medical/functions/fnc_treatment_success.sqf index d32f63468e..bf183e24db 100644 --- a/addons/medical/functions/fnc_treatment_success.sqf +++ b/addons/medical/functions/fnc_treatment_success.sqf @@ -35,7 +35,7 @@ if (vehicle _caller == _caller) then { case "ainvppnemstpslaywpstdnon_medic": {_lastAnim = "AinvPpneMstpSlayWpstDnon"}; case "ainvpknlmstpslaywpstdnon_medic": {_lastAnim = "AmovPknlMstpSrasWpstDnon"}; }; - [_caller, _lastAnim, 1] call EFUNC(common,doAnimation); + [_caller, _lastAnim, 2] call EFUNC(common,doAnimation); }; _caller setvariable [QGVAR(treatmentPrevAnimCaller), nil]; From a25f640614b552d5c84f527f002ffe01dcea4625 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 5 Sep 2015 11:07:10 +0200 Subject: [PATCH 101/132] fixes #2114 No CPR available in basic medical when revive is enabled --- addons/medical/ACE_Medical_Treatments.hpp | 22 +++++++++++++++++++ .../fnc_treatmentAdvanced_CPRLocal.sqf | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/addons/medical/ACE_Medical_Treatments.hpp b/addons/medical/ACE_Medical_Treatments.hpp index 3dedd39b81..a97b149917 100644 --- a/addons/medical/ACE_Medical_Treatments.hpp +++ b/addons/medical/ACE_Medical_Treatments.hpp @@ -105,6 +105,28 @@ class ACE_Medical_Actions { itemConsumed = 0; litter[] = {}; }; + class CPR: Bandage { + displayName = CSTRING(Actions_CPR); + displayNameProgress = CSTRING(Actions_PerformingCPR); + category = "advanced"; + treatmentLocations[] = {"All"}; + allowedSelections[] = {"body"}; + requiredMedic = 0; + treatmentTime = 15; + items[] = {}; + condition = QUOTE(!([(_this select 1)] call ace_common_fnc_isAwake) && GVAR(enableRevive)); + callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_CPR)); + callbackFailure = ""; + callbackProgress = "!([((_this select 0) select 1)] call ace_common_fnc_isAwake)"; + animationPatient = ""; + animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback"; + animationCaller = "AinvPknlMstpSlayWnonDnon_medic"; + animationCallerProne = "AinvPpneMstpSlayW[wpn]Dnon_medic"; + animationCallerSelf = ""; + animationCallerSelfProne = ""; + itemConsumed = 0; + litter[] = {}; + }; }; class Advanced { diff --git a/addons/medical/functions/fnc_treatmentAdvanced_CPRLocal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_CPRLocal.sqf index cd943fc8d0..818640ca07 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_CPRLocal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_CPRLocal.sqf @@ -24,7 +24,7 @@ if (_target getvariable [QGVAR(inReviveState), false]) then { }; }; -if ((random 1) >= 0.6) then { +if (GVAR(level) > 1 && {(random 1) >= 0.6}) then { _target setvariable [QGVAR(inCardiacArrest), nil,true]; _target setvariable [QGVAR(heartRate), 40]; _target setvariable [QGVAR(bloodPressure), [50,70]]; From df3dbc9772af6980e6ac03e95a732e47c6e2788b Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 5 Sep 2015 11:25:31 +0200 Subject: [PATCH 102/132] Removed deprecated fire handling --- addons/medical/functions/fnc_handleDamage_advanced.sqf | 2 -- 1 file changed, 2 deletions(-) diff --git a/addons/medical/functions/fnc_handleDamage_advanced.sqf b/addons/medical/functions/fnc_handleDamage_advanced.sqf index f928732bba..214d291e86 100644 --- a/addons/medical/functions/fnc_handleDamage_advanced.sqf +++ b/addons/medical/functions/fnc_handleDamage_advanced.sqf @@ -22,8 +22,6 @@ private ["_typeOfProjectile", "_part", "_damageBodyParts", "_hitPoints"]; params ["_unit", "_selectionName", "_amountOfDamage", "_sourceOfDamage", "_typeOfProjectile", "_newDamage"]; -// Most likely taking exessive fire damage. Lets exit. -if (isNull _sourceOfDamage && {_typeOfProjectile == ""} && {vehicle _unit == _unit} && {(_selectionName == "head" || isBurning _unit)}) exitwith {}; _part = [_selectionName] call FUNC(selectionNameToNumber); if (_part < 0) exitwith {}; From cd9e5df7825161fe0cb97f1dd80d06d0e548d304 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 5 Sep 2015 11:25:56 +0200 Subject: [PATCH 103/132] Clean up of handleDamage. Fixes some debug code --- addons/medical/functions/fnc_handleDamage.sqf | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/addons/medical/functions/fnc_handleDamage.sqf b/addons/medical/functions/fnc_handleDamage.sqf index 7226926700..fe06a47e9a 100644 --- a/addons/medical/functions/fnc_handleDamage.sqf +++ b/addons/medical/functions/fnc_handleDamage.sqf @@ -28,10 +28,10 @@ if !(local _unit) exitWith { private ["_damageReturn", "_typeOfDamage", "_minLethalDamage", "_newDamage", "_typeIndex", "_preventDeath"]; // bug, assumed fixed, @todo excessive testing, if nothing happens remove -/*if (typeName _projectile == "OBJECT") then { +if (typeName _projectile == "OBJECT") then { _projectile = typeOf _projectile; _this set [4, _projectile]; -};*/ +}; TRACE_3("ACE_DEBUG: HandleDamage",_selection,_damage, _unit); @@ -44,16 +44,14 @@ if (_selection != "" && {!(_selection in GVAR(SELECTIONS))}) exitWith {0}; //@to // Exit if we disable damage temporarily if !(_unit getVariable [QGVAR(allowDamage), true]) exitWith { + TRACE_3("ACE_DEBUG: HandleDamage damage disabled.",_selection,damage _unit, _unit); if (_selection == "") then { damage _unit } else { _unit getHit _selection }; - TRACE_3("ACE_DEBUG: HandleDamage damage disabled.",_selection,damage _unit, _unit); }; -//if (true) exitWith {nil};// - // Get return damage _damageReturn = _damage; From 4514812523b21b212715c70969bd635f26a34f1d Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 5 Sep 2015 11:51:46 +0200 Subject: [PATCH 104/132] Basic bandaging now works with new damage system --- addons/medical/XEH_preInit.sqf | 1 + .../functions/fnc_treatmentBasic_bandage.sqf | 11 +---- .../fnc_treatmentBasic_bandageLocal.sqf | 44 +++++++++++++++++++ 3 files changed, 46 insertions(+), 10 deletions(-) create mode 100644 addons/medical/functions/fnc_treatmentBasic_bandageLocal.sqf diff --git a/addons/medical/XEH_preInit.sqf b/addons/medical/XEH_preInit.sqf index 838dce7404..2625bf4b8a 100644 --- a/addons/medical/XEH_preInit.sqf +++ b/addons/medical/XEH_preInit.sqf @@ -84,6 +84,7 @@ PREP(treatmentAdvanced_medication); PREP(treatmentAdvanced_medicationLocal); PREP(treatmentAdvanced_surgicalKit_onProgress); PREP(treatmentBasic_bandage); +PREP(treatmentBasic_bandageLocal); PREP(treatmentBasic_bloodbag); PREP(treatmentBasic_bloodbagLocal); PREP(treatmentBasic_epipen); diff --git a/addons/medical/functions/fnc_treatmentBasic_bandage.sqf b/addons/medical/functions/fnc_treatmentBasic_bandage.sqf index c0ebc35472..04cace08af 100644 --- a/addons/medical/functions/fnc_treatmentBasic_bandage.sqf +++ b/addons/medical/functions/fnc_treatmentBasic_bandage.sqf @@ -20,13 +20,4 @@ private ["_hitSelections", "_hitPoints", "_point", "_damage"]; params ["_caller", "_target", "_selection", "_className"]; -if (_selection == "all") then { - _target setDamage ((damage _target - BANDAGEHEAL) max 0); -} else { - _hitSelections = ["head", "body", "hand_l", "hand_r", "leg_l", "leg_r"]; - _hitPoints = ["HitHead", "HitBody", "HitLeftArm", "HitRightArm", "HitLeftLeg", "HitRightLeg"]; - _point = _hitPoints select (_hitSelections find _selection); - - _damage = ((_target getHitPointDamage _point) - BANDAGEHEAL) max 0; - [_target, _point, _damage] call FUNC(setHitPointDamage); -}; +[[_target, _selection], QUOTE(DFUNC(treatmentBasic_bandageLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ diff --git a/addons/medical/functions/fnc_treatmentBasic_bandageLocal.sqf b/addons/medical/functions/fnc_treatmentBasic_bandageLocal.sqf new file mode 100644 index 0000000000..4f94622947 --- /dev/null +++ b/addons/medical/functions/fnc_treatmentBasic_bandageLocal.sqf @@ -0,0 +1,44 @@ +/* + * Author: Glowbal + * Handles the bandage of a patient. + * + * Arguments: + * 0: The patient + * 1: Treatment classname + * + * + * Return Value: + * Succesful treatment started + * + * Public: No + */ + +#include "script_component.hpp" +#define BANDAGEHEAL 0.8 + +params ["_target", "_selectionName"]; + +_damageBodyParts = _target getvariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]]; + +// Ensure it is a valid bodypart +_part = [_selectionName] call FUNC(selectionNameToNumber); +if (_part < 0) exitwith {false}; + +if ((_damageBodyParts select _part) > 0) then { + _damageBodyParts set [_part, ((_damageBodyParts select _part) - BANDAGEHEAL) max 0]; + _target setvariable [QGVAR(bodyPartStatus), _damageBodyParts, true]; + TRACE_2("ACE_DEBUG: Treatment BASIC Bandage Broadcast value here",_unit, _target getvariable QGVAR(bodyPartStatus)); +}; +systemChat format["BANDAGE LOCAL RAN: %1", _this]; + +EXPLODE_6_PVT(_damageBodyParts,_headDamage,_torsoDamage,_handsDamageR,_handsDamageL,_legsDamageR,_legsDamageL); +_target setHitPointDamage ["hitHead", _headDamage min 0.95]; +_target setHitPointDamage ["hitBody", _torsoDamage min 0.95]; +_target setHitPointDamage ["hitHands", (_handsDamageR + _handsDamageL) min 0.95]; +_target setHitPointDamage ["hitLegs", (_legsDamageR + _legsDamageL) min 0.95]; + +{ + _target setHitPointDamage [_x, (_damageBodyParts select _foreachIndex) min 0.95]; +}foreach GVAR(HITPOINTS); + +true; From 39ff82e76454eece7b57d351fb74073f95b7ca4d Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 5 Sep 2015 11:52:12 +0200 Subject: [PATCH 105/132] fixes for CPR condition in basic medical and improvements to lethalDamage --- addons/medical/ACE_Medical_Treatments.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/medical/ACE_Medical_Treatments.hpp b/addons/medical/ACE_Medical_Treatments.hpp index a97b149917..9f796bcb06 100644 --- a/addons/medical/ACE_Medical_Treatments.hpp +++ b/addons/medical/ACE_Medical_Treatments.hpp @@ -114,7 +114,7 @@ class ACE_Medical_Actions { requiredMedic = 0; treatmentTime = 15; items[] = {}; - condition = QUOTE(!([(_this select 1)] call ace_common_fnc_isAwake) && GVAR(enableRevive)); + condition = QUOTE(!([(_this select 1)] call ace_common_fnc_isAwake) && GVAR(enableRevive)>0); callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_CPR)); callbackFailure = ""; callbackProgress = "!([((_this select 0) select 1)] call ace_common_fnc_isAwake)"; @@ -627,6 +627,7 @@ class ACE_Medical_Advanced { class vehiclecrash { thresholds[] = {{0.25, 5}}; selectionSpecific = 0; + lethalDamage = 0.2; }; class backblast { thresholds[] = {{0, 2},{0.55, 5}, {1, 6}}; @@ -644,6 +645,7 @@ class ACE_Medical_Advanced { class falling { thresholds[] = {{0.1, 1}}; selectionSpecific = 1; + lethalDamage = 0.4; }; class ropeburn { thresholds[] = {{0.1, 1}}; From 130569c485491a56d28ce359cebde5bdef3b1597 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 5 Sep 2015 11:57:17 +0200 Subject: [PATCH 106/132] Made basic medical bleeding information work with new damage system --- addons/medical/functions/fnc_modifyMedicalAction.sqf | 2 +- addons/medical_menu/functions/fnc_updateUIInfo.sqf | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/addons/medical/functions/fnc_modifyMedicalAction.sqf b/addons/medical/functions/fnc_modifyMedicalAction.sqf index 1ac709059f..8feaa7bfca 100644 --- a/addons/medical/functions/fnc_modifyMedicalAction.sqf +++ b/addons/medical/functions/fnc_modifyMedicalAction.sqf @@ -21,7 +21,7 @@ params ["_target", "_player", "_selectionN", "_actionData"]; if (GVAR(level) < 2) exitwith { private ["_pointDamage"]; - _pointDamage = _target getHitPointDamage (["HitHead", "HitBody", "HitLeftArm", "HitRightArm", "HitLeftLeg", "HitRightLeg"] select _selectionN); + _pointDamage = (_target getvariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]]) select _selectionN; if (_pointDamage >= 0.8) exitWith { _actionData set [2, QUOTE(PATHTOF(UI\icons\medical_crossRed.paa))]; diff --git a/addons/medical_menu/functions/fnc_updateUIInfo.sqf b/addons/medical_menu/functions/fnc_updateUIInfo.sqf index 7dee2d5123..3a41412cbb 100644 --- a/addons/medical_menu/functions/fnc_updateUIInfo.sqf +++ b/addons/medical_menu/functions/fnc_updateUIInfo.sqf @@ -105,11 +105,12 @@ if (EGVAR(medical,level) >= 2) then { } forEach _bandagedwounds; } else { _damaged = [true, true, true, true, true, true]; - { - _selectionBloodLoss set [_forEachIndex, _target getHitPointDamage _x]; - if (_target getHitPointDamage _x > 0 && _forEachIndex == _selectionN) then { - _pointDamage = _target getHitPointDamage _x; + { + _selectionBloodLoss set [_forEachIndex, _x]; + + if (_x > 0 && _forEachIndex == _selectionN) then { + _pointDamage = _x; _severity = switch (true) do { case (_pointDamage > 0.5): {localize ELSTRING(medical,HeavilyWounded)}; case (_pointDamage > 0.1): {localize ELSTRING(medical,LightlyWounded)}; @@ -125,7 +126,7 @@ if (EGVAR(medical,level) >= 2) then { ] select _forEachIndex); _allInjuryTexts pushBack [format ["%1 %2", _severity, toLower _part], [1,1,1,1]]; }; - } forEach ["HitHead", "HitBody", "HitLeftArm", "HitRightArm", "HitLeftLeg", "HitRightLeg"]; + } forEach (_target getvariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]]); }; [_selectionBloodLoss, _display] call FUNC(updateBodyImage); From 85dc59d66cc9a4852abf9ac7cb55e012f62861a4 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 5 Sep 2015 11:57:41 +0200 Subject: [PATCH 107/132] Fixed: should only display "no injuries" when there are no injuries. Not the other way around --- addons/medical_menu/functions/fnc_updateInformationLists.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical_menu/functions/fnc_updateInformationLists.sqf b/addons/medical_menu/functions/fnc_updateInformationLists.sqf index 70903347b5..ecd700e43a 100644 --- a/addons/medical_menu/functions/fnc_updateInformationLists.sqf +++ b/addons/medical_menu/functions/fnc_updateInformationLists.sqf @@ -33,6 +33,6 @@ _amountOfGeneric = count _genericMessages; _lbCtrl lbSetColor [_forEachIndex + _amountOfGeneric, _color]; } forEach _allInjuryTexts; -if !(_allInjuryTexts isEqualTo []) then { +if (_allInjuryTexts isEqualTo []) then { _lbCtrl lbAdd localize ELSTRING(medical,NoInjuriesBodypart); }; From 883b9ab5457d9cdc750cf171a015a88b666fbddb Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 5 Sep 2015 11:58:34 +0200 Subject: [PATCH 108/132] Removed blur screen for medical menu #2069 --- addons/medical_menu/ui/menu.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/medical_menu/ui/menu.hpp b/addons/medical_menu/ui/menu.hpp index ab078d4c72..4a07778bd1 100644 --- a/addons/medical_menu/ui/menu.hpp +++ b/addons/medical_menu/ui/menu.hpp @@ -3,8 +3,8 @@ class GVAR(medicalMenu) { idd = 314412; movingEnable = true; - onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(medicalMenu)), _this select 0)]; [ARR_2(QUOTE(QGVAR(id)), true)] call EFUNC(common,blurScreen); [_this select 0] call FUNC(onMenuOpen);); - onUnload = QUOTE([ARR_2(QUOTE(QGVAR(id)), false)] call EFUNC(common,blurScreen); [GVAR(MenuPFHID)] call CBA_fnc_removePerFrameHandler;); + onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(medicalMenu)), _this select 0)]; [_this select 0] call FUNC(onMenuOpen);); + onUnload = QUOTE([GVAR(MenuPFHID)] call CBA_fnc_removePerFrameHandler;); class controlsBackground { class HeaderBackground: ACE_gui_backgroundBase{ idc = -1; From e0db571e13eae6f669baa6c4b1fc27a296799b55 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 5 Sep 2015 12:00:45 +0200 Subject: [PATCH 109/132] Minor adjustment to fatality change on torso damage --- 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 939bf8c9b7..10a64d79a6 100644 --- a/addons/medical/functions/fnc_determineIfFatal.sqf +++ b/addons/medical/functions/fnc_determineIfFatal.sqf @@ -38,7 +38,7 @@ if (_part == 0) exitwith { // Check if damage to body part is higher as damage torso if (_part == 1) exitwith { - (_damageBodyPart >= (_damageThreshold select 1) && {(random(1) > 0.2)}); + (_damageBodyPart >= (_damageThreshold select 1) && {(random(1) > 0.35)}); }; // Check if damage to body part is higher as damage limbs (_damageBodyPart >= (_damageThreshold select 2) && {(random(1) > 0.95)}); From 4122b32dba03b8585bfb0f4b5e3f1a1769898714 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 5 Sep 2015 12:02:09 +0200 Subject: [PATCH 110/132] Removed deprecated wound sync code --- addons/medical/functions/fnc_handleKilled.sqf | 7 ------- 1 file changed, 7 deletions(-) diff --git a/addons/medical/functions/fnc_handleKilled.sqf b/addons/medical/functions/fnc_handleKilled.sqf index d4fbfee30a..d6a4440d76 100644 --- a/addons/medical/functions/fnc_handleKilled.sqf +++ b/addons/medical/functions/fnc_handleKilled.sqf @@ -22,11 +22,4 @@ if (GVAR(level) >= 2) then { _unit setvariable [QGVAR(heartRate), 0]; _unit setvariable [QGVAR(bloodPressure), [0, 0]]; _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; - }; }; From 268220bbaeaa30c1c050fd052d4b42421b4579d8 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 5 Sep 2015 12:20:40 +0200 Subject: [PATCH 111/132] Possible fix for weird unconscious behavior in basic medical --- addons/medical/functions/fnc_addToInjuredCollection.sqf | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/addons/medical/functions/fnc_addToInjuredCollection.sqf b/addons/medical/functions/fnc_addToInjuredCollection.sqf index 66433a5ed0..0ed9b9747f 100644 --- a/addons/medical/functions/fnc_addToInjuredCollection.sqf +++ b/addons/medical/functions/fnc_addToInjuredCollection.sqf @@ -45,9 +45,12 @@ if ([_unit] call FUNC(hasMedicalEnabled) || _force) then { private "_pain"; _pain = _unit getvariable [QGVAR(pain), 0]; if (_pain > (_unit getvariable [QGVAR(painSuppress), 0])) then { - if (_pain > 0.7 && {random(1) > 0.6}) then { + // This introduces wierd unconscious behaviour for basic medical and possibly also advanced. + // TODO This is disabled as it's considered non critical code. + // We will need to decide if we want unconscious triggered on high pain levels or if we can get rid of this entirely. + /*if (_pain > 0.7 && {random(1) > 0.6}) then { [_unit] call FUNC(setUnconscious); - }; + };*/ [_unit, _pain] call FUNC(playInjuredSound); }; From 6b73eafcce52acd23659d570993ff3f0d30dbc6a Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 5 Sep 2015 12:31:52 +0200 Subject: [PATCH 112/132] Allow users to disable medical 3d interaction. --- addons/medical/ACE_Settings.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/medical/ACE_Settings.hpp b/addons/medical/ACE_Settings.hpp index 910f152292..b17610b0e3 100644 --- a/addons/medical/ACE_Settings.hpp +++ b/addons/medical/ACE_Settings.hpp @@ -220,7 +220,7 @@ class ACE_Settings { description = CSTRING(menuTypeDescription); typeName = "SCALAR"; value = 0; - values[] = {CSTRING(useSelection)/*, CSTRING(useRadial)*/}; - // isClientSettable = 1; + values[] = {CSTRING(useSelection), CSTRING(useRadial), "Disabled"}; + isClientSettable = 1; }; }; From 25a75b9f690e4855669e7adb0beee7a20ef2971f Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 5 Sep 2015 12:35:48 +0200 Subject: [PATCH 113/132] fixed incorrect macro usage --- addons/medical_menu/functions/fnc_updateUIInfo.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical_menu/functions/fnc_updateUIInfo.sqf b/addons/medical_menu/functions/fnc_updateUIInfo.sqf index 3a41412cbb..b493b5026e 100644 --- a/addons/medical_menu/functions/fnc_updateUIInfo.sqf +++ b/addons/medical_menu/functions/fnc_updateUIInfo.sqf @@ -126,7 +126,7 @@ if (EGVAR(medical,level) >= 2) then { ] select _forEachIndex); _allInjuryTexts pushBack [format ["%1 %2", _severity, toLower _part], [1,1,1,1]]; }; - } forEach (_target getvariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]]); + } forEach (_target getvariable [QEGVAR(medical,bodyPartStatus), [0,0,0,0,0,0]]); }; [_selectionBloodLoss, _display] call FUNC(updateBodyImage); From 17648739ddcf77dc4e7eb3164fc0545b5ad3f40e Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 5 Sep 2015 12:37:01 +0200 Subject: [PATCH 114/132] Removed more deprecated wound sync code --- .../functions/fnc_handleDamage_woundsOld.sqf | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/addons/medical/functions/fnc_handleDamage_woundsOld.sqf b/addons/medical/functions/fnc_handleDamage_woundsOld.sqf index 0c08d1e884..0a37952d12 100644 --- a/addons/medical/functions/fnc_handleDamage_woundsOld.sqf +++ b/addons/medical/functions/fnc_handleDamage_woundsOld.sqf @@ -121,19 +121,7 @@ _woundsCreated = []; }; } foreach (_injuryTypeInfo select 0); // foreach damage thresholds -_unit setvariable [QGVAR(openWounds), _openWounds, !USE_WOUND_EVENT_SYNC]; - -// Only update if new wounds have been created -if (count _woundsCreated > 0) then { -// _unit setvariable [QGVAR(lastUniqueWoundID), _woundID, true]; -}; - -if (USE_WOUND_EVENT_SYNC) then { - // Broadcast the new injuries across the net in parts. One broadcast per injury. Prevents having to broadcast one massive array of injuries. - { - // ["medical_propagateWound", [_unit, _x]] call EFUNC(common,globalEvent); - }foreach _woundsCreated; -}; +_unit setvariable [QGVAR(openWounds), _openWounds, true]; _painLevel = _unit getvariable [QGVAR(pain), 0]; _unit setvariable [QGVAR(pain), _painLevel + _painToAdd]; From c673ea2cbbb10e495e7073f21fb93630eb250023 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 5 Sep 2015 12:38:12 +0200 Subject: [PATCH 115/132] Restored uniqueIds --- addons/medical/functions/fnc_handleDamage_woundsOld.sqf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/addons/medical/functions/fnc_handleDamage_woundsOld.sqf b/addons/medical/functions/fnc_handleDamage_woundsOld.sqf index 0a37952d12..cbc28dcca9 100644 --- a/addons/medical/functions/fnc_handleDamage_woundsOld.sqf +++ b/addons/medical/functions/fnc_handleDamage_woundsOld.sqf @@ -123,5 +123,10 @@ _woundsCreated = []; _unit setvariable [QGVAR(openWounds), _openWounds, true]; +// Only update if new wounds have been created +if (count _woundsCreated > 0) then { + _unit setvariable [QGVAR(lastUniqueWoundID), _woundID, true]; +}; + _painLevel = _unit getvariable [QGVAR(pain), 0]; _unit setvariable [QGVAR(pain), _painLevel + _painToAdd]; From c70c9cdee6b8c53c5da7fafc350e86eac8e3d8b2 Mon Sep 17 00:00:00 2001 From: jokoho48 Date: Sat, 5 Sep 2015 12:49:23 +0200 Subject: [PATCH 116/132] Add Screen Blur and Blackout for Medical Menu by Interact_menu setting --- addons/medical_menu/XEH_preInit.sqf | 1 + .../functions/fnc_onMenuClose.sqf | 21 +++++++++++++++++++ .../medical_menu/functions/fnc_onMenuOpen.sqf | 3 +++ addons/medical_menu/ui/menu.hpp | 4 ++-- 4 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 addons/medical_menu/functions/fnc_onMenuClose.sqf diff --git a/addons/medical_menu/XEH_preInit.sqf b/addons/medical_menu/XEH_preInit.sqf index c231c7df6e..65ac88e245 100644 --- a/addons/medical_menu/XEH_preInit.sqf +++ b/addons/medical_menu/XEH_preInit.sqf @@ -3,6 +3,7 @@ ADDON = false; PREP(onMenuOpen); +PREP(onMenuClose); PREP(openMenu); PREP(canOpenMenu); diff --git a/addons/medical_menu/functions/fnc_onMenuClose.sqf b/addons/medical_menu/functions/fnc_onMenuClose.sqf new file mode 100644 index 0000000000..4300089a4a --- /dev/null +++ b/addons/medical_menu/functions/fnc_onMenuClose.sqf @@ -0,0 +1,21 @@ +/* + * Author: joko // Jonas + * Handle medical menu closed + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_medical_menu_onMenuClosed + * + * Public: No + */ +#include "script_component.hpp" + +if (EGVAR(interact_menu,menuBackground)==1) then {[QGVAR(id), false] call EFUNC(common,blurScreen);}; +if (EGVAR(interact_menu,menuBackground)==2) then {(uiNamespace getVariable [QEGVAR(interact_menu,menuBackground), displayNull]) closeDisplay 0;}; + +[GVAR(MenuPFHID)] call CBA_fnc_removePerFrameHandler; diff --git a/addons/medical_menu/functions/fnc_onMenuOpen.sqf b/addons/medical_menu/functions/fnc_onMenuOpen.sqf index 164353fe73..9f0acfbeb6 100644 --- a/addons/medical_menu/functions/fnc_onMenuOpen.sqf +++ b/addons/medical_menu/functions/fnc_onMenuOpen.sqf @@ -22,6 +22,9 @@ params ["_display"]; if (isNil "_display") exitwith {}; +if (EGVAR(interact_menu,menuBackground)==1) then {[QGVAR(id), true] call EFUNC(common,blurScreen);}; +if (EGVAR(interact_menu,menuBackground)==2) then {0 cutRsc[QEGVAR(interact_menu,menuBackground), "PLAIN", 1, false];}; + if (isNil QGVAR(LatestDisplayOptionMenu)) then { GVAR(LatestDisplayOptionMenu) = "triage"; } else { diff --git a/addons/medical_menu/ui/menu.hpp b/addons/medical_menu/ui/menu.hpp index 4a07778bd1..342f0230a2 100644 --- a/addons/medical_menu/ui/menu.hpp +++ b/addons/medical_menu/ui/menu.hpp @@ -4,9 +4,9 @@ class GVAR(medicalMenu) { idd = 314412; movingEnable = true; onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(medicalMenu)), _this select 0)]; [_this select 0] call FUNC(onMenuOpen);); - onUnload = QUOTE([GVAR(MenuPFHID)] call CBA_fnc_removePerFrameHandler;); + onUnload = QUOTE([] call FUNC(onMenuClose)); class controlsBackground { - class HeaderBackground: ACE_gui_backgroundBase{ + class HeaderBackground: ACE_gui_backgroundBase { idc = -1; SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; From c828544d0208e330a92f00f061a39047979dc396 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 5 Sep 2015 12:50:32 +0200 Subject: [PATCH 117/132] Added init stacking --- addons/medical/XEH_init.sqf | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/medical/XEH_init.sqf b/addons/medical/XEH_init.sqf index 0b86a927b2..acdd50ce82 100644 --- a/addons/medical/XEH_init.sqf +++ b/addons/medical/XEH_init.sqf @@ -5,5 +5,8 @@ params ["_unit"]; _unit addEventHandler ["HandleDamage", {_this call FUNC(handleDamage)}]; if (local _unit) then { - [_unit] call FUNC(init); + if (!EGVAR(common,settingsInitFinished)) exitWith { + EGVAR(common,runAtSettingsInitialized) pushBack [FUNC(init), [_unit]]; + }; + [_unit] call FUNC(init); }; From 9c0288cd3f40246bf7eb84026b626156ca1ad669 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 5 Sep 2015 12:55:49 +0200 Subject: [PATCH 118/132] Removed debug message --- addons/medical/functions/fnc_treatmentBasic_bandageLocal.sqf | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/medical/functions/fnc_treatmentBasic_bandageLocal.sqf b/addons/medical/functions/fnc_treatmentBasic_bandageLocal.sqf index 4f94622947..37c9f3ef15 100644 --- a/addons/medical/functions/fnc_treatmentBasic_bandageLocal.sqf +++ b/addons/medical/functions/fnc_treatmentBasic_bandageLocal.sqf @@ -29,7 +29,6 @@ if ((_damageBodyParts select _part) > 0) then { _target setvariable [QGVAR(bodyPartStatus), _damageBodyParts, true]; TRACE_2("ACE_DEBUG: Treatment BASIC Bandage Broadcast value here",_unit, _target getvariable QGVAR(bodyPartStatus)); }; -systemChat format["BANDAGE LOCAL RAN: %1", _this]; EXPLODE_6_PVT(_damageBodyParts,_headDamage,_torsoDamage,_handsDamageR,_handsDamageL,_legsDamageR,_legsDamageL); _target setHitPointDamage ["hitHead", _headDamage min 0.95]; From 17ad7ecb8cc93dde5a003267ac1efb1190b5e872 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 5 Sep 2015 12:59:09 +0200 Subject: [PATCH 119/132] replaced diag_logs by trace --- .../medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf index 0b19c05b03..abf09385b2 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf @@ -41,7 +41,7 @@ _mostEffectiveInjury = _openWounds select 0; _exit = false; { _x params ["", "_classID", "_partX"]; - diag_log format["OPENWOUND: %1", _x]; + TRACE_2("OPENWOUND: ", _target, _x); // Only parse injuries that are for the selected bodypart. if (_partX == _part) then { _woundEffectivenss = _effectiveness; @@ -57,7 +57,7 @@ _exit = false; }; }; - diag_log format["_specificClass: %1 vs classId %2", _specificClass, _classID]; + TRACE_2("Wound classes: ", _specificClass, _classID); if (_specificClass == _classID) exitwith { _effectivenessFound = _woundEffectivenss; _mostEffectiveSpot = _foreachIndex; From a4e406658f06edc2eda623cf8bae736982cb03c5 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 5 Sep 2015 13:02:19 +0200 Subject: [PATCH 120/132] Reduced initial knockdown time for basic medical --- addons/medical/functions/fnc_handleDamage_basic.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical/functions/fnc_handleDamage_basic.sqf b/addons/medical/functions/fnc_handleDamage_basic.sqf index a37ccea2b3..24ad2638a1 100644 --- a/addons/medical/functions/fnc_handleDamage_basic.sqf +++ b/addons/medical/functions/fnc_handleDamage_basic.sqf @@ -36,7 +36,7 @@ TRACE_4("ACE_DEBUG: HandleDamage BASIC",_unit, _damageBodyParts,_cache_params,_c if (alive _unit && {!(_unit getvariable ["ACE_isUnconscious", false])}) then { // If it reaches this, we can assume that the hit did not kill this unit, as this function is called 3 frames after the damage has been passed. if ([_unit, _part, if (_part > 1) then {_newDamage * 1.3} else {_newDamage * 2}] call FUNC(determineIfFatal)) then { - [_unit] call FUNC(setUnconscious); + [_unit, true, 0.5+random(3)] call FUNC(setUnconscious); }; }; _pain = _unit getVariable [QGVAR(pain), 0]; From f15a1c033d93061f4b8cc596046742867e9058dd Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 5 Sep 2015 13:20:19 +0200 Subject: [PATCH 121/132] Added allowSelfTreatment attribute to treatment actions --- addons/medical/ACE_Medical_Treatments.hpp | 12 ++++++++++++ addons/medical/functions/fnc_canTreat.sqf | 3 +++ addons/medical/functions/fnc_treatment.sqf | 3 +++ 3 files changed, 18 insertions(+) diff --git a/addons/medical/ACE_Medical_Treatments.hpp b/addons/medical/ACE_Medical_Treatments.hpp index 9f796bcb06..ea9e03974a 100644 --- a/addons/medical/ACE_Medical_Treatments.hpp +++ b/addons/medical/ACE_Medical_Treatments.hpp @@ -7,6 +7,7 @@ class ACE_Medical_Actions { category = "bandage"; treatmentLocations[] = {"All"}; allowedSelections[] = {"All"}; + allowSelfTreatment = 1; requiredMedic = 0; treatmentTime = 5; treatmentTimeSelfCoef = 1; @@ -32,6 +33,7 @@ class ACE_Medical_Actions { displayName = CSTRING(Inject_Morphine); displayNameProgress = CSTRING(Injecting_Morphine); allowedSelections[] = {"hand_l", "hand_r", "leg_l", "leg_r"}; + allowSelfTreatment = 1; category = "medication"; treatmentTime = 2; items[] = {"ACE_morphine"}; @@ -43,6 +45,7 @@ class ACE_Medical_Actions { displayName = CSTRING(Inject_Epinephrine); displayNameProgress = CSTRING(Injecting_Epinephrine); allowedSelections[] = {"hand_l", "hand_r", "leg_l", "leg_r"}; + allowSelfTreatment = 1; category = "medication"; requiredMedic = 1; treatmentTime = 3; @@ -55,6 +58,7 @@ class ACE_Medical_Actions { displayName = CSTRING(Transfuse_Blood); displayNameProgress = CSTRING(Transfusing_Blood); allowedSelections[] = {"hand_l", "hand_r", "leg_l", "leg_r"}; + allowSelfTreatment = 0; category = "advanced"; requiredMedic = 1; treatmentTime = 20; @@ -111,6 +115,7 @@ class ACE_Medical_Actions { category = "advanced"; treatmentLocations[] = {"All"}; allowedSelections[] = {"body"}; + allowSelfTreatment = 0; requiredMedic = 0; treatmentTime = 15; items[] = {}; @@ -137,6 +142,7 @@ class ACE_Medical_Actions { // Which locations can this treatment action be used? Available: Field, MedicalFacility, MedicalVehicle, All. treatmentLocations[] = {"All"}; allowedSelections[] = {"All"}; + allowSelfTreatment = 1; // What is the level of medical skill required for this treatment action? 0 = all soldiers, 1 = medic, 2 = doctor requiredMedic = 0; // The time it takes for a treatment action to complete. Time is in seconds. @@ -210,6 +216,7 @@ class ACE_Medical_Actions { displayName = CSTRING(Actions_Blood4_1000); displayNameProgress = CSTRING(Transfusing_Blood); allowedSelections[] = {"hand_l", "hand_r", "leg_l", "leg_r"}; + allowSelfTreatment = 0; category = "advanced"; items[] = {"ACE_bloodIV"}; requiredMedic = 1; @@ -260,6 +267,7 @@ class ACE_Medical_Actions { category = "advanced"; items[] = {"ACE_surgicalKit"}; treatmentLocations[] = {QGVAR(useLocation_SurgicalKit)}; + allowSelfTreatment = 0; requiredMedic = QGVAR(medicSetting_SurgicalKit); patientStateCondition = QGVAR(useCondition_SurgicalKit); treatmentTime = "(count ((_this select 1) getVariable ['ACE_Medical_bandagedWounds', []]) * 5)"; @@ -275,6 +283,7 @@ class ACE_Medical_Actions { category = "advanced"; items[] = {"ACE_personalAidKit"}; treatmentLocations[] = {QGVAR(useLocation_PAK)}; + allowSelfTreatment = 0; requiredMedic = QGVAR(medicSetting_PAK); patientStateCondition = QGVAR(useCondition_PAK); treatmentTime = QUOTE((_this select 1) call FUNC(treatmentAdvanced_fullHealTreatmentTime)); @@ -319,6 +328,7 @@ class ACE_Medical_Actions { displayName = CSTRING(Check_Response); callbackSuccess = QUOTE(DFUNC(actionCheckResponse)); displayNameProgress = CSTRING(Check_Response_Content); + allowSelfTreatment = 0; }; class RemoveTourniquet: Tourniquet { displayName = CSTRING(Actions_RemoveTourniquet); @@ -335,6 +345,7 @@ class ACE_Medical_Actions { category = "advanced"; treatmentLocations[] = {"All"}; allowedSelections[] = {"body"}; + allowSelfTreatment = 0; requiredMedic = 0; treatmentTime = 15; items[] = {}; @@ -356,6 +367,7 @@ class ACE_Medical_Actions { displayNameProgress = CSTRING(PlacingInBodyBag); category = "advanced"; treatmentLocations[] = {"All"}; + allowSelfTreatment = 0; requiredMedic = 0; treatmentTime = 15; items[] = {"ACE_bodyBag"}; diff --git a/addons/medical/functions/fnc_canTreat.sqf b/addons/medical/functions/fnc_canTreat.sqf index ff191ea7ca..ba6ced0486 100644 --- a/addons/medical/functions/fnc_canTreat.sqf +++ b/addons/medical/functions/fnc_canTreat.sqf @@ -26,6 +26,9 @@ _config = (ConfigFile >> "ACE_Medical_Actions" >> (["Basic", "Advanced"] select if !(isClass _config) exitwith {false}; +// Allow self treatment check +if (_caller == _target && {getNumber (_config >> "allowSelfTreatment") == 0}) exitwith {false}; + _medicRequired = if (isNumber (_config >> "requiredMedic")) then { getNumber (_config >> "requiredMedic"); } else { diff --git a/addons/medical/functions/fnc_treatment.sqf b/addons/medical/functions/fnc_treatment.sqf index a39375a05e..5e97e31501 100644 --- a/addons/medical/functions/fnc_treatment.sqf +++ b/addons/medical/functions/fnc_treatment.sqf @@ -34,6 +34,9 @@ if (GVAR(level) >= 2) then { }; if !(isClass _config) exitwith {false}; +// Allow self treatment check +if (_caller == _target && {getNumber (_config >> "allowSelfTreatment") == 0}) exitwith {false}; + _medicRequired = if (isNumber (_config >> "requiredMedic")) then { getNumber (_config >> "requiredMedic"); } else { From dad96822bef05151366764fd6b23b85d341be8f2 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 5 Sep 2015 13:27:02 +0200 Subject: [PATCH 122/132] Only add 1/4 of the new damage to pain instead of everything. --- addons/medical/functions/fnc_handleDamage_basic.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical/functions/fnc_handleDamage_basic.sqf b/addons/medical/functions/fnc_handleDamage_basic.sqf index 24ad2638a1..43b0852e1b 100644 --- a/addons/medical/functions/fnc_handleDamage_basic.sqf +++ b/addons/medical/functions/fnc_handleDamage_basic.sqf @@ -40,7 +40,7 @@ TRACE_4("ACE_DEBUG: HandleDamage BASIC",_unit, _damageBodyParts,_cache_params,_c }; }; _pain = _unit getVariable [QGVAR(pain), 0]; - _pain = _pain + _newDamage * (1 - (_unit getVariable [QGVAR(morphine), 0])); + _pain = _pain + (_newDamage / 4) * (1 - (_unit getVariable [QGVAR(morphine), 0])); _unit setVariable [QGVAR(pain), _pain min 1, true]; }; }foreach _cache_params; From d9af19df28849e9372e1253175be6d2c5ee55876 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 5 Sep 2015 14:08:46 +0200 Subject: [PATCH 123/132] properly fixes unconscious weird behavior. Because it never registered any unconscious conditions. --- addons/medical/XEH_postInit.sqf | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/addons/medical/XEH_postInit.sqf b/addons/medical/XEH_postInit.sqf index e6e2ca5ceb..97f5e64c44 100644 --- a/addons/medical/XEH_postInit.sqf +++ b/addons/medical/XEH_postInit.sqf @@ -271,8 +271,6 @@ if (USE_WOUND_EVENT_SYNC) then { ] call FUNC(addUnconsciousCondition); }; - TRACE_6("ACE_DEBUG: SettingsInitialized_EH_BASIC",(_this select 0), GVAR(level),(_this select 0) getvariable QGVAR(bloodVolume),(_this select 0) getvariable QGVAR(pain), (_this select 0) getvariable QGVAR(painSuppress), [_this select 0] call FUNC(getBloodLoss)); - [ {(((_this select 0) getvariable [QGVAR(bloodVolume), 100]) < 40)}, {(((_this select 0) getvariable [QGVAR(pain), 0]) - ((_this select 0) getvariable [QGVAR(painSuppress), 0])) > 0.6}, @@ -280,7 +278,7 @@ if (USE_WOUND_EVENT_SYNC) then { {((_this select 0) getvariable [QGVAR(inReviveState), false])}, {((_this select 0) getvariable ["ACE_isDead", false])} ] call FUNC(addUnconsciousCondition); -}] call FUNC(addEventHandler); +}] call EFUNC(common,addEventHandler); // Prevent all types of interaction while unconscious // @todo: probably remove this when CBA keybind hold key works properly From e4c246984f559f2cfde3ed2ebb2e08822c440928 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 5 Sep 2015 14:10:04 +0200 Subject: [PATCH 124/132] Removed another debug trace that should not be there --- addons/medical/XEH_postInit.sqf | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/medical/XEH_postInit.sqf b/addons/medical/XEH_postInit.sqf index 97f5e64c44..7aae2bb231 100644 --- a/addons/medical/XEH_postInit.sqf +++ b/addons/medical/XEH_postInit.sqf @@ -259,7 +259,6 @@ if (USE_WOUND_EVENT_SYNC) then { ["SettingsInitialized", { if (GVAR(level) == 2) exitwith { - TRACE_6("ACE_DEBUG: SettingsInitialized_EH_ADVANCED",(_this select 0), GVAR(level),(_this select 0) getvariable QGVAR(bloodVolume),(_this select 0) getvariable QGVAR(pain), (_this select 0) getvariable QGVAR(painSuppress), [_this select 0] call FUNC(getBloodLoss)); [ {(((_this select 0) getvariable [QGVAR(bloodVolume), 100]) < 65)}, {(((_this select 0) getvariable [QGVAR(pain), 0]) - ((_this select 0) getvariable [QGVAR(painSuppress), 0])) > 0.9}, From 0a6b77b90232f3e35b85b61af76f45b13a5699ab Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 5 Sep 2015 14:10:28 +0200 Subject: [PATCH 125/132] Removed more deprecated wound sync code --- addons/medical/XEH_postInit.sqf | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/addons/medical/XEH_postInit.sqf b/addons/medical/XEH_postInit.sqf index 7aae2bb231..e6f7837e24 100644 --- a/addons/medical/XEH_postInit.sqf +++ b/addons/medical/XEH_postInit.sqf @@ -242,20 +242,6 @@ GVAR(lastHeartBeatSound) = ACE_time; }, 0, []] call CBA_fnc_addPerFrameHandler; -if (USE_WOUND_EVENT_SYNC) then { - // broadcast injuries to JIP clients in a MP session - if (isMultiplayer && hasInterface) then { - ["playerChanged", { - EXPLODE_2_PVT(_this,_newPlayer,_oldPlayer); - if (alive _newPlayer) then { - // We are only pulling the wounds for the units in the player group. Anything else will come when the unit interacts with them. - { - [_x, _newPlayer] call FUNC(requestWoundSync); - }foreach units group _newPlayer; - }; - }] call EFUNC(common,addEventhandler); - }; -}; ["SettingsInitialized", { if (GVAR(level) == 2) exitwith { From 27a0e8f63950b9c7fc92e253be2533542bb4588c Mon Sep 17 00:00:00 2001 From: TheMagnetar Date: Sat, 5 Sep 2015 16:30:00 +0200 Subject: [PATCH 126/132] Repair: Fix possible out of bounds setting Setting "engineerSetting_fullRepair" had an out of bounds default value. --- addons/repair/ACE_Settings.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/repair/ACE_Settings.hpp b/addons/repair/ACE_Settings.hpp index 9dbcd21731..fc3f063fb1 100644 --- a/addons/repair/ACE_Settings.hpp +++ b/addons/repair/ACE_Settings.hpp @@ -57,7 +57,7 @@ class ACE_Settings { displayName = CSTRING(engineerSetting_fullRepair_name); description = CSTRING(engineerSetting_fullRepair_description); typeName = "SCALAR"; - value = 3; + value = 2; values[] = {CSTRING(engineerSetting_anyone), CSTRING(engineerSetting_EngineerOnly), CSTRING(engineerSetting_RepairSpecialistOnly)}; category = ECSTRING(OptionsMenu,CategoryLogistics); }; From a8412361bdbde3a48bd929d0edae93d5f99a8855 Mon Sep 17 00:00:00 2001 From: jonpas Date: Sat, 5 Sep 2015 19:33:25 +0200 Subject: [PATCH 127/132] Use setting init delay function for addSpareParts --- addons/repair/XEH_postInit.sqf | 17 ----------------- addons/repair/XEH_preInit.sqf | 2 -- addons/repair/functions/fnc_addSpareParts.sqf | 6 ++---- 3 files changed, 2 insertions(+), 23 deletions(-) diff --git a/addons/repair/XEH_postInit.sqf b/addons/repair/XEH_postInit.sqf index 7095b0bfd0..44ca157b0c 100644 --- a/addons/repair/XEH_postInit.sqf +++ b/addons/repair/XEH_postInit.sqf @@ -5,20 +5,3 @@ // wheels ["setWheelHitPointDamage", {(_this select 0) setHitPointDamage [_this select 1, _this select 2]}] call EFUNC(common,addEventHandler); - -if (isServer) then { - ["SettingsInitialized", { - GVAR(settingInitted) = true; // Stop collecting in FUNC(addSpareParts) - - // Exit if adding spare parts disabled and clean collection - if (!GVAR(addSpareParts)) exitWith {GVAR(addSparePartsCollection) = nil}; - - // Add spare parts to vehicles in collection - { - [_x] call FUNC(addSpareParts); - } forEach GVAR(addSparePartsCollection); - - // Clean collection - GVAR(addSparePartsCollection) = nil; - }] call EFUNC(common,addEventHandler); -}; diff --git a/addons/repair/XEH_preInit.sqf b/addons/repair/XEH_preInit.sqf index c47b0b8011..f94c230f29 100644 --- a/addons/repair/XEH_preInit.sqf +++ b/addons/repair/XEH_preInit.sqf @@ -40,6 +40,4 @@ PREP(spawnObject); PREP(useItem); PREP(useItems); -GVAR(addSparePartsCollection) = []; - ADDON = true; diff --git a/addons/repair/functions/fnc_addSpareParts.sqf b/addons/repair/functions/fnc_addSpareParts.sqf index 6dfbb49bc0..4d3197c8e8 100644 --- a/addons/repair/functions/fnc_addSpareParts.sqf +++ b/addons/repair/functions/fnc_addSpareParts.sqf @@ -26,10 +26,8 @@ TRACE_2("params",_vehicle,_amount); if !(["ace_cargo"] call EFUNC(common,isModLoaded)) exitWith {}; // Collect until SettingsInitialized -if (isNil QGVAR(settingInitted)) exitWith { - if !(_vehicle in GVAR(addSparePartsCollection)) then { - GVAR(addSparePartsCollection) pushBack _vehicle; - }; +if (!EGVAR(common,settingsInitFinished)) exitWith { + EGVAR(common,runAtSettingsInitialized) pushBack [FUNC(addSpareParts), _this]; }; // Exit if not forced and add spare parts is disabled (after settings initted to make sure it really is) From 98202f4f381c27c81db278ef74b7dbd47fd297cd Mon Sep 17 00:00:00 2001 From: ViperMaul Date: Sat, 5 Sep 2015 15:31:14 -0700 Subject: [PATCH 128/132] Additional debug statements for caching and wounds. --- addons/medical/functions/fnc_adjustPainLevel.sqf | 2 +- addons/medical/functions/fnc_handleDamage_caching.sqf | 4 +++- addons/medical/functions/fnc_handleDamage_wounds.sqf | 2 ++ addons/medical/functions/fnc_handleDamage_woundsOld.sqf | 2 ++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/addons/medical/functions/fnc_adjustPainLevel.sqf b/addons/medical/functions/fnc_adjustPainLevel.sqf index c4aab9e48d..df82e06823 100644 --- a/addons/medical/functions/fnc_adjustPainLevel.sqf +++ b/addons/medical/functions/fnc_adjustPainLevel.sqf @@ -19,9 +19,9 @@ private ["_pain"]; params ["_unit", "_addedPain"]; - //Only run on local units: if (!local _unit) exitWith {ERROR("unit is not local");}; +TRACE_3("ACE_DEBUG: adjustPainLevel Called",_unit, _pain, _addedPain); //Ignore if medical system disabled: if (GVAR(level) == 0) exitWith {}; diff --git a/addons/medical/functions/fnc_handleDamage_caching.sqf b/addons/medical/functions/fnc_handleDamage_caching.sqf index 553c300631..41f93b954b 100644 --- a/addons/medical/functions/fnc_handleDamage_caching.sqf +++ b/addons/medical/functions/fnc_handleDamage_caching.sqf @@ -20,7 +20,7 @@ private ["_hitSelections", "_hitPoints", "_impactVelocity", "_newDamage", "_cache_hitpoints", "_cache_projectiles", "_cache_params", "_cache_damages"]; params ["_unit", "_selectionName", "_damage", "_source", "_projectile"]; - +TRACE_8("ACE_DEBUG: HandleDamage_Caching Called",_unit, _selectionName, _damage, _source, _projectile,GVAR(SELECTIONS),GVAR(HITPOINTS),damage _unit); _hitSelections = GVAR(SELECTIONS); _hitPoints = GVAR(HITPOINTS); @@ -150,4 +150,6 @@ if (_selectionName != "") then { _unit setVariable [QGVAR(cachedHandleDamageParams), _cache_params]; }; +TRACE_8("ACE_DEBUG: HandleDamage_Caching",_unit, _newDamage, _cache_params, _cache_damages, _unit getVariable QGVAR(cachedProjectiles), _unit getVariable QGVAR(cachedHitPoints), _unit getVariable QGVAR(cachedDamages), _unit getVariable QGVAR(cachedHandleDamageParams)); + _newDamage diff --git a/addons/medical/functions/fnc_handleDamage_wounds.sqf b/addons/medical/functions/fnc_handleDamage_wounds.sqf index 4438e9bb90..ae032e6d64 100644 --- a/addons/medical/functions/fnc_handleDamage_wounds.sqf +++ b/addons/medical/functions/fnc_handleDamage_wounds.sqf @@ -19,6 +19,7 @@ private ["_bodyPartn", "_injuryTypeInfo", "_allInjuriesForDamageType", "_allPossibleInjuries", "_highestPossibleDamage", "_highestPossibleSpot", "_minDamage", "_openWounds", "_woundID", "_toAddInjury", "_painToAdd", "_bloodLoss", "_bodyPartNToAdd", "_classType", "_damageLevels", "_foundIndex", "_i", "_injury", "_maxDamage", "_pain", "_painLevel", "_selections", "_toAddClassID", "_woundsCreated"]; params ["_unit", "_selectionName", "_damage", "_typeOfProjectile", "_typeOfDamage"]; +TRACE_6("ACE_DEBUG: HandleDamage Called",_unit, _selectionName, _damage, _shooter, _typeOfProjectile,_typeOfDamage); // Administration for open wounds and ids _openWounds = _unit getvariable[QGVAR(openWounds), []]; @@ -60,3 +61,4 @@ if (count _woundsCreated > 0) then { _painLevel = _unit getvariable [QGVAR(pain), 0]; _unit setvariable [QGVAR(pain), _painLevel + _painToAdd]; +TRACE_6("ACE_DEBUG: HandleDamage_WoundsOLD",_unit, _painLevel, _painToAdd, _unit getvariable QGVAR(pain), _unit getvariable QGVAR(openWounds),_woundsCreated); diff --git a/addons/medical/functions/fnc_handleDamage_woundsOld.sqf b/addons/medical/functions/fnc_handleDamage_woundsOld.sqf index cbc28dcca9..dc21012dd6 100644 --- a/addons/medical/functions/fnc_handleDamage_woundsOld.sqf +++ b/addons/medical/functions/fnc_handleDamage_woundsOld.sqf @@ -19,6 +19,7 @@ private ["_bodyPartn", "_injuryTypeInfo", "_allInjuriesForDamageType", "_allPossibleInjuries", "_highestPossibleDamage", "_highestPossibleSpot", "_minDamage", "_openWounds", "_woundID", "_toAddInjury", "_painToAdd", "_bloodLoss", "_bodyPartNToAdd", "_classType", "_damageLevels", "_foundIndex", "_i", "_injury", "_maxDamage", "_pain", "_painLevel", "_selections", "_toAddClassID", "_woundsCreated"]; params ["_unit", "_selectionName", "_damage", "_typeOfProjectile", "_typeOfDamage"]; +TRACE_6("ACE_DEBUG: HandleDamage_WoundsOLD Called",_unit, _selectionName, _damage, _shooter, _typeOfProjectile,_typeOfDamage); // Convert the selectionName to a number and ensure it is a valid selection. _bodyPartn = [_selectionName] call FUNC(selectionNameToNumber); @@ -130,3 +131,4 @@ if (count _woundsCreated > 0) then { _painLevel = _unit getvariable [QGVAR(pain), 0]; _unit setvariable [QGVAR(pain), _painLevel + _painToAdd]; +TRACE_6("ACE_DEBUG: HandleDamage_WoundsOLD",_unit, _painLevel, _painToAdd, _unit getvariable QGVAR(pain), _unit getvariable QGVAR(openWounds),_woundsCreated); From adb1a1121111583683bb177e4a83fc6d7b4b739c Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 6 Sep 2015 11:49:08 +0200 Subject: [PATCH 129/132] increase leg and arm armor value, more TRACE debug --- addons/medical/CfgVehicles.hpp | 4 ++-- addons/medical/functions/fnc_handleDamage.sqf | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/addons/medical/CfgVehicles.hpp b/addons/medical/CfgVehicles.hpp index 7112c82fc5..4e73e77ee1 100644 --- a/addons/medical/CfgVehicles.hpp +++ b/addons/medical/CfgVehicles.hpp @@ -426,8 +426,8 @@ class CfgVehicles { }; }; - #define ARM_LEG_ARMOR_DEFAULT 2 - #define ARM_LEG_ARMOR_BETTER 4 + #define ARM_LEG_ARMOR_DEFAULT 3 + #define ARM_LEG_ARMOR_BETTER 5 #define ARM_LEG_ARMOR_CSAT 4 class Land; diff --git a/addons/medical/functions/fnc_handleDamage.sqf b/addons/medical/functions/fnc_handleDamage.sqf index fe06a47e9a..1a58e2ed01 100644 --- a/addons/medical/functions/fnc_handleDamage.sqf +++ b/addons/medical/functions/fnc_handleDamage.sqf @@ -1,4 +1,4 @@ -/* + /* * Author: KoffeinFlummi, Glowbal, commy2 * Main HandleDamage EH function. * @@ -33,7 +33,7 @@ if (typeName _projectile == "OBJECT") then { _this set [4, _projectile]; }; -TRACE_3("ACE_DEBUG: HandleDamage",_selection,_damage, _unit); +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"}; @@ -44,7 +44,7 @@ if (_selection != "" && {!(_selection in GVAR(SELECTIONS))}) exitWith {0}; //@to // Exit if we disable damage temporarily if !(_unit getVariable [QGVAR(allowDamage), true]) exitWith { - TRACE_3("ACE_DEBUG: HandleDamage damage disabled.",_selection,damage _unit, _unit); + TRACE_3("ACE_DEBUG: HandleDamage damage disabled.",_selection,damage _unit,_unit); if (_selection == "") then { damage _unit } else { @@ -59,6 +59,8 @@ _newDamage = _this call FUNC(handleDamage_caching); // handleDamage_caching may have modified the projectile string _typeOfDamage = [_projectile] call FUNC(getTypeOfDamage); +TRACE_3("ACE_DEBUG: HandleDamage caching new damage",_selection,_newDamage,_unit); + _typeIndex = (GVAR(allAvailableDamageTypes) find _typeOfDamage); _minLethalDamage = if (_typeIndex >= 0) then { GVAR(minLethalDamages) select _typeIndex @@ -126,4 +128,6 @@ if (((_unit getVariable [QGVAR(enableRevive), GVAR(enableRevive)]) > 0) && {_dam 0.89; }; +TRACE_3("ACE_DEBUG: HandleDamage damage return",_selection,_damageReturn,_unit); + _damageReturn From ad8660c989136521340c82fdbaab068af1540d77 Mon Sep 17 00:00:00 2001 From: Felix Wiegand Date: Mon, 7 Sep 2015 00:44:15 +0200 Subject: [PATCH 130/132] Add slack badge to README --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 755eaceb30..5141e05796 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,9 @@ ACE3 License + + ACE3 License +

Requires the latest version of CBA A3. Visit us on Facebook | YouTube | Twitter | Reddit

From fe99cf83b3e65f7e23f2dc5871edf6a66baf9738 Mon Sep 17 00:00:00 2001 From: Felix Wiegand Date: Mon, 7 Sep 2015 00:50:22 +0200 Subject: [PATCH 131/132] Change alt text on slack badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5141e05796..5630ea8819 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ ACE3 License - ACE3 License + ACE3 Slack

Requires the latest version of CBA A3. Visit us on Facebook | YouTube | Twitter | Reddit

From 2fc35338d5e80a14eed077e360717a4669eabaa1 Mon Sep 17 00:00:00 2001 From: ViperMaul Date: Sun, 6 Sep 2015 21:37:20 -0700 Subject: [PATCH 132/132] Build number for Release Candidate --- addons/main/script_mod.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/main/script_mod.hpp b/addons/main/script_mod.hpp index e38e71ac4b..9f5de69921 100644 --- a/addons/main/script_mod.hpp +++ b/addons/main/script_mod.hpp @@ -5,7 +5,7 @@ #define MAJOR 3 #define MINOR 2 -#define PATCHLVL 2 +#define PATCHLVL 3 #define BUILD 0 #define VERSION MAJOR.MINOR.PATCHLVL.BUILD