Merge branch 'master' into release-3.12.2

This commit is contained in:
PabstMirror
2018-04-12 10:59:46 -05:00
30 changed files with 77 additions and 108 deletions

View File

@ -58,4 +58,6 @@ GVAR(modList) = ["","curator","kart","heli","mark","expansion","expansionpremium
_this call FUNC(handleStats); _this call FUNC(handleStats);
}] call CBA_fnc_addEventHandler; }] call CBA_fnc_addEventHandler;
call FUNC(compileStats);
ADDON = true; ADDON = true;

View File

@ -339,27 +339,27 @@ _buttonCurrentMag2Ctrl ctrlCommit FADE_DELAY;\
] ]
#define CHECK_WEAPON_OR_ACC\ #define CHECK_WEAPON_OR_ACC\
_item in (_weaponsArray select 0) ||\ (_weaponsArray select 0) findIf {_x == _item} > -1 ||\
{_item in (_weaponsArray select 1)} ||\ {(_weaponsArray select 1) findIf {_x == _item} > -1} ||\
{_item in (_weaponsArray select 2)} ||\ {(_weaponsArray select 2) findIf {_x == _item} > -1} ||\
{_item in (GVAR(virtualItems) select 9)} ||\ {(GVAR(virtualItems) select 9) findIf {_x == _item} > -1} ||\
{_item in (_accsArray select 0)} ||\ {(_accsArray select 0) findIf {_x == _item} > -1} ||\
{_item in (_accsArray select 1)} ||\ {(_accsArray select 1 findIf {_x == _item} > -1)} ||\
{_item in (_accsArray select 2)} ||\ {(_accsArray select 2) findIf {_x == _item} > -1} ||\
{_item in (_accsArray select 3)} {(_accsArray select 3) findIf {_x == _item} > -1}
#define CHECK_ASSIGNED_ITEMS\ #define CHECK_ASSIGNED_ITEMS\
_item in (GVAR(virtualItems) select 10) ||\ (GVAR(virtualItems) select 10) findIf {_x == _item} > -1 ||\
{_item in (GVAR(virtualItems) select 11)} ||\ {(GVAR(virtualItems) select 11) findIf {_x == _item} > -1} ||\
{_item in (GVAR(virtualItems) select 12)} ||\ {(GVAR(virtualItems) select 12) findIf {_x == _item} > -1} ||\
{_item in (GVAR(virtualItems) select 13)} ||\ {(GVAR(virtualItems) select 13) findIf {_x == _item} > -1} ||\
{_item in (GVAR(virtualItems) select 14)} ||\ {(GVAR(virtualItems) select 14) findIf {_x == _item} > -1} ||\
{_item in (GVAR(virtualItems) select 8)} {(GVAR(virtualItems) select 8) findIf {_x == _item} > -1}
#define CHECK_CONTAINER\ #define CHECK_CONTAINER\
_item in (GVAR(virtualItems) select 4) ||\ (GVAR(virtualItems) select 4) findIf {_x == _item} > -1 ||\
{_item in (GVAR(virtualItems) select 5)} ||\ {(GVAR(virtualItems) select 5) findIf {_x == _item} > -1} ||\
{_item in (GVAR(virtualItems) select 6)} {(GVAR(virtualItems) select 6) findIf {_x == _item} > -1}
#define CLASS_CHECK_ITEM\ #define CLASS_CHECK_ITEM\
isClass (_weaponCfg >> _item) ||\ isClass (_weaponCfg >> _item) ||\
@ -368,24 +368,24 @@ _buttonCurrentMag2Ctrl ctrlCommit FADE_DELAY;\
{isClass (_magCfg >> _item)} {isClass (_magCfg >> _item)}
#define CHECK_CONTAINER_ITEMS\ #define CHECK_CONTAINER_ITEMS\
_item in (GVAR(virtualItems) select 3) ||\ (GVAR(virtualItems) select 3) findIf {_x == _item} > -1 ||\
{_item in (_accsArray select 0)} ||\ {(_accsArray select 0) findIf {_x == _item} > -1} ||\
{_item in (_accsArray select 1)} ||\ {(_accsArray select 1) findIf {_x == _item} > -1} ||\
{_item in (_accsArray select 2)} ||\ {(_accsArray select 2) findIf {_x == _item} > -1} ||\
{_item in (_accsArray select 3)} ||\ {(_accsArray select 3) findIf {_x == _item} > -1} ||\
{_item in (GVAR(virtualItems) select 4)} ||\ {(GVAR(virtualItems) select 4) findIf {_x == _item} > -1} ||\
{_item in (GVAR(virtualItems) select 5)} ||\ {(GVAR(virtualItems) select 5) findIf {_x == _item} > -1} ||\
{_item in (GVAR(virtualItems) select 6)} ||\ {(GVAR(virtualItems) select 6) findIf {_x == _item} > -1} ||\
{_item in (GVAR(virtualItems) select 7)} ||\ {(GVAR(virtualItems) select 7) findIf {_x == _item} > -1} ||\
{_item in (GVAR(virtualItems) select 8)} ||\ {(GVAR(virtualItems) select 8) findIf {_x == _item} > -1} ||\
{_item in (GVAR(virtualItems) select 10)} ||\ {(GVAR(virtualItems) select 10) findIf {_x == _item} > -1} ||\
{_item in (GVAR(virtualItems) select 11)} ||\ {(GVAR(virtualItems) select 11) findIf {_x == _item} > -1} ||\
{_item in (GVAR(virtualItems) select 12)} ||\ {(GVAR(virtualItems) select 12) findIf {_x == _item} > -1} ||\
{_item in (GVAR(virtualItems) select 13)} ||\ {(GVAR(virtualItems) select 13) findIf {_x == _item} > -1} ||\
{_item in (GVAR(virtualItems) select 14)} ||\ {(GVAR(virtualItems) select 14) findIf {_x == _item} > -1} ||\
{_item in (GVAR(virtualItems) select 15)} ||\ {(GVAR(virtualItems) select 15) findIf {_x == _item} > -1} ||\
{_item in (GVAR(virtualItems) select 16)} ||\ {(GVAR(virtualItems) select 16) findIf {_x == _item} > -1} ||\
{_item in (GVAR(virtualItems) select 17)} {(GVAR(virtualItems) select 17) findIf {_x == _item} > -1}
#define ADD_LOADOUTS_LIST_PICTURES\ #define ADD_LOADOUTS_LIST_PICTURES\
_contentPanelCtrl lnbSetPicture [[_newRow, 2], getText (configFile >> "cfgWeapons" >> ((_loadout select 0) select 0) >> "picture")];\ _contentPanelCtrl lnbSetPicture [[_newRow, 2], getText (configFile >> "cfgWeapons" >> ((_loadout select 0) select 0) >> "picture")];\

View File

@ -54,6 +54,7 @@ _statements params [
]; ];
call FUNC(compileStats); call FUNC(compileStats);
private _returnArray = []; private _returnArray = [];
private _fnc_addToTabs = { private _fnc_addToTabs = {

View File

@ -14,10 +14,6 @@
#include "script_component.hpp" #include "script_component.hpp"
#include "..\defines.hpp" #include "..\defines.hpp"
#ifdef ENABLE_PERF_PROFILING
private _scopeFillLeftPanel = createProfileScope QFUNC(fillLeftPanel);
#endif
params ["_display", "_control"]; params ["_display", "_control"];
private _ctrlIDC = ctrlIDC _control; private _ctrlIDC = ctrlIDC _control;

View File

@ -14,10 +14,6 @@
#include "script_component.hpp" #include "script_component.hpp"
#include "..\defines.hpp" #include "..\defines.hpp"
#ifdef ENABLE_PERF_PROFILING
private _scopeFillRightPanel = createProfileScope QFUNC(fillRightPanel);
#endif
params ["_display", "_control"]; params ["_display", "_control"];
private _ctrlIDC = ctrlIDC _control; private _ctrlIDC = ctrlIDC _control;

View File

@ -44,11 +44,6 @@ if (count _LMB > 0) then {
_helperPos set [2,(_helperPos select 2) max ((boundingboxreal GVAR(center) select 0 select 2) + 0.2)]; _helperPos set [2,(_helperPos select 2) max ((boundingboxreal GVAR(center) select 0 select 2) + 0.2)];
//--- Do not let target go below ground
private _posZmin = 0.1;
private _targetWorldPosZ = (GVAR(center) modeltoworldvisual _helperPos) select 2;
if (_targetWorldPosZ < _posZmin) then {_helperPos set [2,(_helperPos select 2) - _targetWorldPosZ + _posZmin];};
GVAR(cameraPosition) set [3,_helperPos]; GVAR(cameraPosition) set [3,_helperPos];
}; };

View File

@ -16,10 +16,6 @@
#include "script_component.hpp" #include "script_component.hpp"
#include "..\defines.hpp" #include "..\defines.hpp"
#ifdef ENABLE_PERF_PROFILING
private _scopeHandleStats = createProfileScope QFUNC(handleStats);
#endif
params ["_display", "_control", "_curSel", "_itemCfg"]; params ["_display", "_control", "_curSel", "_itemCfg"];
private _statsBoxCtrl = _display displayCtrl IDC_statsBox; private _statsBoxCtrl = _display displayCtrl IDC_statsBox;
@ -50,7 +46,6 @@ private _hideUnusedFnc = {
} forEach _numbers; } forEach _numbers;
}; };
call FUNC(compileStats);
if !(isNil "_itemCfg") then { if !(isNil "_itemCfg") then {
private _handleStatsFnc = { private _handleStatsFnc = {

View File

@ -16,10 +16,6 @@
#include "script_component.hpp" #include "script_component.hpp"
#include "..\defines.hpp" #include "..\defines.hpp"
#ifdef ENABLE_PERF_PROFILING
private _scopeItemInfo = createProfileScope QFUNC(itemInfo);
#endif
params ["_display", "_control", "_curSel" ,"_itemCfg"]; params ["_display", "_control", "_curSel" ,"_itemCfg"];
private _ctrlInfo = _display displayCtrl IDC_infoBox; private _ctrlInfo = _display displayCtrl IDC_infoBox;

View File

@ -15,11 +15,6 @@
#include "script_component.hpp" #include "script_component.hpp"
#include "..\defines.hpp" #include "..\defines.hpp"
#ifdef ENABLE_PERF_PROFILING
private _scopeArsenal = createProfileScope QFUNC(onArsenalOpen);
profilerTrigger;
#endif
params ["", "_args"]; params ["", "_args"];
_args params ["_display"]; _args params ["_display"];

View File

@ -14,10 +14,6 @@
#include "script_component.hpp" #include "script_component.hpp"
#include "..\defines.hpp" #include "..\defines.hpp"
#ifdef ENABLE_PERF_PROFILING
private _scopeOnSelChangedLeft = createProfileScope QFUNC(onSelChangedLeft);
#endif
params ["_control", "_curSel"]; params ["_control", "_curSel"];
if (_curSel < 0) exitwith {}; if (_curSel < 0) exitwith {};

View File

@ -14,10 +14,6 @@
#include "script_component.hpp" #include "script_component.hpp"
#include "..\defines.hpp" #include "..\defines.hpp"
#ifdef ENABLE_PERF_PROFILING
private _scopeOnSelChangedRight = createProfileScope QFUNC(onSelChangedRight);
#endif
params ["_control", "_curSel"]; params ["_control", "_curSel"];
if (_curSel < 0) exitwith {}; if (_curSel < 0) exitwith {};

View File

@ -14,10 +14,6 @@
#include "script_component.hpp" #include "script_component.hpp"
#include "..\defines.hpp" #include "..\defines.hpp"
#ifdef ENABLE_PERF_PROFILING
private _scopeOnSelChangedRightLNB = createProfileScope QFUNC(onSelChangedRightListnBox);
#endif
params ["_control", "_curSel"]; params ["_control", "_curSel"];
if (_curSel < 0) exitwith {}; if (_curSel < 0) exitwith {};

View File

@ -13,10 +13,6 @@
#include "script_component.hpp" #include "script_component.hpp"
#include "..\defines.hpp" #include "..\defines.hpp"
#ifdef ENABLE_PERF_PROFILING
private _scopeShowItem = createProfileScope QFUNC(showItem);
#endif
if (GVAR(centerNotPlayer)) exitWith {}; if (GVAR(centerNotPlayer)) exitWith {};
private _nextAction = switch (GVAR(currentLeftPanel)) do { private _nextAction = switch (GVAR(currentLeftPanel)) do {

View File

@ -14,10 +14,6 @@
#include "script_component.hpp" #include "script_component.hpp"
#include "..\defines.hpp" #include "..\defines.hpp"
#ifdef ENABLE_PERF_PROFILING
private _scopeSortPanel = createProfileScope QFUNC(sortPanel);
#endif
params ["_control", "_mode"]; params ["_control", "_mode"];
private _display = ctrlParent _control; private _display = ctrlParent _control;

View File

@ -19,9 +19,3 @@ GVAR(cameraHelper) attachTo [GVAR(center), GVAR(cameraPosition) select 3, ""]; /
GVAR(camera) setPos (GVAR(cameraHelper) modelToWorld [0, -_distance, 0]); GVAR(camera) setPos (GVAR(cameraHelper) modelToWorld [0, -_distance, 0]);
GVAR(camera) setVectorDirAndUp [vectorDir GVAR(cameraHelper), vectorUp GVAR(cameraHelper)]; GVAR(camera) setVectorDirAndUp [vectorDir GVAR(cameraHelper), vectorUp GVAR(cameraHelper)];
//--- Make sure the camera is not underground
if ((getPosAsl GVAR(camera) select 2) < (getPosAsl GVAR(center) select 2)) then {
private _disCoef = ((getPosAsl GVAR(cameraHelper) select 2) - (getPosAsl GVAR(center) select 2)) / ((getPosAsl GVAR(cameraHelper) select 2) - (getPosAsl GVAR(camera) select 2) + 0.001);
GVAR(camera) setPos (GVAR(cameraHelper) modelToWorldVisual [0, -_distance * _disCoef, 0]);
};

View File

@ -14,10 +14,6 @@
#include "script_component.hpp" #include "script_component.hpp"
#include "..\defines.hpp" #include "..\defines.hpp"
#ifdef ENABLE_PERF_PROFILING
private _scopeUpdateRightPanel = createProfileScope QFUNC(updateRightPanel);
#endif
params ["_control", "_maxLoad"]; params ["_control", "_maxLoad"];
private _loadIndicatorBarCtrl = _display displayCtrl IDC_loadIndicatorBar; private _loadIndicatorBarCtrl = _display displayCtrl IDC_loadIndicatorBar;

View File

@ -5,7 +5,6 @@
// #define DEBUG_MODE_FULL // #define DEBUG_MODE_FULL
// #define DISABLE_COMPILE_CACHE // #define DISABLE_COMPILE_CACHE
// #define ENABLE_PERFORMANCE_COUNTERS // #define ENABLE_PERFORMANCE_COUNTERS
// #define ENABLE_PERF_PROFILING // This requires https://forums.bohemia.net/forums/topic/211626-arma-script-profiler/ do not uncomment otherwise.
#ifdef DEBUG_ENABLED_ARSENAL #ifdef DEBUG_ENABLED_ARSENAL
#define DEBUG_MODE_FULL #define DEBUG_MODE_FULL

View File

@ -559,6 +559,7 @@ class GVAR(display) {
y = QUOTE(safezoneY + 1.8 * GRID_H); y = QUOTE(safezoneY + 1.8 * GRID_H);
w = QUOTE(74 * GRID_W); w = QUOTE(74 * GRID_W);
h = QUOTE(6 * GRID_H); h = QUOTE(6 * GRID_H);
sizeEx = QUOTE(6 * GRID_H);
}; };
class leftSearchbarButton: ctrlButtonPicture { class leftSearchbarButton: ctrlButtonPicture {
idc = IDC_leftSearchbarButton; idc = IDC_leftSearchbarButton;
@ -987,6 +988,7 @@ class GVAR(loadoutsDisplay) {
y = QUOTE(safezoneH - (51 * GRID_H)); y = QUOTE(safezoneH - (51 * GRID_H));
w = QUOTE(65 * GRID_W); w = QUOTE(65 * GRID_W);
h = QUOTE(5 * GRID_H); h = QUOTE(5 * GRID_H);
sizeEx = QUOTE(6 * GRID_H);
}; };
class loadoutsSearchbar: ctrlEdit { class loadoutsSearchbar: ctrlEdit {
idc = IDC_loadoutsSearchbar; idc = IDC_loadoutsSearchbar;
@ -997,6 +999,7 @@ class GVAR(loadoutsDisplay) {
y = QUOTE(safezoneH - (51 * GRID_H)); y = QUOTE(safezoneH - (51 * GRID_H));
w = QUOTE(72 * GRID_W); w = QUOTE(72 * GRID_W);
h = QUOTE(5 * GRID_H); h = QUOTE(5 * GRID_H);
sizeEx = QUOTE(6 * GRID_H);
}; };
class loadoutsSearchbarButton: ctrlButtonPicture { class loadoutsSearchbarButton: ctrlButtonPicture {
idc = -1; idc = -1;

View File

@ -22,5 +22,5 @@ private _deployedRopes = _vehicle getVariable [QGVAR(deployedRopes), []];
((driver _vehicle != _unit) && ((driver _vehicle != _unit) &&
{!(_deployedRopes isEqualTo [])} && {!(_deployedRopes isEqualTo [])} &&
{{!(_x select 5)} count (_deployedRopes) > 0} && {{!(_x select 5) && !(_x select 6)} count (_deployedRopes) > 0} &&
{getPos _vehicle select 2 > 2}) {getPos _vehicle select 2 > 2})

View File

@ -45,8 +45,8 @@ private _hookAttachment = _vehicle getVariable [QGVAR(FRIES), _vehicle];
_ropeTop addEventHandler ["RopeBreak", {[_this, "top"] call FUNC(onRopeBreak)}]; _ropeTop addEventHandler ["RopeBreak", {[_this, "top"] call FUNC(onRopeBreak)}];
_ropeBottom addEventHandler ["RopeBreak", {[_this, "bottom"] call FUNC(onRopeBreak)}]; _ropeBottom addEventHandler ["RopeBreak", {[_this, "bottom"] call FUNC(onRopeBreak)}];
//deployedRopes format: attachment point, top part of the rope, bottom part of the rope, attachTo helper object, occupied //deployedRopes format: attachment point, top part of the rope, bottom part of the rope, attachTo helper object, occupied, broken
_deployedRopes pushBack [_ropeOrigin, _ropeTop, _ropeBottom, _dummy, _hook, false]; _deployedRopes pushBack [_ropeOrigin, _ropeTop, _ropeBottom, _dummy, _hook, false, false];
false false
} count _ropeOrigins; } count _ropeOrigins;

View File

@ -23,7 +23,7 @@ private _deployedRopes = _vehicle getVariable [QGVAR(deployedRopes), []];
private _usableRope = _deployedRopes select 0; private _usableRope = _deployedRopes select 0;
private _usableRopeIndex = 0; private _usableRopeIndex = 0;
{ {
if !(_x select 5) exitWith { if (!(_x select 5) && !(_x select 6)) exitWith {
_usableRope = _x; _usableRope = _x;
_usableRopeIndex = _forEachIndex; _usableRopeIndex = _forEachIndex;
}; };

View File

@ -85,7 +85,7 @@ if (
//Update deployedRopes array //Update deployedRopes array
private _deployedRopes = _vehicle getVariable [QGVAR(deployedRopes), []]; private _deployedRopes = _vehicle getVariable [QGVAR(deployedRopes), []];
_deployedRopes set [_ropeIndex, [_attachmentPoint, _ropeTop, _ropeBottom, _dummy, _hook, false]]; _deployedRopes set [_ropeIndex, [_attachmentPoint, _ropeTop, _ropeBottom, _dummy, _hook, false, false]];
_vehicle setVariable [QGVAR(deployedRopes), _deployedRopes, true]; _vehicle setVariable [QGVAR(deployedRopes), _deployedRopes, true];
[_pfhHandle] call CBA_fnc_removePerFrameHandler; [_pfhHandle] call CBA_fnc_removePerFrameHandler;

View File

@ -36,7 +36,7 @@ private _brokenRope = [];
_brokenRope = _x; _brokenRope = _x;
}; };
} forEach _deployedRopes; } forEach _deployedRopes;
_brokenRope set [5, true]; _brokenRope set [6, true];
_vehicle setVariable [QGVAR(deployedRopes), _deployedRopes, true]; _vehicle setVariable [QGVAR(deployedRopes), _deployedRopes, true];
private _unit = { private _unit = {

View File

@ -24,4 +24,22 @@ PREP_RECOMPILE_END;
}, _this] call CBA_fnc_execNextFrame; }, _this] call CBA_fnc_execNextFrame;
}] call CBA_fnc_addClassEventHandler; }] call CBA_fnc_addClassEventHandler;
[QEGVAR(arsenal,displayOpened), {
private _center = EGVAR(arsenal,center);
if (_center call FUNC(hasGunBag)) then {
GVAR(arsenalCache) = (backpackContainer _center) getVariable [QGVAR(gunbagWeapon), []];
};
}] call CBA_fnc_addEventHandler;
[QEGVAR(arsenal,displayClosed), {
if !(isNil QGVAR(arsenalCache)) then {
(backpackContainer EGVAR(arsenal,center)) setVariable [QGVAR(gunbagWeapon),GVAR(arsenalCache), true];
};
GVAR(arsenalCache) = nil;
}] call CBA_fnc_addEventHandler;
ADDON = true; ADDON = true;

View File

@ -64,6 +64,6 @@ addMissionEventHandler ["Draw3D", {
_output pushBack format ["%1: %2[%3] = %4", _forEachIndex, _hitPoint, _selection, cursorObject getHitIndex _forEachIndex]; _output pushBack format ["%1: %2[%3] = %4", _forEachIndex, _hitPoint, _selection, cursorObject getHitIndex _forEachIndex];
_output pushBack format ["- %1 -",_info]; _output pushBack format ["- %1 -",_info];
}; };
} forEach _hitPoints; } forEach _hitSelections;
hintSilent (_output joinString "\n"); hintSilent (_output joinString "\n");
}]; }];

View File

@ -28,7 +28,7 @@ private _initializedClasses = GETMVAR(GVAR(initializedClasses),[]);
if (_type in _initializedClasses) exitWith {}; if (_type in _initializedClasses) exitWith {};
// get all hitpoints and selections // get all hitpoints and selections
(getAllHitPointsDamage _vehicle) params [["_hitPoints", []], ["_hitSelections", []]]; (getAllHitPointsDamage _vehicle) params [["_hitPoints", []], ["_hitSelections", []]]; // Since 1.82 these are all lower case
// get hitpoints of wheels with their selections // get hitpoints of wheels with their selections
([_vehicle] call FUNC(getWheelHitPointsWithSelections)) params ["_wheelHitPoints", "_wheelHitSelections"]; ([_vehicle] call FUNC(getWheelHitPointsWithSelections)) params ["_wheelHitPoints", "_wheelHitSelections"];
@ -41,7 +41,7 @@ private _icon = QPATHTOF(ui\repair_0_ca.paa);
{ {
private _selection = _x; private _selection = _x;
private _hitpoint = _hitPoints select _forEachIndex; private _hitpoint = toLower (_hitPoints select _forEachIndex);
if (_selection in _wheelHitSelections) then { if (_selection in _wheelHitSelections) then {
// Wheels should always be unique // Wheels should always be unique
@ -68,7 +68,7 @@ private _icon = QPATHTOF(ui\repair_0_ca.paa);
[_type, 0, [], _action] call EFUNC(interact_menu,addActionToClass); [_type, 0, [], _action] call EFUNC(interact_menu,addActionToClass);
} else { } else {
//Skip glass hitpoints //Skip glass hitpoints
if (((toLower _hitPoint) find "glass") != -1) exitWith { if ((_hitPoint find "glass") != -1) exitWith {
TRACE_3("Skipping Glass",_hitpoint,_forEachIndex,_selection); TRACE_3("Skipping Glass",_hitpoint,_forEachIndex,_selection);
}; };
// Empty selections don't exist // Empty selections don't exist

View File

@ -36,9 +36,10 @@ if (isArray _hitpointGroupConfig) then {
// Exit using found hitpoint group if this hitpoint is leader of any // Exit using found hitpoint group if this hitpoint is leader of any
if (_masterHitpoint == _hitPointClassname) exitWith { if (_masterHitpoint == _hitPointClassname) exitWith {
{ {
private _subHitIndex = _allHitPoints find _x; private _subHitpoint = _x;
private _subHitIndex = _allHitPoints findIf {_x == _subHitpoint};
if (_subHitIndex == -1) then { if (_subHitIndex == -1) then {
ERROR("Hitpoint Not Found"); ERROR_2("Invalid hitpoint %1 in hitpointGroups of %2",_subHitpoint,_target);
} else { } else {
_hitpointGroup pushBack _subHitIndex; _hitpointGroup pushBack _subHitIndex;
}; };

View File

@ -47,9 +47,10 @@ if (isArray _hitpointGroupConfig) then {
// Exit using found hitpoint group if this hitpoint is leader of any // Exit using found hitpoint group if this hitpoint is leader of any
if (_masterHitpoint == _hitPointClassname) exitWith { if (_masterHitpoint == _hitPointClassname) exitWith {
{ {
private _subHitIndex = _allHitPoints find _x; //convert hitpoint classname to index private _subHitpoint = _x;
private _subHitIndex = _allHitPoints findIf {_x == _subHitpoint}; //convert hitpoint classname to index
if (_subHitIndex == -1) then { if (_subHitIndex == -1) then {
ERROR_2("Invalid hitpoint %1 in hitpointGroups of %2",_x,_vehicle); ERROR_2("Invalid hitpoint %1 in hitpointGroups of %2",_subHitpoint,_vehicle);
} else { } else {
private _subPointCurDamage = _vehicle getHitIndex _hitPointIndex; private _subPointCurDamage = _vehicle getHitIndex _hitPointIndex;
private _subPointNewDamage = (_subPointCurDamage - 0.5) max _postRepairDamageMin; private _subPointNewDamage = (_subPointCurDamage - 0.5) max _postRepairDamageMin;

View File

@ -16,4 +16,4 @@
#include "\z\ace\addons\main\script_macros.hpp" #include "\z\ace\addons\main\script_macros.hpp"
#define TRACK_HITPOINTS ["HitLTrack", "HitRTrack"] #define TRACK_HITPOINTS ["hitltrack", "hitrtrack"]

View File

@ -29,6 +29,7 @@ switch (true) do {
[LSTRING(OnlyAlive)] call FUNC(showMessage); [LSTRING(OnlyAlive)] call FUNC(showMessage);
}; };
default { default {
[_object, true] call EFUNC(arsenal,removeBox);
[_object, true, true] call EFUNC(arsenal,initBox); [_object, true, true] call EFUNC(arsenal,initBox);
}; };
}; };