This commit is contained in:
SzwedzikPL 2016-01-14 16:17:17 +01:00
commit 9631475685
428 changed files with 3628 additions and 2977 deletions

View File

@ -1,6 +1,7 @@
branches: branches:
only: only:
- master - master
- release
language: python language: python
python: python:
- '3.4' - '3.4'
@ -19,12 +20,10 @@ env:
- secure: KcJQbknBOdC5lA4nFGKPXVRVIGLDXDRzC8XkHuXJCE9pIR/wbxbkvx8fHKcC6SC9eHgzneC3+o4m4+CjIbVvIwDgslRbJ8Y59i90ncONmdoRx1HUYHwuYWVZm9HJFjCsIbrEqhSyyKS+PB3WZVOLbErtNHsgS8f43PTh5Ujg7Vg= - secure: KcJQbknBOdC5lA4nFGKPXVRVIGLDXDRzC8XkHuXJCE9pIR/wbxbkvx8fHKcC6SC9eHgzneC3+o4m4+CjIbVvIwDgslRbJ8Y59i90ncONmdoRx1HUYHwuYWVZm9HJFjCsIbrEqhSyyKS+PB3WZVOLbErtNHsgS8f43PTh5Ujg7Vg=
notifications: notifications:
slack: slack:
secure: aWYF/YX7vxEdXJ5w1jhYJQ2TtTP2NRdnXzJDMYXTv2dlXYhO9qp2qjxDGW3dezuPY7B1mPBgebfSKRx3Robkt1rAfEwPWivOiEztL30rwzOy+5Q1wpORv1JkvTC/q2wqQzxQCU/FPVjD2GkF1wtq1Rnx3ESWD8gbvzYoMNdIw1g=
on_success: change
on_failure: always
on_start: never
rooms: rooms:
secure: MvxmqL1NGwiGTVv6uIVTM7jeNLQH95KYtTgSWlXaSw4jdjnf4cmrb/ofHQ3FHhhNVdhRN6W8n0cJfTC3DBZ90bionVh+528qw2mDnDbKljVdIwmoFSexBcH7H1uTLF3gsEz0tbrHtLcnAyTMxdjsdIXDLZ5hwxABNmW5/03jOgs= - secure: byZMNBl8PMlgjT9NA1WmhgCdGfX4b3g1kA0vEiwfm+IFNlx7BiM4J/5rp6zV/jV470xl/epAejx2tsa5SdTyFbO87NH63ILJSt5QnjUZjRuGKSutFs9WE671DtZkPRSJXHS4N6x802PRkyBz/84/lsc34FWvHvjwOuYAtOcJRFk=
- secure: V22TNaLWV+yUNWqR7c6HVvIxkRDz7Dyz9xqa43FY8iFgvNL4Q/X69h5DYHU/ILNFM00tx8OBjtPRbcjWQ+F6eY8Sje/A2axJAU+qNurAvoyiTahXUprdUUpPdkgXWuSRTZ9kALxOq5e11RC8XUietghoMcl8zPcqdrZCOOKgoEM=
on_success: change
email: email:
on_success: never on_success: never
on_failure: change on_failure: change

View File

@ -54,7 +54,7 @@ Crusty
Dharma Bellamkonda <dharma.bellamkonda@gmail.com> Dharma Bellamkonda <dharma.bellamkonda@gmail.com>
Dimaslg <dimaslg@telecable.es> Dimaslg <dimaslg@telecable.es>
Drill <drill87@gmail.com> Drill <drill87@gmail.com>
Dudakov <dudakov.s@gmail.com> Dudakov aka [OMCB]Kaban <dudakov.s@gmail.com>
Dslyecxi <dslyecxi@gmail.com> Dslyecxi <dslyecxi@gmail.com>
eRazeri eRazeri
evromalarkey <evromalarkey@gmail.com> evromalarkey <evromalarkey@gmail.com>

View File

@ -4,9 +4,9 @@
<p align="center"> <p align="center">
<a href="https://github.com/acemod/ACE3/releases"> <a href="https://github.com/acemod/ACE3/releases">
<img src="https://img.shields.io/badge/Version-3.4.0-blue.svg?style=flat-square" alt="ACE3 Version"> <img src="https://img.shields.io/badge/Version-3.4.2-blue.svg?style=flat-square" alt="ACE3 Version">
</a> </a>
<a href="https://github.com/acemod/ACE3/releases/download/v3.4.0/ace3_3.4.0.zip"> <a href="https://github.com/acemod/ACE3/releases/download/v3.4.2/ace3_3.4.2.zip">
<img src="https://img.shields.io/badge/Download-72.6_MB-green.svg?style=flat-square" alt="ACE3 Download"> <img src="https://img.shields.io/badge/Download-72.6_MB-green.svg?style=flat-square" alt="ACE3 Download">
</a> </a>
<a href="https://github.com/acemod/ACE3/issues"> <a href="https://github.com/acemod/ACE3/issues">

Binary file not shown.

View File

@ -12,11 +12,7 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private "_deleted"; private _aceTimeSecond = floor ACE_time;
_deleted = 0;
_aceTimeSecond = floor ACE_time;
{ {
private ["_bulletVelocity", "_bulletPosition", "_bulletSpeed"]; private ["_bulletVelocity", "_bulletPosition", "_bulletSpeed"];

View File

@ -61,7 +61,6 @@ class CfgVehicles {
showDisabled = 0; showDisabled = 0;
priority = 5; priority = 5;
icon = PATHTOF(UI\attach_ca.paa); icon = PATHTOF(UI\attach_ca.paa);
// hotkey = "T";
}; };
class GVAR(Detach) { class GVAR(Detach) {
displayName = CSTRING(Detach); displayName = CSTRING(Detach);
@ -71,7 +70,6 @@ class CfgVehicles {
showDisabled = 0; showDisabled = 0;
priority = 5; priority = 5;
icon = PATHTOF(UI\detach_ca.paa); icon = PATHTOF(UI\detach_ca.paa);
hotkey = "T";
}; };
}; };
}; };

View File

@ -17,24 +17,17 @@
params ["_target", "_backpack"]; params ["_target", "_backpack"];
// do cam shake if the target is the player // do cam shake if the target is the player
if ([_target] call EFUNC(common,isPlayer)) then { if (_target call EFUNC(common,isPlayer)) then {
addCamShake [4, 0.5, 5]; addCamShake [4, 0.5, 5];
}; };
// play a zipper sound effect // play a zipper sound effect
private ["_sounds", "_position"]; private _sounds = [
_sounds = [
/*"a3\sounds_f\characters\ingame\AinvPknlMstpSlayWpstDnon_medic.wss",
"a3\sounds_f\characters\ingame\AinvPknlMstpSlayWrflDnon_medic.wss",
"a3\sounds_f\characters\ingame\AinvPpneMstpSlayWpstDnon_medic.wss",
"a3\sounds_f\characters\ingame\AinvPpneMstpSlayWrflDnon_medic.wss"*/
QUOTE(PATHTO_R(sounds\zip_in.wav)), QUOTE(PATHTO_R(sounds\zip_in.wav)),
QUOTE(PATHTO_R(sounds\zip_out.wav)) QUOTE(PATHTO_R(sounds\zip_out.wav))
]; ];
_position = AGLToASL (_target modelToWorldVisual (_target selectionPosition "Spine3")); private _position = AGLToASL (_target modelToWorldVisual (_target selectionPosition "Spine3"));
playSound3D [ playSound3D [
_sounds select floor random count _sounds, _sounds select floor random count _sounds,

View File

@ -12,13 +12,12 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_backpack"]; params [["_backpack", objNull, [objNull]]];
if (_backpack isEqualType objNull) then { if (_backpack isEqualType objNull) then {
_backpack = typeOf _backpack; _backpack = typeOf _backpack;
}; };
private "_config"; private _config = configFile >> "CfgVehicles" >> _backpack;
_config = configFile >> "CfgVehicles" >> _backpack;
getText (_config >> "vehicleClass") == "backpacks" && {getNumber (_config >> "maximumLoad") > 0} // return getText (_config >> "vehicleClass") == "backpacks" && {getNumber (_config >> "maximumLoad") > 0} // return

View File

@ -16,11 +16,10 @@
params ["_unit", "_backpack"]; params ["_unit", "_backpack"];
// exit if the target is not a real backpack, i.e. parachute, static weapon bag etc. // exit if the target is not a real backpack, i.e. parachute, static weapon bag etc.
if !([_backpack] call FUNC(isBackpack)) exitWith {false}; if !(_backpack call FUNC(isBackpack)) exitWith {false};
// get the unit that wears the backpack object // get the unit that wears the backpack object
private "_target"; private _target = objectParent _backpack;
_target = objectParent _backpack;
if (isNull _target) exitWith {false}; if (isNull _target) exitWith {false};

View File

@ -32,7 +32,6 @@ class CfgVehicles {
showDisabled = 0; showDisabled = 0;
icon = QUOTE(PATHTOF(UI\captive_ca.paa)); icon = QUOTE(PATHTOF(UI\captive_ca.paa));
priority = 2.3; priority = 2.3;
hotkey = "E";
}; };
class ACE_StopEscorting { class ACE_StopEscorting {
displayName = CSTRING(StopEscorting); displayName = CSTRING(StopEscorting);
@ -43,7 +42,6 @@ class CfgVehicles {
showDisabled = 0; showDisabled = 0;
icon = QUOTE(PATHTOF(UI\captive_ca.paa)); icon = QUOTE(PATHTOF(UI\captive_ca.paa));
priority = 2.3; priority = 2.3;
hotkey = "E";
}; };
class ACE_LoadCaptive { class ACE_LoadCaptive {
displayName = CSTRING(LoadCaptive); displayName = CSTRING(LoadCaptive);
@ -54,7 +52,6 @@ class CfgVehicles {
showDisabled = 0; showDisabled = 0;
icon = QUOTE(PATHTOF(UI\captive_ca.paa)); icon = QUOTE(PATHTOF(UI\captive_ca.paa));
priority = 2.2; priority = 2.2;
hotkey = "L";
}; };
class GVAR(UnloadCaptive) { class GVAR(UnloadCaptive) {
displayName = CSTRING(UnloadCaptive); displayName = CSTRING(UnloadCaptive);
@ -74,7 +71,6 @@ class CfgVehicles {
exceptions[] = {"isNotEscorting"}; exceptions[] = {"isNotEscorting"};
showDisabled = 0; showDisabled = 0;
priority = 2.3; priority = 2.3;
hotkey = "C";
}; };
class ACE_StartSurrenderingSelf { class ACE_StartSurrenderingSelf {
displayName = CSTRING(StartSurrendering); displayName = CSTRING(StartSurrendering);
@ -165,7 +161,7 @@ class CfgVehicles {
description = CSTRING(ModuleSurrender_Description); description = CSTRING(ModuleSurrender_Description);
sync[] = {"AnyAI"}; sync[] = {"AnyAI"};
}; };
}; };
class GVAR(ModuleHandcuffed): Module_F { class GVAR(ModuleHandcuffed): Module_F {
author = ECSTRING(common,ACETeam); author = ECSTRING(common,ACETeam);
category = "ACE"; category = "ACE";

View File

@ -184,12 +184,14 @@
<Polish>Skuj jednostkę</Polish> <Polish>Skuj jednostkę</Polish>
<Portuguese>Fazer unidade algemada</Portuguese> <Portuguese>Fazer unidade algemada</Portuguese>
<Russian>Связать юнита</Russian> <Russian>Связать юнита</Russian>
<Czech>Spoutat jednotku</Czech>
</Key> </Key>
<Key ID="STR_ACE_Captives_ModuleHandcuffed_Description"> <Key ID="STR_ACE_Captives_ModuleHandcuffed_Description">
<English>Sync a unit to make them handcuffed.&lt;br /&gt;Source: ace_captives</English> <English>Sync a unit to make them handcuffed.&lt;br /&gt;Source: ace_captives</English>
<Polish>Zsynchronizuj z jednostką, aby została skuta.&lt;br /&gt;Źródło: ace_captives</Polish> <Polish>Zsynchronizuj z jednostką, aby została skuta.&lt;br /&gt;Źródło: ace_captives</Polish>
<Portuguese>Sincronizar uma unidade para deixá-la algemada.&lt;br/&gt;Source: ace_captives</Portuguese> <Portuguese>Sincronizar uma unidade para deixá-la algemada.&lt;br/&gt;Source: ace_captives</Portuguese>
<Russian>Синхронизируйте с юнитами, чтобы сделать их связанными.&lt;br /&gt;Источник: ace_captives</Russian> <Russian>Синхронизируйте с юнитами, чтобы сделать их связанными.&lt;br /&gt;Источник: ace_captives</Russian>
<Czech>Synchronizovat s jednotkou, která má být v poutech.&lt;br /&gt;Zdroj: ace_captives</Czech>
</Key> </Key>
<Key ID="STR_ACE_Captives_ModuleSettings_DisplayName"> <Key ID="STR_ACE_Captives_ModuleSettings_DisplayName">
<English>Captives Settings</English> <English>Captives Settings</English>
@ -264,6 +266,7 @@
<Portuguese>Requer rendição</Portuguese> <Portuguese>Requer rendição</Portuguese>
<Russian>Требовать пленения</Russian> <Russian>Требовать пленения</Russian>
<Spanish>Requiere rendición</Spanish> <Spanish>Requiere rendición</Spanish>
<Czech>Vzdávání vyžadováno</Czech>
</Key> </Key>
<Key ID="STR_ACE_Captives_ModuleSettings_requireSurrender_description"> <Key ID="STR_ACE_Captives_ModuleSettings_requireSurrender_description">
<English>Require Players to surrender before they can be arrested</English> <English>Require Players to surrender before they can be arrested</English>
@ -272,6 +275,7 @@
<Portuguese>Requer que jogadores se rendam antes de poderem ser presos</Portuguese> <Portuguese>Requer que jogadores se rendam antes de poderem ser presos</Portuguese>
<Russian>Требуется, чтобы игрок сдался в плен прежде, чем его можно будет связать</Russian> <Russian>Требуется, чтобы игрок сдался в плен прежде, чем его можно будет связать</Russian>
<Spanish>Requiere que los Jugadores se rindan antes de arrestarlos</Spanish> <Spanish>Requiere que los Jugadores se rindan antes de arrestarlos</Spanish>
<Czech>Vyžaduje, aby se hráč nejdříve vzdal, poté může být spoután</Czech>
</Key> </Key>
<Key ID="STR_ACE_Captives_SurrenderOnly"> <Key ID="STR_ACE_Captives_SurrenderOnly">
<English>Surrendering only</English> <English>Surrendering only</English>
@ -280,6 +284,7 @@
<Portuguese>Somente rendição </Portuguese> <Portuguese>Somente rendição </Portuguese>
<Russian>Только сдавшийся в плен</Russian> <Russian>Только сдавшийся в плен</Russian>
<Spanish>Solo rendición</Spanish> <Spanish>Solo rendición</Spanish>
<Czech>Pouze vzdávání</Czech>
</Key> </Key>
<Key ID="STR_ACE_Captives_SurrenderOrNoWeapon"> <Key ID="STR_ACE_Captives_SurrenderOrNoWeapon">
<English>Surrendering or No weapon</English> <English>Surrendering or No weapon</English>
@ -288,6 +293,7 @@
<Portuguese>Rendição ou desarmado</Portuguese> <Portuguese>Rendição ou desarmado</Portuguese>
<Russian>Сдавшийся или безоружный</Russian> <Russian>Сдавшийся или безоружный</Russian>
<Spanish>Rendición o desarme</Spanish> <Spanish>Rendición o desarme</Spanish>
<Czech>Vzdávání nebo beze zbraně</Czech>
</Key> </Key>
</Package> </Package>
</Project> </Project>

View File

@ -3,6 +3,7 @@
<Package name="Cargo"> <Package name="Cargo">
<Key ID="STR_ACE_Cargo_loadObject"> <Key ID="STR_ACE_Cargo_loadObject">
<English>Load</English> <English>Load</English>
<German>Beladen</German>
<Polish>Załaduj</Polish> <Polish>Załaduj</Polish>
<Portuguese>Carregar</Portuguese> <Portuguese>Carregar</Portuguese>
<Russian>Загрузить</Russian> <Russian>Загрузить</Russian>
@ -11,6 +12,7 @@
</Key> </Key>
<Key ID="STR_ACE_Cargo_unloadObject"> <Key ID="STR_ACE_Cargo_unloadObject">
<English>Unload</English> <English>Unload</English>
<German>Entladen</German>
<Polish>Wyładuj</Polish> <Polish>Wyładuj</Polish>
<Portuguese>Descarregar</Portuguese> <Portuguese>Descarregar</Portuguese>
<Russian>Выгрузить</Russian> <Russian>Выгрузить</Russian>
@ -19,6 +21,7 @@
</Key> </Key>
<Key ID="STR_ACE_Cargo_openMenu"> <Key ID="STR_ACE_Cargo_openMenu">
<English>Cargo</English> <English>Cargo</English>
<German>Fracht</German>
<Polish>Ładunek</Polish> <Polish>Ładunek</Polish>
<Portuguese>Carga</Portuguese> <Portuguese>Carga</Portuguese>
<Russian>Грузовой отсек</Russian> <Russian>Грузовой отсек</Russian>
@ -27,6 +30,7 @@
</Key> </Key>
<Key ID="STR_ACE_Cargo_cargoMenu"> <Key ID="STR_ACE_Cargo_cargoMenu">
<English>Cargo Menu</English> <English>Cargo Menu</English>
<German>Frachtmenü</German>
<Polish>Menu ładunku</Polish> <Polish>Menu ładunku</Polish>
<Portuguese>Menu de carga</Portuguese> <Portuguese>Menu de carga</Portuguese>
<Russian>Грузовой отсек</Russian> <Russian>Грузовой отсек</Russian>
@ -35,6 +39,7 @@
</Key> </Key>
<Key ID="STR_ACE_Cargo_labelSpace"> <Key ID="STR_ACE_Cargo_labelSpace">
<English>Cargo space left: %1</English> <English>Cargo space left: %1</English>
<German>Frachtplätze frei: %1</German>
<Polish>Pozostałe miejsce: %1</Polish> <Polish>Pozostałe miejsce: %1</Polish>
<Portuguese>Espaço de carga restante: %1</Portuguese> <Portuguese>Espaço de carga restante: %1</Portuguese>
<Russian>Осталось мест: %1</Russian> <Russian>Осталось мест: %1</Russian>
@ -43,6 +48,7 @@
</Key> </Key>
<Key ID="STR_ACE_Cargo_ModuleSettings_enable"> <Key ID="STR_ACE_Cargo_ModuleSettings_enable">
<English>Enable Cargo</English> <English>Enable Cargo</English>
<German>Aktiviere Fracht</German>
<Polish>Aktywuj cargo</Polish> <Polish>Aktywuj cargo</Polish>
<Portuguese>Ativar carga</Portuguese> <Portuguese>Ativar carga</Portuguese>
<Russian>Включить модуль перевозки грузов</Russian> <Russian>Включить модуль перевозки грузов</Russian>
@ -51,6 +57,7 @@
</Key> </Key>
<Key ID="STR_ACE_Cargo_ModuleSettings_enable_Description"> <Key ID="STR_ACE_Cargo_ModuleSettings_enable_Description">
<English>Enable the load in cargo module</English> <English>Enable the load in cargo module</English>
<German>Aktiviere das Frachtmodul</German>
<Polish>Aktywuj możliwość załadunku skrzyń i przedmiotów do pojazdów.</Polish> <Polish>Aktywuj możliwość załadunku skrzyń i przedmiotów do pojazdów.</Polish>
<Portuguese>Ativar o módulo de carregamento de carga</Portuguese> <Portuguese>Ativar o módulo de carregamento de carga</Portuguese>
<Russian>Включает модуль погрузки и перевозки грузов</Russian> <Russian>Включает модуль погрузки и перевозки грузов</Russian>
@ -58,6 +65,7 @@
</Key> </Key>
<Key ID="STR_ACE_Cargo_SettingsModule_DisplayName"> <Key ID="STR_ACE_Cargo_SettingsModule_DisplayName">
<English>Cargo Settings</English> <English>Cargo Settings</English>
<German>Frachteinstellungen</German>
<Polish>Ustawienia cargo</Polish> <Polish>Ustawienia cargo</Polish>
<Portuguese>Preferências de carregamento</Portuguese> <Portuguese>Preferências de carregamento</Portuguese>
<Russian>Перевозка грузов</Russian> <Russian>Перевозка грузов</Russian>
@ -66,10 +74,12 @@
</Key> </Key>
<Key ID="STR_ACE_Cargo_SettingsModule_Description"> <Key ID="STR_ACE_Cargo_SettingsModule_Description">
<English>Configure the cargo module settings</English> <English>Configure the cargo module settings</English>
<German>Konfiguriere das Frachtmodul</German>
<Polish>Skonfiguruj ustawienia modułu cargo.</Polish> <Polish>Skonfiguruj ustawienia modułu cargo.</Polish>
<Portuguese>Configura as preferências do módulo de carga</Portuguese> <Portuguese>Configura as preferências do módulo de carga</Portuguese>
<Russian>Конфигурирует настройки модуля перевозки грузов</Russian> <Russian>Конфигурирует настройки модуля перевозки грузов</Russian>
<Spanish>Configure los ajustes del módulo de carga</Spanish> <Spanish>Configure los ajustes del módulo de carga</Spanish>
<Czech>Konfigurace nákladního modulu</Czech>
</Key> </Key>
<Key ID="STR_ACE_Cargo_LoadedItem"> <Key ID="STR_ACE_Cargo_LoadedItem">
<English>%1&lt;br/&gt;loaded into&lt;br/&gt;%2</English> <English>%1&lt;br/&gt;loaded into&lt;br/&gt;%2</English>
@ -89,7 +99,7 @@
<Spanish>Descargado/a&lt;br/&gt;%1 de&lt;br/&gt;%2</Spanish> <Spanish>Descargado/a&lt;br/&gt;%1 de&lt;br/&gt;%2</Spanish>
<French>Déchargé&lt;br/&gt;%1 de&lt;br/&gt;%2</French> <French>Déchargé&lt;br/&gt;%1 de&lt;br/&gt;%2</French>
<Polish>%1&lt;br/&gt;rozładowano z&lt;br/&gt;%2</Polish> <Polish>%1&lt;br/&gt;rozładowano z&lt;br/&gt;%2</Polish>
<Czech>Nezatížený&lt;br/&gt;%1 do&lt;br/&gt;%2</Czech> <Czech>%1&lt;br/&gt;vyloženo z&lt;br/&gt;%2</Czech>
<Portuguese>%1&lt;br/&gt;descarregado de&lt;br/&gt;%2</Portuguese> <Portuguese>%1&lt;br/&gt;descarregado de&lt;br/&gt;%2</Portuguese>
<Italian>Hai scaricato&lt;br/&gt;%1 da&lt;br/&gt;%2</Italian> <Italian>Hai scaricato&lt;br/&gt;%1 da&lt;br/&gt;%2</Italian>
<Hungarian>1%&lt;br/&gt;kirakodva ebből:&lt;br/&gt;%2</Hungarian> <Hungarian>1%&lt;br/&gt;kirakodva ebből:&lt;br/&gt;%2</Hungarian>
@ -99,21 +109,29 @@
<English>Loading Cargo</English> <English>Loading Cargo</English>
<Portuguese>Carregando carga</Portuguese> <Portuguese>Carregando carga</Portuguese>
<Polish>Ładowanie cargo</Polish> <Polish>Ładowanie cargo</Polish>
<Czech>Nakládám</Czech>
<Russian>Погрузка</Russian>
</Key> </Key>
<Key ID="STR_ACE_Cargo_UnloadingItem"> <Key ID="STR_ACE_Cargo_UnloadingItem">
<English>Unloading Cargo</English> <English>Unloading Cargo</English>
<Portuguese>Descarregando carga</Portuguese> <Portuguese>Descarregando carga</Portuguese>
<Polish>Rozładowywanie cargo</Polish> <Polish>Rozładowywanie cargo</Polish>
<Czech>Vykládám</Czech>
<Russian>Выгрузка</Russian>
</Key> </Key>
<Key ID="STR_ACE_Cargo_LoadingFailed"> <Key ID="STR_ACE_Cargo_LoadingFailed">
<English>%1&lt;br/&gt;could not be loaded</English> <English>%1&lt;br/&gt;could not be loaded</English>
<Portuguese>%1&lt;br/&gt;não pode ser carregado</Portuguese> <Portuguese>%1&lt;br/&gt;não pode ser carregado</Portuguese>
<Polish>%1&lt;br/&gt;nie mógł zostać załadowany</Polish> <Polish>%1&lt;br/&gt;nie mógł zostać załadowany</Polish>
<Czech>%1&lt;br/&gt;nemůže být naloženo</Czech>
<Russian>%1&lt;br/&gt;не может быть погружен</Russian>
</Key> </Key>
<Key ID="STR_ACE_Cargo_UnloadingFailed"> <Key ID="STR_ACE_Cargo_UnloadingFailed">
<English>%1&lt;br/&gt;could not be unloaded</English> <English>%1&lt;br/&gt;could not be unloaded</English>
<Portuguese>%1&lt;br/&gt;não pode ser descarregado</Portuguese> <Portuguese>%1&lt;br/&gt;não pode ser descarregado</Portuguese>
<Polish>%1&lt;br/&gt;nie mógł zostać rozładowany</Polish> <Polish>%1&lt;br/&gt;nie mógł zostać rozładowany</Polish>
<Czech>%1&lt;br/&gt;nemůže být vyloženo</Czech>
<Russian>%1&lt;br/&gt;не может быть выгружен</Russian>
</Key> </Key>
</Package> </Package>
</Project> </Project>

View File

@ -107,6 +107,10 @@ class RscInGameUI {
class RscOptics_LaserDesignator_02 { class RscOptics_LaserDesignator_02 {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent);); onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
}; };
class RscStaminaBar {
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscStaminaBar"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2(QUOTE(QGVAR(dlgStaminaBar)),_this select 0)]);
};
}; };
class RscDisplayInventory { class RscDisplayInventory {

View File

@ -1,7 +1,7 @@
// ACE - Common // ACE - Common
// #define ENABLE_PERFORMANCE_COUNTERS
#include "script_component.hpp" #include "script_component.hpp"
// #define ENABLE_PERFORMANCE_COUNTERS
////////////////////////////////////////////////// //////////////////////////////////////////////////
// PFHs // PFHs
@ -57,13 +57,30 @@
// Eventhandlers // Eventhandlers
////////////////////////////////////////////////// //////////////////////////////////////////////////
//Add a fix for BIS's zeus remoteControl module not reseting variables on DC when RC a unit
//This variable is used for isPlayer checks
if (isServer) then {
addMissionEventHandler ["HandleDisconnect", {
params ["_dcPlayer"];
private _zeusLogic = getAssignedCuratorLogic _dcPlayer;
if ((!isNil "_zeusLogic") && {!isNull _zeusLogic}) then {
{
if ((_x getvariable ["bis_fnc_moduleRemoteControl_owner", objnull]) isEqualTo _dcPlayer) exitWith {
ACE_LOGINFO_3("[%1] DC - Was Zeus [%2] while controlling unit [%3] - manually clearing `bis_fnc_moduleRemoteControl_owner`", [_x] call FUNC(getName), _dcPlayer, _x);
_x setVariable ["bis_fnc_moduleRemoteControl_owner", nil, true];
};
nil
} count (curatorEditableObjects _zeusLogic);
};
}];
};
// Listens for global "SettingChanged" events, to update the force status locally // Listens for global "SettingChanged" events, to update the force status locally
["SettingChanged", { ["SettingChanged", {
params ["_name", "_value", "_force"]; params ["_name", "_value", "_force"];
if (_force) then { if (_force) then {
private "_settingData"; private _settingData = [_name] call FUNC(getSettingData);
_settingData = [_name] call FUNC(getSettingData);
if (_settingData isEqualTo []) exitWith {}; if (_settingData isEqualTo []) exitWith {};
@ -144,10 +161,8 @@ QGVAR(remoteFnc) addPublicVariableEventHandler {
// Check files, previous installed version etc. // Check files, previous installed version etc.
////////////////////////////////////////////////// //////////////////////////////////////////////////
private ["_currentVersion", "_previousVersion"]; private _currentVersion = getText (configFile >> "CfgPatches" >> QUOTE(ADDON) >> "version");
private _previousVersion = profileNamespace getVariable ["ACE_VersionNumberString", ""];
_currentVersion = getText (configFile >> "CfgPatches" >> QUOTE(ADDON) >> "version");
_previousVersion = profileNamespace getVariable ["ACE_VersionNumberString", ""];
// check previous version number from profile // check previous version number from profile
if (_currentVersion != _previousVersion) then { if (_currentVersion != _previousVersion) then {
@ -167,7 +182,7 @@ call FUNC(checkFiles);
[ [
GVAR(checkPBOsAction), GVAR(checkPBOsAction),
GVAR(checkPBOsCheckAll), GVAR(checkPBOsCheckAll),
call compile GVAR(checkPBOsWhitelist) GVAR(checkPBOsWhitelist)
] call FUNC(checkPBOs) ] call FUNC(checkPBOs)
}] call FUNC(addEventHandler); }] call FUNC(addEventHandler);
@ -251,8 +266,7 @@ GVAR(ScrollWheelFrame) = diag_frameno;
}] call FUNC(addEventHandler); }] call FUNC(addEventHandler);
// add PFH to execute event that fires when the main display (46) is created // add PFH to execute event that fires when the main display (46) is created
private "_fnc_initMainDisplayCheck"; private _fnc_initMainDisplayCheck = {
_fnc_initMainDisplayCheck = {
[{ [{
if !(isNull findDisplay 46) then { if !(isNull findDisplay 46) then {
// Raise ACE event locally // Raise ACE event locally
@ -293,6 +307,17 @@ enableCamShake true;
// Set up numerous eventhanders for player controlled units // Set up numerous eventhanders for player controlled units
////////////////////////////////////////////////// //////////////////////////////////////////////////
//CBA has events for zeus's display onLoad and onUnload (Need to delay a frame for display to be ready)
private _zeusDisplayChangedFNC = {
[{
private _data = !(isNull findDisplay 312);
["zeusDisplayChanged", [ACE_player, _data]] call FUNC(localEvent);
}, []] call FUNC(execNextFrame);
};
["CBA_curatorOpened", _zeusDisplayChangedFNC] call CBA_fnc_addEventHandler;
["CBA_curatorClosed", _zeusDisplayChangedFNC] call CBA_fnc_addEventHandler;
// default variables // default variables
GVAR(OldPlayerVehicle) = vehicle objNull; GVAR(OldPlayerVehicle) = vehicle objNull;
GVAR(OldPlayerTurret) = [objNull] call FUNC(getTurretIndex); GVAR(OldPlayerTurret) = [objNull] call FUNC(getTurretIndex);
@ -302,7 +327,6 @@ GVAR(OldPlayerVisionMode) = currentVisionMode objNull;
GVAR(OldCameraView) = ""; GVAR(OldCameraView) = "";
GVAR(OldVisibleMap) = false; GVAR(OldVisibleMap) = false;
GVAR(OldInventoryDisplayIsOpen) = nil; //@todo check this GVAR(OldInventoryDisplayIsOpen) = nil; //@todo check this
GVAR(OldZeusDisplayIsOpen) = false;
GVAR(OldIsCamera) = false; GVAR(OldIsCamera) = false;
// clean up playerChanged eventhandler from preinit and put it in the same PFH as the other events to reduce overhead and guarantee advantageous execution order // clean up playerChanged eventhandler from preinit and put it in the same PFH as the other events to reduce overhead and guarantee advantageous execution order
@ -314,13 +338,11 @@ if (!isNil QGVAR(PreInit_playerChanged_PFHID)) then {
// PFH to raise varios events // PFH to raise varios events
[{ [{
BEGIN_COUNTER(stateChecker); BEGIN_COUNTER(stateChecker);
private "_data"; // reuse one variable to reduce number of variables that have to be set to private each frame
// "playerChanged" event // "playerChanged" event
_data = call FUNC(player); private _data = call FUNC(player);
if !(_data isEqualTo ACE_player) then { if !(_data isEqualTo ACE_player) then {
private "_oldPlayer"; private _oldPlayer = ACE_player;
_oldPlayer = ACE_player;
ACE_player = _data; ACE_player = _data;
uiNamespace setVariable ["ACE_player", _data]; uiNamespace setVariable ["ACE_player", _data];
@ -393,14 +415,6 @@ if (!isNil QGVAR(PreInit_playerChanged_PFHID)) then {
["inventoryDisplayChanged", [ACE_player, _data]] call FUNC(localEvent); ["inventoryDisplayChanged", [ACE_player, _data]] call FUNC(localEvent);
}; };
// "zeusDisplayChanged" event
_data = !(isNull findDisplay 312);
if !(_data isEqualTo GVAR(OldZeusDisplayIsOpen)) then {
// Raise ACE event locally
GVAR(OldZeusDisplayIsOpen) = _data;
["zeusDisplayChanged", [ACE_player, _data]] call FUNC(localEvent);
};
// "activeCameraChanged" event // "activeCameraChanged" event
_data = call FUNC(isfeatureCameraActive); _data = call FUNC(isfeatureCameraActive);
if !(_data isEqualTo GVAR(OldIsCamera)) then { if !(_data isEqualTo GVAR(OldIsCamera)) then {
@ -449,6 +463,7 @@ if (!isNil QGVAR(PreInit_playerChanged_PFHID)) then {
{_unit != _target && {vehicle _unit == vehicle _target}} {_unit != _target && {vehicle _unit == vehicle _target}}
}] call FUNC(addCanInteractWithCondition); }] call FUNC(addCanInteractWithCondition);
["isNotInZeus", {isNull curatorCamera}] call FUNC(addCanInteractWithCondition);
////////////////////////////////////////////////// //////////////////////////////////////////////////
// Set up PlayerJIP eventhandler // Set up PlayerJIP eventhandler

View File

@ -74,6 +74,7 @@ PREP(getNumberFromMissionSQM);
PREP(getNumberMagazinesIn); PREP(getNumberMagazinesIn);
PREP(getPitchBankYaw); PREP(getPitchBankYaw);
PREP(getSettingData); PREP(getSettingData);
PREP(getStaminaBarControl);
PREP(getStringFromMissionSQM); PREP(getStringFromMissionSQM);
PREP(getTargetAzimuthAndInclination); PREP(getTargetAzimuthAndInclination);
PREP(getTargetDistance); PREP(getTargetDistance);
@ -328,8 +329,7 @@ if (hasInterface) then {
// PFH to update the ACE_player variable // PFH to update the ACE_player variable
GVAR(PreInit_playerChanged_PFHID) = [{ GVAR(PreInit_playerChanged_PFHID) = [{
if !(ACE_player isEqualTo (call FUNC(player))) then { if !(ACE_player isEqualTo (call FUNC(player))) then {
private ["_oldPlayer"]; private _oldPlayer = ACE_player;
_oldPlayer = ACE_player;
ACE_player = call FUNC(player); ACE_player = call FUNC(player);
uiNamespace setVariable ["ACE_player", ACE_player]; uiNamespace setVariable ["ACE_player", ACE_player];

View File

@ -16,15 +16,12 @@ params ["_eventType", "_event"];
if (_eventType == "ACEg") then { if (_eventType == "ACEg") then {
_event params ["_eventName", "_eventArgs"]; _event params ["_eventName", "_eventArgs"];
GVAR(events) params ["_eventNames"];
private ["_eventNames", "_eventIndex"]; private _eventIndex = _eventNames find _eventName;
_eventNames = GVAR(events) select 0;
_eventIndex = _eventNames find _eventName;
if (_eventIndex != -1) then { if (_eventIndex != -1) then {
private "_events"; private _events = (GVAR(events) select 1) select _eventIndex;
_events = (GVAR(events) select 1) select _eventIndex;
#ifdef DEBUG_EVENTS #ifdef DEBUG_EVENTS
ACE_LOGINFO_1("* Net Event %1",_eventName); ACE_LOGINFO_1("* Net Event %1",_eventName);
@ -46,9 +43,8 @@ if (_eventType == "ACEc") then {
if (isServer) then { if (isServer) then {
_event params ["_eventName", "_eventTargets", "_eventArgs"]; _event params ["_eventName", "_eventTargets", "_eventArgs"];
private ["_sentEvents", "_owner", "_serverFlagged"]; private _sentEvents = [];
_sentEvents = [];
if (!IS_ARRAY(_eventTargets)) then { if (!IS_ARRAY(_eventTargets)) then {
_eventTargets = [_eventTargets]; _eventTargets = [_eventTargets];
}; };
@ -59,9 +55,11 @@ if (_eventType == "ACEc") then {
["ACEg", ACEg] call FUNC(_handleNetEvent); ["ACEg", ACEg] call FUNC(_handleNetEvent);
}; };
_serverFlagged = false; private _serverFlagged = false;
{ {
_owner = _x; private _owner = _x;
if (IS_OBJECT(_x)) then { if (IS_OBJECT(_x)) then {
_owner = owner _x; _owner = owner _x;
}; };

View File

@ -15,10 +15,8 @@
params ["_client"]; params ["_client"];
{ {
private ["_eventEntry", "_eventLog"]; private _eventEntry = HASH_GET(GVAR(syncedEvents),_x);
_eventEntry params ["", "_eventLog"];
_eventEntry = HASH_GET(GVAR(syncedEvents),_x);
_eventLog = _eventEntry select 1;
["SEH_s", _client, [_x, _eventLog]] call FUNC(targetEvent); ["SEH_s", _client, [_x, _eventLog]] call FUNC(targetEvent);
false false

View File

@ -27,10 +27,8 @@ if (isServer) then {
false false
}; };
private ["_eventEntry", "_eventLog"]; private _eventEntry = HASH_GET(GVAR(syncedEvents),_eventName);
_eventEntry params ["", "_eventLog"];
_eventEntry = HASH_GET(GVAR(syncedEvents),_eventName);
_eventLog = _eventEntry select 1;
["SEH_s", _client, [_eventName, _eventLog]] call FUNC(targetEvent); ["SEH_s", _client, [_eventName, _eventLog]] call FUNC(targetEvent);
} else { } else {

View File

@ -21,20 +21,17 @@ if (!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith {
false false
}; };
private ["_internalData", "_eventCode"]; private _internalData = HASH_GET(GVAR(syncedEvents),_name);
_internalData = HASH_GET(GVAR(syncedEvents),_name);
if (isServer) then { if (isServer) then {
// Server needs to internally log it for synchronization // Server needs to internally log it for synchronization
if (_ttl > -1) then { if (_ttl > -1) then {
_internalData = HASH_GET(GVAR(syncedEvents),_name); _internalData = HASH_GET(GVAR(syncedEvents),_name);
private "_eventLog"; _internalData params ["", "_eventLog"];
_eventLog = _internalData select 1;
_eventLog pushBack [ACE_diagTime, _args, _ttl]; _eventLog pushBack [ACE_diagTime, _args, _ttl];
}; };
}; };
_eventCode = _internalData select 0; _internalData params ["_eventCode"];
_args call _eventCode; _args call _eventCode;

View File

@ -25,10 +25,8 @@ if (_statement isEqualType "") then {
_statement = compile _statement; _statement = compile _statement;
}; };
private ["_name", "_actionsVar"]; private _name = format ["ACE_Action_%1", _action];
private _actionsVar = _unit getVariable [_name, [-1, [-1, [], []], objNull]];
_name = format ["ACE_Action_%1", _action];
_actionsVar = _unit getVariable [_name, [-1, [-1, [], []], objNull]];
if (_unit != _actionsVar select 2) then { // check if the unit is still valid, fixes respawn issues if (_unit != _actionsVar select 2) then { // check if the unit is still valid, fixes respawn issues
_actionsVar = [-1, [-1, [], []], objNull]; _actionsVar = [-1, [-1, [], []], objNull];
@ -44,8 +42,7 @@ _actions pushBack [_condition, _statement];
// first action to add, unit needs addAction command // first action to add, unit needs addAction command
if (_actionID == -1) then { if (_actionID == -1) then {
private "_addAction"; private _addAction = call compile format [
_addAction = call compile format [
"[ "[
'', '',
{if (inputAction '%1' == 0) exitWith {}; {if (_this call (_x select 0)) then {_this call (_x select 1)}} forEach (((_this select 0) getVariable '%2') select 1 select 2)}, {if (inputAction '%1' == 0) exitWith {}; {if (_this call (_x select 0)) then {_this call (_x select 1)}} forEach (((_this select 0) getVariable '%2') select 1 select 2)},

View File

@ -37,23 +37,19 @@ if (_statement2 isEqualType "") then {
_statement2 = compile _statement2; _statement2 = compile _statement2;
}; };
private ["_name", "_actionsVar"]; private _name = format ["ACE_ActionMenu_%1", _action];
private _actionsVar = _unit getVariable [_name, [-1, [], []]];
_name = format ["ACE_ActionMenu_%1", _action];
_actionsVar = _unit getVariable [_name, [-1, [], []]];
_actionsVar params ["_id", "_actionIDs", "_actions"]; _actionsVar params ["_id", "_actionIDs", "_actions"];
_id = _id + 1; _id = _id + 1;
private ["_nameVar", "_addAction", "_actionID"]; private _nameVar = format ["%1_ID%2", _name, _id];
_nameVar = format ["%1_ID%2", _name, _id];
missionNamespace setVariable [_nameVar, [_condition, _statement, _condition2, _statement2]]; missionNamespace setVariable [_nameVar, [_condition, _statement, _condition2, _statement2]];
_actionIDs pushBack _id; _actionIDs pushBack _id;
_addAction = call compile format [ private _addAction = call compile format [
"[ "[
'%2', '%2',
{if (inputAction '%1' == 0) then {if (_this call (%3 select 2)) then {_this call (%3 select 3)}} else {_this call (%3 select 1)}}, {if (inputAction '%1' == 0) then {if (_this call (%3 select 2)) then {_this call (%3 select 3)}} else {_this call (%3 select 1)}},
@ -70,7 +66,7 @@ _addAction = call compile format [
_priority _priority
]; ];
_actionID = _unit addAction _addAction; private _actionID = _unit addAction _addAction;
_actions pushBack [_actionID, _nameVar]; _actions pushBack [_actionID, _nameVar];

View File

@ -17,12 +17,10 @@ params ["_conditionName", "_conditionFunc"];
_conditionName = toLower _conditionName; _conditionName = toLower _conditionName;
private ["_conditions", "_index"]; private _conditions = missionNamespace getVariable [QGVAR(InteractionConditions), [[],[]]];
_conditions = missionNamespace getVariable [QGVAR(InteractionConditions), [[],[]]];
_conditions params ["_conditionNames", "_conditionFuncs"]; _conditions params ["_conditionNames", "_conditionFuncs"];
_index = _conditionNames find _conditionName; private _index = _conditionNames find _conditionName;
if (_index == -1) then { if (_index == -1) then {
_index = count _conditionNames; _index = count _conditionNames;

View File

@ -13,8 +13,7 @@
disableSerialization; disableSerialization;
private "_dlg"; private _dlg = ctrlParent _this;
_dlg = ctrlParent _this;
_dlg displayAddEventHandler ["unload", { _dlg displayAddEventHandler ["unload", {
if (_this select 1 == 1) then { if (_this select 1 == 1) then {

View File

@ -15,17 +15,15 @@
params ["_eventName", "_eventCode"]; params ["_eventName", "_eventCode"];
private ["_eventNames", "_eventFunctions", "_eventIndex"]; GVAR(events) params ["_eventNames"];
_eventNames = GVAR(events) select 0; private _eventFunctions = [];
_eventFunctions = []; private _eventIndex = _eventNames find _eventName;
_eventIndex = _eventNames find _eventName;
if (_eventIndex != -1) then { if (_eventIndex != -1) then {
_eventFunctions = (GVAR(events) select 1) select _eventIndex; _eventFunctions = (GVAR(events) select 1) select _eventIndex;
} else { } else {
private "_eventNameCount"; private _eventNameCount = count _eventNames;
_eventNameCount = count _eventNames;
_eventNames set [_eventNameCount, _eventName]; _eventNames set [_eventNameCount, _eventName];
(GVAR(events) select 1) set [_eventNameCount, _eventFunctions]; (GVAR(events) select 1) set [_eventNameCount, _eventFunctions];

View File

@ -18,8 +18,7 @@ if (_statement isEqualType "") then {
_statement = compile _statement; _statement = compile _statement;
}; };
private "_actionsVar"; private _actionsVar = missionNamespace getVariable ["ACE_EventHandler_MapMarker", [-1, [], []]];
_actionsVar = missionNamespace getVariable ["ACE_EventHandler_MapMarker", [-1, [], []]];
_actionsVar params ["_id", "_actionIDs", "_actions"]; _actionsVar params ["_id", "_actionIDs", "_actions"];

View File

@ -19,8 +19,7 @@ if (_statement isEqualType "") then {
_statement = compile _statement; _statement = compile _statement;
}; };
private "_actionsVar"; private _actionsVar = missionNamespace getVariable ["ACE_EventHandler_ScrollWheel", [-1, [], []]];
_actionsVar = missionNamespace getVariable ["ACE_EventHandler_ScrollWheel", [-1, [], []]];
_actionsVar params ["_id", "_actionIDs", "_actions"]; _actionsVar params ["_id", "_actionIDs", "_actions"];

View File

@ -22,8 +22,7 @@
params ["_name", "", "", "", "", "", "", "_value"]; //["_name", "_typeName", "_isClientSetable", "_localizedName", "_localizedDescription", "_possibleValues", "_isForced", "_value"]; params ["_name", "", "", "", "", "", "", "_value"]; //["_name", "_typeName", "_isClientSetable", "_localizedName", "_localizedDescription", "_possibleValues", "_isForced", "_value"];
private "_settingData"; private _settingData = [_name] call FUNC(getSettingData);
_settingData = [_name] call FUNC(getSettingData);
// Exit if the setting already exists // Exit if the setting already exists
if (count _settingData > 0) exitWith {}; if (count _settingData > 0) exitWith {};

View File

@ -21,9 +21,7 @@ if (HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith {
false false
}; };
private ["_eventId", "_data"]; private _eventId = [_name, FUNC(_handleSyncedEvent)] call FUNC(addEventHandler);
private _data = [_handler, [], _ttl, _eventId];
_eventId = [_name, FUNC(_handleSyncedEvent)] call FUNC(addEventHandler);
_data = [_handler, [], _ttl, _eventId];
HASH_SET(GVAR(syncedEvents),_name,_data); HASH_SET(GVAR(syncedEvents),_name,_data);

View File

@ -18,9 +18,9 @@
params ["_unit", "_classname", ["_container", ""], ["_ammoCount", -1]]; params ["_unit", "_classname", ["_container", ""], ["_ammoCount", -1]];
private ["_type", "_canAdd", "_addedToUnit"]; private _type = _classname call FUNC(getItemType);
_type = [_classname] call FUNC(getItemType); private ["_canAdd", "_addedToUnit"];
switch (_container) do { switch (_container) do {
case "vest": { case "vest": {
@ -59,8 +59,7 @@ switch (_type select 0) do {
} else { } else {
_addedToUnit = false; _addedToUnit = false;
private "_pos"; private _pos = _unit modelToWorldVisual [0,1,0.05];
_pos = _unit modelToWorldVisual [0,1,0.05];
_unit = createVehicle ["WeaponHolder_Single_F", _pos, [], 0, "NONE"]; _unit = createVehicle ["WeaponHolder_Single_F", _pos, [], 0, "NONE"];
_unit addWeaponCargoGlobal [_classname, 1]; _unit addWeaponCargoGlobal [_classname, 1];
@ -93,8 +92,7 @@ switch (_type select 0) do {
} else { } else {
_addedToUnit = false; _addedToUnit = false;
private "_pos"; private _pos = _unit modelToWorldVisual [0,1,0.05];
_pos = _unit modelToWorldVisual [0,1,0.05];
_unit = createVehicle ["WeaponHolder_Single_F", _pos, [], 0, "NONE"]; _unit = createVehicle ["WeaponHolder_Single_F", _pos, [], 0, "NONE"];
_unit addMagazineCargoGlobal [_classname, 1/*_ammoCount*/]; //@todo Bug! This isn't really the ammo, but magazine count. No such command. _unit addMagazineCargoGlobal [_classname, 1/*_ammoCount*/]; //@todo Bug! This isn't really the ammo, but magazine count. No such command.
@ -123,8 +121,7 @@ switch (_type select 0) do {
} else { } else {
_addedToUnit = false; _addedToUnit = false;
private "_pos"; private _pos = _unit modelToWorldVisual [0,1,0.05];
_pos = _unit modelToWorldVisual [0,1,0.05];
_unit = createVehicle ["WeaponHolder_Single_F", _pos, [], 0, "NONE"]; _unit = createVehicle ["WeaponHolder_Single_F", _pos, [], 0, "NONE"];
_unit addItemCargoGlobal [_classname, 1]; _unit addItemCargoGlobal [_classname, 1];

View File

@ -17,7 +17,6 @@
params ["_unit"]; params ["_unit"];
private "_forceWalkNumber"; private _forceWalkNumber = _unit getVariable ["ACE_forceWalkStatusNumber", 0];
_forceWalkNumber = _unit getVariable ["ACE_forceWalkStatusNumber", 0];
_unit forceWalk (_forceWalkNumber > 0); _unit forceWalk (_forceWalkNumber > 0);

View File

@ -41,4 +41,5 @@ if (_list isEqualType "") then {
}; };
}; };
}; };
false
} count _list; } count _list;

View File

@ -12,13 +12,11 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private "_config"; ACE_isMapEnabled = call {private _config = missionConfigFile >> "showMap"; !isNumber _config || {getNumber _config == 1}}; // default value is 1, so do isNumber check first
ACE_isCompassEnabled = call {private _config = missionConfigFile >> "showCompass"; !isNumber _config || {getNumber _config == 1}};
ACE_isMapEnabled = call {_config = missionConfigFile >> "showMap"; !isNumber _config || {getNumber _config == 1}}; // default value is 1, so do isNumber check first ACE_isWatchEnabled = call {private _config = missionConfigFile >> "showWatch"; !isNumber _config || {getNumber _config == 1}};
ACE_isCompassEnabled = call {_config = missionConfigFile >> "showCompass"; !isNumber _config || {getNumber _config == 1}}; ACE_isRadioEnabled = call {private _config = missionConfigFile >> "showRadio"; !isNumber _config || {getNumber _config == 1}};
ACE_isWatchEnabled = call {_config = missionConfigFile >> "showWatch"; !isNumber _config || {getNumber _config == 1}}; ACE_isGPSEnabled = call {private _config = missionConfigFile >> "showGPS"; !isNumber _config || {getNumber _config == 1}};
ACE_isRadioEnabled = call {_config = missionConfigFile >> "showRadio"; !isNumber _config || {getNumber _config == 1}};
ACE_isGPSEnabled = call {_config = missionConfigFile >> "showGPS"; !isNumber _config || {getNumber _config == 1}};
GVAR(AssignedItems) = []; GVAR(AssignedItems) = [];
GVAR(AssignedItemsInfo) = []; GVAR(AssignedItemsInfo) = [];

View File

@ -17,19 +17,17 @@ params ["_number", ["_minLength", 8]];
_number = round _number; _number = round _number;
private ["_array", "_index", "_rest"]; private _array = [];
_array = [];
_array resize _minLength; _array resize _minLength;
for "_index" from 0 to (_minLength - 1) do { for "_index" from 0 to (_minLength - 1) do {
_array set [_index, false]; _array set [_index, false];
}; };
_index = 0; private _index = 0;
while {_number > 0} do { while {_number > 0} do {
_rest = _number mod 2; private _rest = _number mod 2;
_number = floor (_number / 2); _number = floor (_number / 2);
_array set [_index, _rest == 1]; _array set [_index, _rest == 1];

View File

@ -9,32 +9,24 @@
* Magazine of the units binocular <STRING> * Magazine of the units binocular <STRING>
* *
* Example: * Example:
* [player] call ace_common_fnc_binocularMagazine * player call ace_common_fnc_binocularMagazine
* *
* Public: Yes * Public: Yes
*
* Note: Doesn't work on dead units
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_unit"]; params [["_unit", objNull, [objNull]]];
private ["_binocular", "_muzzle", "_mode", "_magazine"]; private _binocular = binocular _unit;
_binocular = binocular _unit; scopeName "main";
if (_binocular == "") exitWith {""}; {
if ((_x select 0) isEqualTo _binocular) then {
// note: if there is no magazine, _x(4,0) will be nil, which skips the breakOut.
(_x select 4 select 0) breakOut "main";
};
false
} count weaponsitems _unit;
_muzzle = currentMuzzle _unit; ""
_mode = currentWeaponMode _unit;
_unit selectWeapon _binocular;
// didn't select the binocular (unit probably dead or not local). function won't work. quit with empty string
if (currentWeapon _unit != _binocular) exitWith {""};
_magazine = currentMagazine _unit;
[_unit, _muzzle, _mode] call FUNC(selectWeaponMode);
_magazine

View File

@ -24,10 +24,8 @@ if ((_namespace getVariable [_uid, [-99999]]) select 0 < ACE_diagTime) then {
// Does the cache needs to be cleared on an event? // Does the cache needs to be cleared on an event?
if (!isNil "_event") then { if (!isNil "_event") then {
private ["_varName", "_cacheList"]; private _varName = format [QGVAR(clearCache_%1), _event];
private _cacheList = missionNamespace getVariable _varName;
_varName = format [QGVAR(clearCache_%1), _event];
_cacheList = missionNamespace getVariable _varName;
// If there was no EH to clear these caches, add one // If there was no EH to clear these caches, add one
if (isNil "_cacheList") then { if (isNil "_cacheList") then {
@ -35,14 +33,13 @@ if ((_namespace getVariable [_uid, [-99999]]) select 0 < ACE_diagTime) then {
missionNamespace setVariable [_varName, _cacheList]; missionNamespace setVariable [_varName, _cacheList];
[_event, { [_event, {
private ["_varName", "_cacheList"];
// _eventName is defined on the function that calls the event // _eventName is defined on the function that calls the event
#ifdef DEBUG_MODE_FULL #ifdef DEBUG_MODE_FULL
ACE_LOGINFO_1("Clear cached variables on event: %1",_eventName); ACE_LOGINFO_1("Clear cached variables on event: %1",_eventName);
#endif #endif
// Get the list of caches to clear // Get the list of caches to clear
_varName = format [QGVAR(clearCache_%1), _eventName]; private _varName = format [QGVAR(clearCache_%1), _eventName];
_cacheList = missionNamespace getVariable [_varName, []]; private _cacheList = missionNamespace getVariable [_varName, []];
// Erase all the cached results // Erase all the cached results
{ {
_x call FUNC(eraseCache); _x call FUNC(eraseCache);

View File

@ -27,19 +27,19 @@ _position = toLower _position;
// general // general
if (!alive _vehicle || {locked _vehicle > 1}) exitWith {false}; if (!alive _vehicle || {locked _vehicle > 1}) exitWith {false};
private ["_config", "_turret", "_radius", "_selectionPosition", "_selectionPosition2", "_enemiesInVehicle", "_return"]; private ["_selectionPosition", "_selectionPosition2"];
_config = configFile >> "CfgVehicles" >> typeOf _vehicle; private _config = configFile >> "CfgVehicles" >> typeOf _vehicle;
_turret = []; private _turret = [];
_radius = 0; private _radius = 0;
_enemiesInVehicle = false; //Possible Side Restriction private _enemiesInVehicle = false; //Possible Side Restriction
{ {
if (side _unit getFriend side _x < 0.6) exitWith {_enemiesInVehicle = true}; if (side _unit getFriend side _x < 0.6) exitWith {_enemiesInVehicle = true};
} forEach crew _vehicle; } forEach crew _vehicle;
_return = false; private _return = false;
switch (_position) do { switch (_position) do {
case "driver" : { case "driver" : {
_radius = getNumber (_config >> "getInRadius"); _radius = getNumber (_config >> "getInRadius");
@ -60,11 +60,10 @@ switch (_position) do {
}; };
case "gunner" : { case "gunner" : {
private "_turretConfig";
_turret = [_vehicle] call FUNC(getTurretGunner); _turret = [_vehicle] call FUNC(getTurretGunner);
if (_turret isEqualTo []) exitWith {false}; if (_turret isEqualTo []) exitWith {false};
_turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); private _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
_radius = getNumber (_config >> "getInRadius"); _radius = getNumber (_config >> "getInRadius");
_selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner"));
@ -73,11 +72,10 @@ switch (_position) do {
}; };
case "commander" : { case "commander" : {
private "_turretConfig";
_turret = [_vehicle] call FUNC(getTurretCommander); _turret = [_vehicle] call FUNC(getTurretCommander);
if (_turret isEqualTo []) exitWith {false}; if (_turret isEqualTo []) exitWith {false};
_turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); private _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
_radius = getNumber (_config >> "getInRadius"); _radius = getNumber (_config >> "getInRadius");
_selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner"));
@ -86,11 +84,10 @@ switch (_position) do {
}; };
case "copilot" : { case "copilot" : {
private "_turretConfig";
_turret = [_vehicle] call FUNC(getTurretCopilot); _turret = [_vehicle] call FUNC(getTurretCopilot);
if (_turret isEqualTo []) exitWith {false}; if (_turret isEqualTo []) exitWith {false};
_turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); private _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
_radius = getNumber (_config >> "getInRadius"); _radius = getNumber (_config >> "getInRadius");
_selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner"));
@ -99,13 +96,12 @@ switch (_position) do {
}; };
case "turret" : { case "turret" : {
private ["_turrets", "_turretConfig"]; private _turrets = [_vehicle] call FUNC(getTurretsOther);
_turrets = [_vehicle] call FUNC(getTurretsOther);
if (_index != -1 && {_turret = _turrets select _index; if (_index != -1 && {_turret = _turrets select _index;
CANGETINTURRETINDEX CANGETINTURRETINDEX
}) then { }) then {
_turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); private _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
_radius = getNumber (_config >> "getInRadius"); _radius = getNumber (_config >> "getInRadius");
_selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner"));
@ -115,7 +111,7 @@ switch (_position) do {
for "_index" from 0 to (count _turrets - 1) do { for "_index" from 0 to (count _turrets - 1) do {
_turret = _turrets select _index; _turret = _turrets select _index;
if (CANGETINTURRETINDEX) exitWith { if (CANGETINTURRETINDEX) exitWith {
_turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); private _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
_radius = getNumber (_config >> "getInRadius"); _radius = getNumber (_config >> "getInRadius");
_selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner"));
@ -127,13 +123,12 @@ switch (_position) do {
}; };
case "ffv" : { case "ffv" : {
private ["_turrets", "_turretConfig"]; private _turrets = [_vehicle] call FUNC(getTurretsFFV);
_turrets = [_vehicle] call FUNC(getTurretsFFV);
if (_index != -1 && {_turret = _turrets select _index; if (_index != -1 && {_turret = _turrets select _index;
CANGETINTURRETINDEX CANGETINTURRETINDEX
}) then { }) then {
_turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); private _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
_radius = getNumber (_config >> "getInRadius"); _radius = getNumber (_config >> "getInRadius");
_selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner"));
@ -143,7 +138,7 @@ switch (_position) do {
for "_index" from 0 to (count _turrets - 1) do { for "_index" from 0 to (count _turrets - 1) do {
_turret = _turrets select _index; _turret = _turrets select _index;
if (CANGETINTURRETINDEX) exitWith { if (CANGETINTURRETINDEX) exitWith {
_turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); private _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
_radius = getNumber (_config >> "getInRadius"); _radius = getNumber (_config >> "getInRadius");
_selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner"));
@ -155,8 +150,7 @@ switch (_position) do {
}; };
case "codriver" : { case "codriver" : {
private "_positions"; private _positions = [typeOf _vehicle] call FUNC(getVehicleCodriver);
_positions = [typeOf _vehicle] call FUNC(getVehicleCodriver);
{ {
if (alive _x) then {_positions deleteAt (_positions find (_vehicle getCargoIndex _x))}; if (alive _x) then {_positions deleteAt (_positions find (_vehicle getCargoIndex _x))};
@ -189,8 +183,7 @@ switch (_position) do {
}; };
case "cargo" : { case "cargo" : {
private "_positions"; private _positions = [typeOf _vehicle] call FUNC(getVehicleCargo);
_positions = [typeOf _vehicle] call FUNC(getVehicleCargo);
{ {
if (alive _x) then {_positions deleteAt (_positions find (_vehicle getCargoIndex _x))}; if (alive _x) then {_positions deleteAt (_positions find (_vehicle getCargoIndex _x))};
@ -226,14 +219,11 @@ switch (_position) do {
default {}; default {};
}; };
private "_fnc_isInRange"; private _fnc_isInRange = {
_fnc_isInRange = {
if (_radius == 0) exitWith {true}; if (_radius == 0) exitWith {true};
private ["_unitPosition", "_distance"]; private _unitPosition = getPos _unit;
_unitPosition = getPos _unit; private _distance = _unitPosition distance (_vehicle modelToWorldVisual _selectionPosition);
_distance = _unitPosition distance (_vehicle modelToWorldVisual _selectionPosition);
if (!isNil "_selectionPosition2") then { if (!isNil "_selectionPosition2") then {
_distance = _distance min (_unitPosition distance (_vehicle modelToWorldVisual _selectionPosition2)); _distance = _distance min (_unitPosition distance (_vehicle modelToWorldVisual _selectionPosition2));

View File

@ -18,20 +18,17 @@ params ["_unit", "_target", ["_exceptions", []]];
_exceptions = [_exceptions, {toLower _this}] call FUNC(map); _exceptions = [_exceptions, {toLower _this}] call FUNC(map);
private "_owner"; private _owner = _target getVariable [QGVAR(owner), objNull];
_owner = _target getVariable [QGVAR(owner), objNull];
// exit if the target is not free to interact // exit if the target is not free to interact
if (!isNull _owner && {_unit != _owner}) exitWith {false}; if (!isNull _owner && {_unit != _owner}) exitWith {false};
// check general conditions // check general conditions
private ["_conditions", "_canInteract"]; private _conditions = missionNamespace getVariable [QGVAR(InteractionConditions), [[],[]]];
_conditions = missionNamespace getVariable [QGVAR(InteractionConditions), [[],[]]];
_conditions params ["_conditionNames", "_conditionFuncs"]; _conditions params ["_conditionNames", "_conditionFuncs"];
_canInteract = true; private _canInteract = true;
{ {
if (!(_x in _exceptions) && {!([_unit, _target] call (_conditionFuncs select _forEachIndex))}) exitWith { if (!(_x in _exceptions) && {!([_unit, _target] call (_conditionFuncs select _forEachIndex))}) exitWith {
_canInteract = false; _canInteract = false;

View File

@ -13,12 +13,11 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_unit"]; params [["_unit", objNull, [objNull]]];
if (_unit == vehicle _unit) exitWith {true}; if (_unit == vehicle _unit) exitWith {true};
private "_config"; private _config = configFile >> "CfgMovesMaleSdr" >> "States" >> animationState _unit;
_config = configFile >> "CfgMovesMaleSdr" >> "States" >> animationState _unit;
isClass _config isClass _config
&& {getNumber (_config >> "canPullTrigger") == 1} && {getNumber (_config >> "canPullTrigger") == 1}

View File

@ -17,14 +17,12 @@
params ["_projectile", "_adjustDir", "_adjustUp", ["_adjustSpeed",0]]; params ["_projectile", "_adjustDir", "_adjustUp", ["_adjustSpeed",0]];
private ["_vdir", "_dir", "_up", "_vlat", "_vup", "_vel"];
// get old direction vector // get old direction vector
_vdir = vectorNormalized velocity _projectile; private _vdir = vectorNormalized velocity _projectile;
// get azimuth and inclination and apply corrections // get azimuth and inclination and apply corrections
_dir = (_vdir select 0) atan2 (_vdir select 1) + _adjustDir; private _dir = (_vdir select 0) atan2 (_vdir select 1) + _adjustDir;
_up = asin (_vdir select 2) + _adjustUp; private _up = asin (_vdir select 2) + _adjustUp;
// get new direction vector (this is a unit vector) // get new direction vector (this is a unit vector)
_vdir = [ _vdir = [
@ -34,11 +32,11 @@ _vdir = [
]; ];
// get best up vector // get best up vector
_vlat = vectorNormalized (_vdir vectorCrossProduct [0,0,1]); private _vlat = vectorNormalized (_vdir vectorCrossProduct [0,0,1]);
_vup = _vlat vectorCrossProduct _vdir; private _vup = _vlat vectorCrossProduct _vdir;
// get new speed vector. Keep total speed, but change to new direction. Yay for vector commands. // get new speed vector. Keep total speed, but change to new direction. Yay for vector commands.
_vel = _vdir vectorMultiply (_adjustSpeed + vectorMagnitude velocity _projectile); private _vel = _vdir vectorMultiply (_adjustSpeed + vectorMagnitude velocity _projectile);
// set projectile direction dir and up. Projectiles are long objects, especially with tracers, so it would look dumb otherwise. // set projectile direction dir and up. Projectiles are long objects, especially with tracers, so it would look dumb otherwise.
_projectile setVectorDirAndUp [_vdir, _vup]; _projectile setVectorDirAndUp [_vdir, _vup];

View File

@ -15,21 +15,18 @@
/////////////// ///////////////
// check addons // check addons
/////////////// ///////////////
private "_version"; private _version = getText (configFile >> "CfgPatches" >> "ace_main" >> "versionStr");
_version = getText (configFile >> "CfgPatches" >> "ace_main" >> "versionStr");
ACE_LOGINFO_1("ACE is version %1.",_version); ACE_LOGINFO_1("ACE is version %1.",_version);
private "_addons"; //private _addons = activatedAddons; // broken with High-Command module, see #2134
//_addons = activatedAddons; // broken with High-Command module, see #2134 private _addons = "true" configClasses (configFile >> "CfgPatches");//
_addons = "true" configClasses (configFile >> "CfgPatches");//
_addons = [_addons, {toLower configName _this}] call FUNC(map);// _addons = [_addons, {toLower configName _this}] call FUNC(map);//
_addons = [_addons, {_this find "ace_" == 0}] call FUNC(filter); _addons = [_addons, {_this find "ace_" == 0}] call FUNC(filter);
{ {
if (getText (configFile >> "CfgPatches" >> _x >> "versionStr") != _version) then { if (getText (configFile >> "CfgPatches" >> _x >> "versionStr") != _version) then {
private "_errorMsg"; private _errorMsg = format ["File %1.pbo is outdated.", _x];
_errorMsg = format ["File %1.pbo is outdated.", _x];
ACE_LOGERROR(_errorMsg); ACE_LOGERROR(_errorMsg);
@ -44,12 +41,10 @@ _addons = [_addons, {_this find "ace_" == 0}] call FUNC(filter);
// check dlls // check dlls
/////////////// ///////////////
{ {
private "_versionEx"; private _versionEx = _x callExtension "version";
_versionEx = _x callExtension "version";
if (_versionEx == "") then { if (_versionEx == "") then {
private "_errorMsg"; private _errorMsg = format ["Extension %1.dll not installed.", _x];
_errorMsg = format ["Extension %1.dll not installed.", _x];
ACE_LOGERROR(_errorMsg); ACE_LOGERROR(_errorMsg);
@ -84,8 +79,7 @@ if (isMultiplayer) then {
(_this select 0) params ["_version", "_addons"]; (_this select 0) params ["_version", "_addons"];
if (_version != GVAR(ServerVersion)) then { if (_version != GVAR(ServerVersion)) then {
private "_errorMsg"; private _errorMsg = format ["Client/Server Version Mismatch. Server: %1, Client: %2.", GVAR(ServerVersion), _version];
_errorMsg = format ["Client/Server Version Mismatch. Server: %1, Client: %2.", GVAR(ServerVersion), _version];
ACE_LOGERROR(_errorMsg); ACE_LOGERROR(_errorMsg);

View File

@ -9,7 +9,7 @@
* 1 = Warn permanently * 1 = Warn permanently
* 2 = Kick * 2 = Kick
* 1: Check all PBOs? (default: false) <BOOL> * 1: Check all PBOs? (default: false) <BOOL>
* 2: Whitelist (default: "[]") <STRING> * 2: Whitelist (default: "") <STRING>
* *
* Return Value: * Return Value:
* None * None
@ -18,9 +18,13 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_mode", ["_checkAll", false], ["_whitelist", "[]"]]; params ["_mode", ["_checkAll", false], ["_whitelist", "", [""]]];
TRACE_3("params",_mode,_checkAll,_whitelist);
_whitelist = [_whitelist, {toLower _this}] call FUNC(map); //lowercase and convert whiteList String into array of strings:
_whitelist = toLower _whitelist;
_whitelist = _whitelist splitString "[,""']";
TRACE_1("Array",_whitelist);
ACE_Version_CheckAll = _checkAll; ACE_Version_CheckAll = _checkAll;
ACE_Version_Whitelist = _whitelist; ACE_Version_Whitelist = _whitelist;
@ -37,10 +41,8 @@ if (!isServer) then {
// Display error message. // Display error message.
if (_missingAddon || {_missingAddonServer} || {_oldVersionClient} || {_oldVersionServer}) then { if (_missingAddon || {_missingAddonServer} || {_oldVersionClient} || {_oldVersionServer}) then {
private ["_text", "_error"]; private _text = "[ACE] Version mismatch:<br/><br/>";
private _error = format ["ACE version mismatch: %1: ", profileName];
_text = "[ACE] Version mismatch:<br/><br/>";
_error = format ["ACE version mismatch: %1: ", profileName];
if (_missingAddon) then { if (_missingAddon) then {
_text = _text + "Detected missing addon on client<br/>"; _text = _text + "Detected missing addon on client<br/>";
@ -65,25 +67,29 @@ if (!isServer) then {
if (_mode < 2) then { if (_mode < 2) then {
_text = composeText [lineBreak, parseText format ["<t align='center'>%1</t>", _text]]; _text = composeText [lineBreak, parseText format ["<t align='center'>%1</t>", _text]];
private ["_rscLayer", "_ctrlHint"]; private _rscLayer = "ACE_RscErrorHint" call BIS_fnc_rscLayer;
_rscLayer = "ACE_RscErrorHint" call BIS_fnc_rscLayer;
_rscLayer cutRsc ["ACE_RscErrorHint", "PLAIN", 0, true]; _rscLayer cutRsc ["ACE_RscErrorHint", "PLAIN", 0, true];
disableSerialization; disableSerialization;
_ctrlHint = uiNamespace getVariable "ACE_ctrlErrorHint"; private _ctrlHint = uiNamespace getVariable "ACE_ctrlErrorHint";
_ctrlHint ctrlSetStructuredText _text; _ctrlHint ctrlSetStructuredText _text;
if (_mode == 0) then { if (_mode == 0) then {
sleep 10; [{
_rscLayer cutFadeOut 0.2; params ["_rscLayer"];
TRACE_2("Hiding Error message after 10 seconds",time,_rscLayer);
_rscLayer cutFadeOut 0.2;
}, [_rscLayer], 10] call FUNC(waitAndExecute);
}; };
}; };
if (_mode == 2) then { if (_mode == 2) then {
waitUntil {alive player}; // To be able to show list if using checkAll [{alive player}, { // To be able to show list if using checkAll
_text = composeText [parseText format ["<t align='center'>%1</t>", _text]]; params ["_text"];
["[ACE] ERROR", _text, {findDisplay 46 closeDisplay 0}] call FUNC(errorMessage); TRACE_2("Player is alive, showing msg and exiting",time,_text);
_text = composeText [parseText format ["<t align='center'>%1</t>", _text]];
["[ACE] ERROR", _text, {findDisplay 46 closeDisplay 0}] call FUNC(errorMessage);
}, [_text]] call FUNC(waitUntilAndExecute);
}; };
}; };

View File

@ -16,8 +16,7 @@
params ["_unit", "_target", ["_lockTarget", false]]; params ["_unit", "_target", ["_lockTarget", false]];
private "_owner"; private _owner = _target getVariable [QGVAR(owner), objNull];
_owner = _target getVariable [QGVAR(owner), objNull];
if (!isNull _owner && {!isNull _unit} && {_unit != _owner}) then { if (!isNull _owner && {!isNull _unit} && {_unit != _owner}) then {
ACE_LOGERROR("Claiming already owned object."); ACE_LOGERROR("Claiming already owned object.");

View File

@ -14,10 +14,10 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_v1", "_v2", "_v3"]; [_this] params [["_vector", [0,0,1], [[]], 3]];
_v1 = vectorNormalized _this; private _v1 = vectorNormalized _this;
_v2 = vectorNormalized (_v1 vectorCrossProduct [0,0,1]); private _v2 = vectorNormalized (_v1 vectorCrossProduct [0,0,1]);
_v3 = _v2 vectorCrossProduct _v1; private _v3 = _v2 vectorCrossProduct _v1;
[_v1,_v2,_v3] [_v1, _v2, _v3]

View File

@ -15,8 +15,7 @@
#define CHANNELS ["global", "side", "command", "group", "vehicle", "direct"] #define CHANNELS ["global", "side", "command", "group", "vehicle", "direct"]
#define CHANNELS_LOCALIZED [localize "str_channel_global", localize "str_channel_side", localize "str_channel_command", localize "str_channel_group", localize "str_channel_vehicle", localize "str_channel_direct"] #define CHANNELS_LOCALIZED [localize "str_channel_global", localize "str_channel_side", localize "str_channel_command", localize "str_channel_group", localize "str_channel_vehicle", localize "str_channel_direct"]
private "_currentChannel"; private _currentChannel = currentChannel;
_currentChannel = currentChannel;
if (_currentChannel < count CHANNELS) then { if (_currentChannel < count CHANNELS) then {
_currentChannel = CHANNELS select _currentChannel; _currentChannel = CHANNELS select _currentChannel;

View File

@ -18,20 +18,15 @@
params ["_msg", ["_level", 2, [0]]]; params ["_msg", ["_level", 2, [0]]];
private ["_defaultLoglevel", "_defaultLogDisplayLevel"]; private _defaultLoglevel = missionNamespace getVariable [QGVAR(LOGLEVEL), DEFAULT_LOGGING_LEVEL];
_defaultLoglevel = [GVAR(LOGLEVEL), DEFAULT_LOGGING_LEVEL] select isNil QGVAR(LOGLEVEL);
if (_defaultLoglevel < 0) exitWith {false}; if (_defaultLoglevel < 0) exitWith {false};
_defaultLogDisplayLevel = [GVAR(LOGDISPLAY_LEVEL), DEFAULT_TEXT_DISPLAY] select isNil QGVAR(LOGDISPLAY_LEVEL); private _defaultLogDisplayLevel = [GVAR(LOGDISPLAY_LEVEL), DEFAULT_TEXT_DISPLAY] select isNil QGVAR(LOGDISPLAY_LEVEL);
if (_level <= _defaultLoglevel) then { if (_level <= _defaultLoglevel) then {
private ["_prefix", "_message"]; private _prefix = ["Unknown", "Error", "Warn", "Debug", "Info"] select ([0, 1, 2, 3] find _level + 1);
private _message = format ["[ACE %1] %2", _prefix, _msg];
_prefix = ["Unknown", "Error", "Warn", "Debug", "Info"] select ([0, 1, 2, 3] find _level + 1);
_message = format ["[ACE %1] %2", _prefix, _msg];
if (_level <= _defaultLogDisplayLevel) then { if (_level <= _defaultLogDisplayLevel) then {
systemChat _message; systemChat _message;

View File

@ -18,9 +18,7 @@
params [["_searchOffsetOrName", 0]]; params [["_searchOffsetOrName", 0]];
private ["_validIndex", "_realIndex"]; private _validIndex = -1;
_validIndex = -1;
if (_searchOffsetOrName isEqualType "") then { if (_searchOffsetOrName isEqualType "") then {
{ {
@ -33,7 +31,7 @@ if (_searchOffsetOrName isEqualType "") then {
_baseIndex = [GVAR(deviceKeyCurrentIndex) + _searchOffsetOrName, 0] select (GVAR(deviceKeyCurrentIndex) == -1); _baseIndex = [GVAR(deviceKeyCurrentIndex) + _searchOffsetOrName, 0] select (GVAR(deviceKeyCurrentIndex) == -1);
for "_offset" from _baseIndex to (count GVAR(deviceKeyHandlingArray) - 1 + _baseIndex) do { for "_offset" from _baseIndex to (count GVAR(deviceKeyHandlingArray) - 1 + _baseIndex) do {
_realIndex = _offset % (count GVAR(deviceKeyHandlingArray)); private _realIndex = _offset % (count GVAR(deviceKeyHandlingArray));
if ([] call ((GVAR(deviceKeyHandlingArray) select _realIndex) select 2)) exitWith { if ([] call ((GVAR(deviceKeyHandlingArray) select _realIndex) select 2)) exitWith {
_validIndex = _realIndex; _validIndex = _realIndex;

View File

@ -16,7 +16,7 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_unit", "_disable"]; params [["_unit", objNull, [objNull]], ["_disable", true, [false]]];
if (!local _unit) exitWith {}; if (!local _unit) exitWith {};

View File

@ -31,8 +31,7 @@ if (_state) then {
closeDialog 0; closeDialog 0;
createDialog QGVAR(DisableMouse_Dialog); createDialog QGVAR(DisableMouse_Dialog);
private "_dlg"; private _dlg = uiNamespace getVariable QGVAR(dlgDisableMouse);
_dlg = uiNamespace getVariable QGVAR(dlgDisableMouse);
_dlg displayAddEventHandler ["KeyDown", { _dlg displayAddEventHandler ["KeyDown", {
params ["", "_key"]; params ["", "_key"];
@ -42,15 +41,13 @@ if (_state) then {
disableSerialization; disableSerialization;
private ["_dlg", "_ctrl"]; private _dlg = findDisplay 49;
_dlg = findDisplay 49;
for "_index" from 100 to 2000 do { for "_index" from 100 to 2000 do {
(_dlg displayCtrl _index) ctrlEnable false; (_dlg displayCtrl _index) ctrlEnable false;
}; };
_ctrl = _dlg displayctrl 103; private _ctrl = _dlg displayctrl 103;
_ctrl ctrlSetEventHandler ["buttonClick", QUOTE(while {!isNull (uiNamespace getVariable [ARR_2(QUOTE(QGVAR(dlgDisableMouse)),displayNull)])} do {closeDialog 0}; failMission 'LOSER'; [false] call DFUNC(disableUserInput);)]; _ctrl ctrlSetEventHandler ["buttonClick", QUOTE(while {!isNull (uiNamespace getVariable [ARR_2(QUOTE(QGVAR(dlgDisableMouse)),displayNull)])} do {closeDialog 0}; failMission 'LOSER'; [false] call DFUNC(disableUserInput);)];
_ctrl ctrlEnable true; _ctrl ctrlEnable true;
_ctrl ctrlSetText "ABORT"; _ctrl ctrlSetText "ABORT";
@ -58,7 +55,7 @@ if (_state) then {
_ctrl = _dlg displayctrl ([104, 1010] select isMultiplayer); _ctrl = _dlg displayctrl ([104, 1010] select isMultiplayer);
_ctrl ctrlSetEventHandler ["buttonClick", QUOTE(closeDialog 0; player setDamage 1; [false] call DFUNC(disableUserInput);)]; _ctrl ctrlSetEventHandler ["buttonClick", QUOTE(closeDialog 0; player setDamage 1; [false] call DFUNC(disableUserInput);)];
_ctrl ctrlEnable (call {private "_config"; _config = missionConfigFile >> "respawnButton"; !isNumber _config || {getNumber _config == 1}}); _ctrl ctrlEnable (call {private _config = missionConfigFile >> "respawnButton"; !isNumber _config || {getNumber _config == 1}});
_ctrl ctrlSetText "RESPAWN"; _ctrl ctrlSetText "RESPAWN";
_ctrl ctrlSetTooltip "Respawn."; _ctrl ctrlSetTooltip "Respawn.";
}; };
@ -66,8 +63,7 @@ if (_state) then {
if (_key in actionKeys "TeamSwitch" && {teamSwitchEnabled}) then { if (_key in actionKeys "TeamSwitch" && {teamSwitchEnabled}) then {
(uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull]) closeDisplay 0; (uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull]) closeDisplay 0;
private "_acc"; private _acc = accTime;
_acc = accTime;
teamSwitch; teamSwitch;
setAccTime _acc; setAccTime _acc;
}; };

View File

@ -45,14 +45,11 @@ disableSerialization;
params ["_iconId", "_show", "_icon", "_color", ["_timeAlive", DEFAULT_TIME]]; params ["_iconId", "_show", "_icon", "_color", ["_timeAlive", DEFAULT_TIME]];
private ["_list", "_refresh"]; private _list = missionNamespace getVariable [QGVAR(displayIconList), []];
_list = missionNamespace getVariable [QGVAR(displayIconList), []]; private _refresh = {
_refresh = {
// Refreshing of all icons.. // Refreshing of all icons..
private "_allControls"; private _allControls = missionNamespace getVariable [QGVAR(displayIconListControls), []];
_allControls = missionNamespace getVariable [QGVAR(displayIconListControls), []];
{ {
ctrlDelete _x; ctrlDelete _x;
@ -61,18 +58,16 @@ _refresh = {
_allControls = []; _allControls = [];
private ["_setting", "_ctrl", "_position"]; private _setting = missionNamespace getVariable [QGVAR(settingFeedbackIcons), 0];
_setting = missionNamespace getVariable [QGVAR(settingFeedbackIcons), 0];
if (_setting > 0) then { if (_setting > 0) then {
{ {
_x params ["", "_xicon", "_xcolor"]; _x params ["", "_xicon", "_xcolor"];
// +19000 because we want to make certain we are using free IDCs.. // +19000 because we want to make certain we are using free IDCs..
_ctrl = (findDisplay 46) ctrlCreate ["RscPicture", _forEachIndex + 19000]; private _ctrl = (findDisplay 46) ctrlCreate ["RscPicture", _forEachIndex + 19000];
_position = switch (_setting) do { private _position = switch (_setting) do {
case TOP_RIGHT_DOWN: {[X_POS_ICONS, Y_POS_ICONS + (_forEachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]}; case TOP_RIGHT_DOWN: {[X_POS_ICONS, Y_POS_ICONS + (_forEachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]};
case TOP_RIGHT_LEFT: {[X_POS_ICONS_SECOND - ((_forEachIndex+3) * DIFFERENCE_ICONS), Y_POS_ICONS_SECOND - (ICON_WIDTH / 2), ICON_WIDTH, ICON_WIDTH]}; case TOP_RIGHT_LEFT: {[X_POS_ICONS_SECOND - ((_forEachIndex+3) * DIFFERENCE_ICONS), Y_POS_ICONS_SECOND - (ICON_WIDTH / 2), ICON_WIDTH, ICON_WIDTH]};
case TOP_LEFT_DOWN: {[LEFT_SIDE + (0.5 * ICON_WIDTH), Y_POS_ICONS + (_forEachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]}; case TOP_LEFT_DOWN: {[LEFT_SIDE + (0.5 * ICON_WIDTH), Y_POS_ICONS + (_forEachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]};
@ -115,8 +110,7 @@ if (_show) then {
} else { } else {
if ({_x select 0 == _iconId} count _list == 1) then { if ({_x select 0 == _iconId} count _list == 1) then {
private "_newList"; private _newList = [];
_newList = [];
{ {
if (_x select 0 != _iconId) then { if (_x select 0 != _iconId) then {

View File

@ -23,12 +23,9 @@ if (isNil QGVAR(lastHint)) then {
if !(typeName _text in ["STRING", "TEXT"]) then {_text = str _text}; if !(typeName _text in ["STRING", "TEXT"]) then {_text = str _text};
private ["_lastHintTime", "_lastHintPriority", "_time"]; GVAR(lastHint) params ["_lastHintTime", "_lastHintPriority"];
_lastHintTime = GVAR(lastHint) select 0; private _time = ACE_time;
_lastHintPriority = GVAR(lastHint) select 1;
_time = ACE_time;
if (_time > _lastHintTime + _delay || {_priority >= _lastHintPriority}) then { if (_time > _lastHintTime + _delay || {_priority >= _lastHintPriority}) then {
hintSilent _text; hintSilent _text;

View File

@ -35,36 +35,34 @@ if (typeName _text != "TEXT") then {
_text = composeText [lineBreak, parseText format ["<t align='center'>%1</t>", _text]]; _text = composeText [lineBreak, parseText format ["<t align='center'>%1</t>", _text]];
}; };
private ["_isShown", "_ctrlHint", "_xPos", "_yPos", "_wPos", "_hPos", "_position"]; private _isShown = ctrlShown (uiNamespace getVariable ["ACE_ctrlHint", controlNull]);
_isShown = ctrlShown (uiNamespace getVariable ["ACE_ctrlHint", controlNull]);
("ACE_RscHint" call BIS_fnc_rscLayer) cutRsc ["ACE_RscHint", "PLAIN", 0, true]; ("ACE_RscHint" call BIS_fnc_rscLayer) cutRsc ["ACE_RscHint", "PLAIN", 0, true];
disableSerialization; disableSerialization;
_ctrlHint = uiNamespace getVariable "ACE_ctrlHint"; private _ctrlHint = uiNamespace getVariable "ACE_ctrlHint";
_ctrlHint ctrlSetBackgroundColor GVAR(displayTextColor); _ctrlHint ctrlSetBackgroundColor GVAR(displayTextColor);
_ctrlHint ctrlSetTextColor GVAR(displayTextFontColor); _ctrlHint ctrlSetTextColor GVAR(displayTextFontColor);
/* /*
// This does not function at the moment. Has been disabled until it fixed. // This does not function at the moment. Has been disabled until it fixed.
_xPos = profilenamespace getVariable ["IGUI_GRID_ACE_displayText_X", ((safezoneX + safezoneW) - (10 *(((safezoneW / safezoneH) min 1.2) / 40)) - 2.9 *(((safezoneW / safezoneH) min 1.2) / 40))]; private _xPos = profilenamespace getVariable ["IGUI_GRID_ACE_displayText_X", ((safezoneX + safezoneW) - (10 *(((safezoneW / safezoneH) min 1.2) / 40)) - 2.9 *(((safezoneW / safezoneH) min 1.2) / 40))];
_yPos = profilenamespace getVariable ["IGUI_GRID_ACE_displayText_Y", safeZoneY + 0.175 * safezoneH]; private _yPos = profilenamespace getVariable ["IGUI_GRID_ACE_displayText_Y", safeZoneY + 0.175 * safezoneH];
_wPos = profilenamespace getVariable ["IGUI_GRID_ACE_displayText_W", (10 *(((safezoneW / safezoneH) min 1.2) / 40))]; private _wPos = profilenamespace getVariable ["IGUI_GRID_ACE_displayText_W", (10 *(((safezoneW / safezoneH) min 1.2) / 40))];
_hPos = profilenamespace getVariable ["IGUI_GRID_ACE_displayText_H", (2 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))]; private _hPos = profilenamespace getVariable ["IGUI_GRID_ACE_displayText_H", (2 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))];
*/ */
_xPos = ((safezoneX + safezoneW) - (10 *(((safezoneW / safezoneH) min 1.2) / 40)) - 2.9 *(((safezoneW / safezoneH) min 1.2) / 40)); private _xPos = ((safezoneX + safezoneW) - (10 *(((safezoneW / safezoneH) min 1.2) / 40)) - 2.9 *(((safezoneW / safezoneH) min 1.2) / 40));
_yPos = safeZoneY + 0.175 * safezoneH; private _yPos = safeZoneY + 0.175 * safezoneH;
_wPos = (10 *(((safezoneW / safezoneH) min 1.2) / 40)); private _wPos = (10 *(((safezoneW / safezoneH) min 1.2) / 40));
_hPos = (2 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)); private _hPos = (2 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25));
// Zeus Interface Open and Display would be under the "CREATE" list // Zeus Interface Open and Display would be under the "CREATE" list
if (!isNull curatorCamera) then { if (!isNull curatorCamera) then {
_xPos = _xPos min ((safezoneX + safezoneW - 12.5 * (((safezoneW / safezoneH) min 1.2) / 40)) - _wPos); _xPos = _xPos min ((safezoneX + safezoneW - 12.5 * (((safezoneW / safezoneH) min 1.2) / 40)) - _wPos);
}; };
_position = [_xPos, _yPos, _wPos, _size * _hPos]; private _position = [_xPos, _yPos, _wPos, _size * _hPos];
_ctrlHint ctrlSetPosition _position; _ctrlHint ctrlSetPosition _position;
_ctrlHint ctrlCommit 0; _ctrlHint ctrlCommit 0;

View File

@ -12,11 +12,9 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_unit"]; params [["_unit", objNull, [objNull]]];
private ["_backpackObject", "_holder"]; private _backpackObject = backpackContainer _unit;
_backpackObject = backpackContainer _unit;
_unit addBackpack "ACE_FakeBackpack"; _unit addBackpack "ACE_FakeBackpack";
removeBackpack _unit; removeBackpack _unit;

View File

@ -19,8 +19,7 @@ if (!isNil "ACE_PFH_COUNTER") then {
{ {
_x params ["_pfh", "_parameters"]; _x params ["_pfh", "_parameters"];
private "_isActive"; private _isActive = ["ACTIVE", "REMOVED"] select isNil {CBA_common_PFHhandles select (_pfh select 0)};
_isActive = ["ACTIVE", "REMOVED"] select isNil {CBA_common_PFHhandles select (_pfh select 0)};
diag_log text format ["Registered PFH: id=%1 [%2, delay %3], %4:%5", _pfh select 0, _isActive, _parameters select 1, _pfh select 1, _pfh select 2]; diag_log text format ["Registered PFH: id=%1 [%2, delay %3], %4:%5", _pfh select 0, _isActive, _parameters select 1, _pfh select 1, _pfh select 2];
false false
@ -31,20 +30,18 @@ diag_log text format ["ACE COUNTER RESULTS"];
diag_log text format ["-------------------------------------------"]; diag_log text format ["-------------------------------------------"];
{ {
private ["_counterEntry", "_iter", "_total", "_count", "_averageResult", "_delta"]; private _counterEntry = _x;
private _iter = 0;
_counterEntry = _x; private _total = 0;
_iter = 0; private _count = 0;
_total = 0; private _averageResult = 0;
_count = 0;
_averageResult = 0;
if (count _counterEntry > 3) then { if (count _counterEntry > 3) then {
// calc // calc
{ {
if (_iter > 2) then { if (_iter > 2) then {
_count = _count + 1; _count = _count + 1;
_delta = (_x select 1) - (_x select 0); private _delta = (_x select 1) - (_x select 0);
_total = _total + _delta; _total = _total + _delta;
}; };
@ -69,8 +66,7 @@ diag_log text format ["-------------------------------------------"];
diag_log text format["ACE_PERFORMANCE_EXCESSIVE_STEP_TRACKER"]; diag_log text format["ACE_PERFORMANCE_EXCESSIVE_STEP_TRACKER"];
diag_log text format["-------------------------------------------"]; diag_log text format["-------------------------------------------"];
{ {
private["_delay"]; private _delay = _x select 2;
_delay = _x select 2;
//if(_delay > 0) then { _delay = _delay / 1000; }; //if(_delay > 0) then { _delay = _delay / 1000; };
diag_log text format["%1: %2s, delay=%3, handle=%4",(_x select 0), _delay, (_x select 3), (_x select 4)]; diag_log text format["%1: %2s, delay=%3, handle=%4",(_x select 0), _delay, (_x select 3), (_x select 4)];
@ -80,8 +76,7 @@ diag_log text format["-------------------------------------------"];
diag_log text format["ACE_PERFORMANCE_EXCESSIVE_FRAME_TRACKER"]; diag_log text format["ACE_PERFORMANCE_EXCESSIVE_FRAME_TRACKER"];
diag_log text format["-------------------------------------------"]; diag_log text format["-------------------------------------------"];
{ {
private["_delta"]; private _delta = _x select 1;
_delta = _x select 1;
//if(_delta > 0) then { _delta = _delta / 1000; }; //if(_delta > 0) then { _delta = _delta / 1000; };
diag_log text format[" DELTA: %1s", _delta]; diag_log text format[" DELTA: %1s", _delta];
} forEach ACE_PERFORMANCE_EXCESSIVE_FRAME_TRACKER; } forEach ACE_PERFORMANCE_EXCESSIVE_FRAME_TRACKER;

View File

@ -37,35 +37,29 @@ if (_textMessage isEqualType "") then {
(ARR_SELECT(_this,4,call BIS_fnc_displayMission)) createDisplay "RscDisplayCommonMessagePause"; (ARR_SELECT(_this,4,call BIS_fnc_displayMission)) createDisplay "RscDisplayCommonMessagePause";
private ["_display", "_ctrlRscMessageBox", "_ctrlBcgCommonTop", "_ctrlBcgCommon", "_ctrlText", "_ctrlBackgroundButtonOK", "_ctrlBackgroundButtonMiddle", "_ctrlBackgroundButtonCancel", "_ctrlButtonOK", "_ctrlButtonCancel"]; private _display = uiNamespace getVariable "RscDisplayCommonMessage_display";
private _ctrlRscMessageBox = _display displayCtrl 2351;
_display = uiNamespace getVariable "RscDisplayCommonMessage_display"; private _ctrlBcgCommonTop = _display displayCtrl 235100;
_ctrlRscMessageBox = _display displayCtrl 2351; private _ctrlBcgCommon = _display displayCtrl 235101;
_ctrlBcgCommonTop = _display displayCtrl 235100; private _ctrlText = _display displayCtrl 235102;
_ctrlBcgCommon = _display displayCtrl 235101; private _ctrlBackgroundButtonOK = _display displayCtrl 235103;
_ctrlText = _display displayCtrl 235102; private _ctrlBackgroundButtonMiddle = _display displayCtrl 235104;
_ctrlBackgroundButtonOK = _display displayCtrl 235103; private _ctrlBackgroundButtonCancel = _display displayCtrl 235105;
_ctrlBackgroundButtonMiddle = _display displayCtrl 235104; private _ctrlButtonOK = _display displayCtrl 235106;
_ctrlBackgroundButtonCancel = _display displayCtrl 235105; private _ctrlButtonCancel = _display displayCtrl 235107;
_ctrlButtonOK = _display displayCtrl 235106;
_ctrlButtonCancel = _display displayCtrl 235107;
_ctrlBcgCommonTop ctrlSetText _textHeader; _ctrlBcgCommonTop ctrlSetText _textHeader;
private ["_ctrlButtonOKPos", "_ctrlBcgCommonPos", "_bottomSpaceY", "_ctrlTextPos", "_marginX", "_marginY"]; private _ctrlButtonOKPos = ctrlPosition _ctrlButtonOK;
private _ctrlBcgCommonPos = ctrlPosition _ctrlBcgCommon;
private _bottomSpaceY = (_ctrlButtonOKPos select 1) - ((_ctrlBcgCommonPos select 1) + (_ctrlBcgCommonPos select 3));
_ctrlButtonOKPos = ctrlPosition _ctrlButtonOK; private _ctrlTextPos = ctrlPosition _ctrlText;
_ctrlBcgCommonPos = ctrlPosition _ctrlBcgCommon; private _marginX = (_ctrlTextPos select 0) - (_ctrlBcgCommonPos select 0);
_bottomSpaceY = (_ctrlButtonOKPos select 1) - ((_ctrlBcgCommonPos select 1) + (_ctrlBcgCommonPos select 3)); private _marginY = (_ctrlTextPos select 1) - (_ctrlBcgCommonPos select 1);
_ctrlTextPos = ctrlPosition _ctrlText;
_marginX = (_ctrlTextPos select 0) - (_ctrlBcgCommonPos select 0);
_marginY = (_ctrlTextPos select 1) - (_ctrlBcgCommonPos select 1);
private ["_ctrlTextPosH", "_bottomPosY"];
_ctrlText ctrlSetStructuredText _textMessage; _ctrlText ctrlSetStructuredText _textMessage;
_ctrlTextPosH = ctrlTextHeight _ctrlText; private _ctrlTextPosH = ctrlTextHeight _ctrlText;
_ctrlBcgCommon ctrlSetPosition [ _ctrlBcgCommon ctrlSetPosition [
_ctrlBcgCommonPos select 0, _ctrlBcgCommonPos select 0,
@ -83,11 +77,10 @@ _ctrlText ctrlSetPosition [
]; ];
_ctrlText ctrlCommit 0; _ctrlText ctrlCommit 0;
_bottomPosY = (_ctrlBcgCommonPos select 1) + _ctrlTextPosH + (_marginY * 2) + _bottomSpaceY; private _bottomPosY = (_ctrlBcgCommonPos select 1) + _ctrlTextPosH + (_marginY * 2) + _bottomSpaceY;
{ {
private "_xPos"; private _xPos = ctrlPosition _x;
_xPos = ctrlPosition _x;
_xPos set [1, _bottomPosY]; _xPos set [1, _bottomPosY];
_x ctrlSetPosition _xPos; _x ctrlSetPosition _xPos;
@ -100,10 +93,8 @@ _bottomPosY = (_ctrlBcgCommonPos select 1) + _ctrlTextPosH + (_marginY * 2) + _b
_ctrlButtonCancel _ctrlButtonCancel
]; ];
private ["_ctrlRscMessageBoxPos", "_ctrlRscMessageBoxPosH"]; private _ctrlRscMessageBoxPos = ctrlPosition _ctrlRscMessageBox;
private _ctrlRscMessageBoxPosH = _bottomPosY + (_ctrlButtonOKPos select 3);
_ctrlRscMessageBoxPos = ctrlPosition _ctrlRscMessageBox;
_ctrlRscMessageBoxPosH = _bottomPosY + (_ctrlButtonOKPos select 3);
_ctrlRscMessageBox ctrlSetPosition [ _ctrlRscMessageBox ctrlSetPosition [
0.5 - (_ctrlBcgCommonPos select 2) / 2, 0.5 - (_ctrlBcgCommonPos select 2) / 2,

View File

@ -28,12 +28,11 @@ _function = call compile _function;
[[_arguments, _unit], _this select 1, 2] call FUNC(execRemoteFnc); [[_arguments, _unit], _this select 1, 2] call FUNC(execRemoteFnc);
// save persistent function for JIP // save persistent function for JIP
private ["_persistentFunctions", "_index"]; private _persistentFunctions = _unit getVariable ["ACE_PersistentFunctions", []];
_persistentFunctions = _unit getVariable ["ACE_PersistentFunctions", []];
// find index to overwrite function with the same name, add to end otherwise // find index to overwrite function with the same name, add to end otherwise
_index = count _persistentFunctions; private _index = count _persistentFunctions;
{ {
if (_x select 2 == _name) exitWith { if (_x select 2 == _name) exitWith {
_index = _forEachIndex; _index = _forEachIndex;

View File

@ -15,26 +15,22 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private "_fnc_logEntries"; private _fnc_logEntries = {
_fnc_logEntries = {
params ["_c", "_d"]; params ["_c", "_d"];
private ["_p", "_t", "_e", "_a", "_i"]; private _p = inheritsFrom _c;
_p = inheritsFrom _c; private _t = format [["class %1: %2 {", "class %1 {"] select (configName _p == ""), configName _c, configName _p];
_t = format [["class %1: %2 {", "class %1 {"] select (configName _p == ""), configName _c, configName _p];
for "_a" from 1 to _d do { for "_a" from 1 to _d do {
_t = " " + _t; _t = " " + _t;
}; };
diag_log text _t; diag_log text _t;
_e = []; private _e = [];
for "_i" from 0 to (count _c - 1) do { for "_i" from 0 to (count _c - 1) do {
private ["_e1, _e2"]; private _e1 = _c select _i;
_e1 = _c select _i;
_e2 = switch (true) do { private _e2 = switch (true) do {
case (isNumber _e1): {getNumber _e1}; case (isNumber _e1): {getNumber _e1};
case (isText _e1): {getText _e1}; case (isText _e1): {getText _e1};
case (isArray _e1): {getArray _e1}; case (isArray _e1): {getArray _e1};

View File

@ -16,10 +16,9 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_array", "_code"]; params [["_array", [], [[]]], ["_code", {}, [{}]]];
private "_result"; private _result = [];
_result = [];
{ {
if (_x call _code) then { if (_x call _code) then {

View File

@ -14,11 +14,9 @@
params ["_crate"]; params ["_crate"];
private ["_weapons", "_items"];
// get all weapons inside the crate // get all weapons inside the crate
_weapons = weaponCargo _crate; private _weapons = weaponCargo _crate;
_items = []; private _items = [];
// if the "weapon" is supposed to be an item, move those from the weapon array to the item array // if the "weapon" is supposed to be an item, move those from the weapon array to the item array
{ {

View File

@ -12,19 +12,17 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private "_object"; params ["_object"];
_object = _this;
// setHitPointDamage requires local object // setHitPointDamage requires local object
if (!local _object) exitWith {}; if (!local _object) exitWith {};
// save and restore hitpoints, see below why // save and restore hitpoints, see below why
private "_hitPointDamages"; private _hitPointDamages = getAllHitPointsDamage _object;
_hitPointDamages = getAllHitPointsDamage _object;
// get correct format for objects without hitpoints // get correct format for objects without hitpoints
if (_hitPointDamages isEqualTo []) then { if (_hitPointDamages isEqualTo []) then {
_hitPointDamages = [[],[],[]]; _hitPointDamages = [[],[],[]];
}; };
// this prevents physx objects from floating when near other physx objects with allowDamage false // this prevents physx objects from floating when near other physx objects with allowDamage false

View File

@ -16,8 +16,7 @@
// setVectorUp requires local object // setVectorUp requires local object
if (!local _this) exitWith {}; if (!local _this) exitWith {};
private "_position"; private _position = getPos _this;
_position = getPos _this;
// don't place the object below the ground // don't place the object below the ground
if (_position select 2 < -0.1) then { if (_position select 2 < -0.1) then {

View File

@ -22,12 +22,10 @@ params ["_object", ["_category", ""]];
if (isNil QGVAR(OBJECT_VARIABLES_STORAGE)) exitWith {[]}; if (isNil QGVAR(OBJECT_VARIABLES_STORAGE)) exitWith {[]};
private ["_return", "_val"]; private _return = [];
_return = [];
{ {
_val = _object getVariable (_x select 0); private _val = _object getVariable (_x select 0);
if (!isNil "_val") then { if (!isNil "_val") then {
if (_category == "" || _category == _x select 3) then { if (_category == "" || _category == _x select 3) then {

View File

@ -14,13 +14,10 @@
params ["_unit"]; params ["_unit"];
private ["_captivityReasons", "_unitCaptivityStatus", "_unitCaptivityReasons"]; private _captivityReasons = missionNamespace getVariable ["ACE_captivityReasons", []];
private _unitCaptivityStatus = [captiveNum _unit, count _captivityReasons] call FUNC(binarizeNumber);
_captivityReasons = missionNamespace getVariable ["ACE_captivityReasons", []]; private _unitCaptivityReasons = [];
_unitCaptivityStatus = [captiveNum _unit, count _captivityReasons] call FUNC(binarizeNumber);
_unitCaptivityReasons = [];
{ {
if (_unitCaptivityStatus select _forEachIndex) then { if (_unitCaptivityStatus select _forEachIndex) then {

View File

@ -14,7 +14,6 @@
params ["_name", "_cfgClass"]; params ["_name", "_cfgClass"];
private "_classes"; private _classes = format ["configName inheritsFrom _x == '%1'", _name] configClasses (configFile >> _cfgClass);
_classes = format ["configName inheritsFrom _x == '%1'", _name] configClasses (configFile >> _cfgClass);
[_classes, {configName _this}] call FUNC(map) // return [_classes, {configName _this}] call FUNC(map) // return

View File

@ -14,9 +14,7 @@
params ["_vehicle"]; params ["_vehicle"];
private ["_config", "_turret"]; private _config = configFile >> "CfgVehicles" >> typeOf _vehicle;
private _turret = _vehicle call FUNC(getTurretCommander);
_config = configFile >> "CfgVehicles" >> typeOf _vehicle;
_turret = [_vehicle] call FUNC(getTurretCommander);
[_config, _turret] call FUNC(getTurretConfigPath) // return [_config, _turret] call FUNC(getTurretConfigPath) // return

View File

@ -14,9 +14,7 @@
params ["_vehicle"]; params ["_vehicle"];
private ["_config", "_turret"]; private _config = configFile >> "CfgVehicles" >> typeOf _vehicle;
private _turret = _vehicle call FUNC(getTurretGunner);
_config = configFile >> "CfgVehicles" >> typeOf _vehicle;
_turret = [_vehicle] call FUNC(getTurretGunner);
[_config, _turret] call FUNC(getTurretConfigPath) // return [_config, _turret] call FUNC(getTurretConfigPath) // return

View File

@ -17,25 +17,23 @@
params ["_unit"]; params ["_unit"];
private ["_returnAnimation", "_animationState", "_unitAnimationCfg", "_unitActionsCfg", "_interpolateArray", "_indexAnimation"]; private _returnAnimation = "";
_returnAnimation = ""; private _animationState = animationState _unit;
private _unitAnimationCfg = configFile >> "CfgMovesMaleSdr" >> "States" >> _animationState;
_animationState = animationState _unit;
_unitAnimationCfg = configFile >> "CfgMovesMaleSdr" >> "States" >> _animationState;
//If we're already in a terminal animation just return current //If we're already in a terminal animation just return current
if (getNumber (_unitAnimationCfg >> "terminal") == 1) exitWith {_animationState}; if (getNumber (_unitAnimationCfg >> "terminal") == 1) exitWith {_animationState};
_unitActionsCfg = configFile >> "CfgMovesBasic" >> "Actions" >> getText (_unitAnimationCfg >> "actions"); private _unitActionsCfg = configFile >> "CfgMovesBasic" >> "Actions" >> getText (_unitAnimationCfg >> "actions");
TRACE_2("Animation/Action", configName _unitAnimationCfg, configName _unitActionsCfg); TRACE_2("Animation/Action", configName _unitAnimationCfg, configName _unitActionsCfg);
if (vehicle _unit != _unit) then { if (vehicle _unit != _unit) then {
_interpolateArray = getArray (_unitAnimationCfg >> "interpolateTo"); private _interpolateArray = getArray (_unitAnimationCfg >> "interpolateTo");
for "_index" from 0 to (count _interpolateArray - 1) step 2 do { for "_index" from 0 to (count _interpolateArray - 1) step 2 do {
_indexAnimation = _interpolateArray select _index; private _indexAnimation = _interpolateArray select _index;
//No guarentee that first animation will be right so scan for the first "terminal" animation //No guarentee that first animation will be right so scan for the first "terminal" animation
//E.G.: interpolateTo[] = {"passenger_apc_generic04still",1,"KIA_passenger_apc_generic04",1}; //E.G.: interpolateTo[] = {"passenger_apc_generic04still",1,"KIA_passenger_apc_generic04",1};

View File

@ -17,12 +17,10 @@
params ["_unit"]; params ["_unit"];
private ["_anim", "_stance"]; private _anim = toLower animationState _unit;
_anim = toLower animationState _unit;
// stance is broken for some animations. // stance is broken for some animations.
_stance = stance _unit; private _stance = stance _unit;
if (_anim find "ppne" == 4) then { if (_anim find "ppne" == 4) then {
_stance = "PRONE"; _stance = "PRONE";

View File

@ -15,15 +15,13 @@
params ["_unit", "_variable", "_defaultValue"]; params ["_unit", "_variable", "_defaultValue"];
private "_value"; private _value = _unit getVariable _variable;
_value = _unit getVariable _variable;
if (isNil "_value") then { if (isNil "_value") then {
if (!isNil "_defaultValue") then { if (!isNil "_defaultValue") then {
_value = _defaultValue; _value = _defaultValue;
} else { } else {
private "_definedVariable"; private _definedVariable = _variable call FUNC(getDefinedVariableInfo);
_definedVariable = [_variable] call FUNC(getDefinedVariableInfo);
if (count _definedVariable > 1) then { if (count _definedVariable > 1) then {
_value = _definedVariable select 1; _value = _definedVariable select 1;

View File

@ -14,8 +14,7 @@
params ["_varName"]; params ["_varName"];
private "_variableDefinition"; private _variableDefinition = _varName call FUNC(getDefinedVariableInfo);
_variableDefinition = [_varName] call FUNC(getDefinedVariableInfo);
if !(_variableDefinition isEqualTo []) exitWith { if !(_variableDefinition isEqualTo []) exitWith {
_variableDefinition select 1; _variableDefinition select 1;

View File

@ -16,12 +16,10 @@
params ["_idd"]; params ["_idd"];
private ["_configNames", "_config"]; private _configNames = [];
_configNames = [];
for "_index" from 0 to (count configFile - 1) do { for "_index" from 0 to (count configFile - 1) do {
_config = configFile select _index; private _config = configFile select _index;
if (isClass _config && {isNumber (_config >> "idd")} && {getNumber (_config >> "idd") == _idd}) then { if (isClass _config && {isNumber (_config >> "idd")} && {getNumber (_config >> "idd") == _idd}) then {
_configNames pushBack configName _config; _configNames pushBack configName _config;

View File

@ -14,14 +14,12 @@
params ["_vehicle"]; params ["_vehicle"];
private ["_turrets", "_doorTurrets", "_config"]; private _turrets = allTurrets [_vehicle, true];
_turrets = allTurrets [_vehicle, true]; private _doorTurrets = [];
_doorTurrets = [];
{ {
_config = configFile >> "CfgVehicles" >> typeOf _vehicle; private _config = configFile >> "CfgVehicles" >> typeOf _vehicle;
_config = [_config, _x] call FUNC(getTurretConfigPath); _config = [_config, _x] call FUNC(getTurretConfigPath);

View File

@ -17,20 +17,16 @@
params ["_source", "_destination", "_accuracy"]; params ["_source", "_destination", "_accuracy"];
private ["_result", "_distance"]; private _result = [false, [0, 0, 0]];
_result = [false, [0, 0, 0]]; private _distance = _source vectorDistance _destination;
_distance = _source vectorDistance _destination;
if !(lineIntersectsWith [_source, _destination] isEqualTo []) then { if !(lineIntersectsWith [_source, _destination] isEqualTo []) then {
private ["_lower", "_upper", "_mid", "_dir"]; private _lower = 0;
private _upper = 1;
private _mid = 0.5;
_lower = 0; private _dir = _source vectorFromTo _destination;
_upper = 1;
_mid = 0.5;
_dir = _source vectorFromTo _destination;
while {(_upper - _lower) * _distance > _accuracy} do { while {(_upper - _lower) * _distance > _accuracy} do {
_mid = _lower + (_upper - _lower) / 2; _mid = _lower + (_upper - _lower) / 2;

View File

@ -17,20 +17,16 @@
params ["_source", "_destination", "_accuracy"]; params ["_source", "_destination", "_accuracy"];
private ["_result", "_distance"]; private _result = [false, [0, 0, 0]];
_result = [false, [0, 0, 0]]; private _distance = _source vectorDistance _destination;
_distance = _source vectorDistance _destination;
if (terrainIntersectASL [_source, _destination]) then { if (terrainIntersectASL [_source, _destination]) then {
private ["_lower", "_upper", "_mid", "_dir"]; private _lower = 0;
private _upper = 1;
private _mid = 0.5;
_lower = 0; private _dir = _source vectorFromTo _destination;
_upper = 1;
_mid = 0.5;
_dir = _source vectorFromTo _destination;
while {(_upper - _lower) * _distance > _accuracy} do { while {(_upper - _lower) * _distance > _accuracy} do {
_mid = _lower + (_upper - _lower) / 2; _mid = _lower + (_upper - _lower) / 2;

View File

@ -17,15 +17,11 @@
params ["_unit"]; params ["_unit"];
private ["_forceWalkReasons", "_unitForceWalkNumber", "_unitForceWalkStatus", "_unitForceWalkReasons"]; private _forceWalkReasons = missionNamespace getVariable ["ACE_forceWalkReasons", []];
private _unitForceWalkNumber = _unit getVariable ["ACE_forceWalkStatusNumber", 0];
private _unitForceWalkStatus = [_unitForceWalkNumber, count _forceWalkReasons] call FUNC(binarizeNumber);
_forceWalkReasons = missionNamespace getVariable ["ACE_forceWalkReasons", []]; private _unitForceWalkReasons = [];
_unitForceWalkNumber = _unit getVariable ["ACE_forceWalkStatusNumber", 0];
_unitForceWalkStatus = [_unitForceWalkNumber, count _forceWalkReasons] call FUNC(binarizeNumber);
_unitForceWalkReasons = [];
{ {
if (_unitForceWalkStatus select _forEachIndex) then { if (_unitForceWalkStatus select _forEachIndex) then {

View File

@ -13,14 +13,13 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_vehicle", "_weapon"]; params [["_vehicle", objNull, [objNull]], ["_weapon", "", [""]]];
// on foot // on foot
if (gunner _vehicle == _vehicle && {_weapon in weapons _vehicle || {toLower _weapon in ["throw", "put"]}}) exitWith {gunner _vehicle}; if (gunner _vehicle == _vehicle && {_weapon in weapons _vehicle || {toLower _weapon in ["throw", "put"]}}) exitWith {gunner _vehicle};
// inside vehicle // inside vehicle
private "_gunner"; private _gunner = objNull;
_gunner = objNull;
{ {
if (_weapon in (_vehicle weaponsTurret _x)) exitWith { if (_weapon in (_vehicle weaponsTurret _x)) exitWith {

View File

@ -18,8 +18,7 @@ ACE_DEPRECATED("ace_common_fnc_getHitPoints","3.5.0","getAllHitPointsDamage");
params ["_vehicle"]; params ["_vehicle"];
private "_hitPointsWithSelections"; private _hitPointsWithSelections = getAllHitPointsDamage _vehicle;
_hitPointsWithSelections = getAllHitPointsDamage _vehicle;
// get correct format on vehicles without any hitpoints // get correct format on vehicles without any hitpoints
if (_hitPointsWithSelections isEqualTo []) then { if (_hitPointsWithSelections isEqualTo []) then {

View File

@ -19,8 +19,7 @@ ACE_DEPRECATED("ace_common_fnc_getHitPointsWithSelections","3.5.0","getAllHitPoi
params ["_vehicle"]; params ["_vehicle"];
private "_hitPointsWithSelections"; private _hitPointsWithSelections = getAllHitPointsDamage _vehicle;
_hitPointsWithSelections = getAllHitPointsDamage _vehicle;
// get correct format on vehicles without any hitpoints // get correct format on vehicles without any hitpoints
if (_hitPointsWithSelections isEqualTo []) then { if (_hitPointsWithSelections isEqualTo []) then {

View File

@ -25,15 +25,13 @@ _position = toLower _position;
// general // general
if (!alive _vehicle || {locked _vehicle > 1}) exitWith {false}; if (!alive _vehicle || {locked _vehicle > 1}) exitWith {false};
private ["_config", "_turret", "_isInside", "_script", "_enemiesInVehicle"]; private _config = configFile >> "CfgVehicles" >> typeOf _vehicle;
private _turret = [];
_config = configFile >> "CfgVehicles" >> typeOf _vehicle; private _isInside = vehicle _unit == _vehicle;
_turret = [];
_isInside = vehicle _unit == _vehicle; private _script = {};
private _enemiesInVehicle = false; //Possible Side Restriction
_script = {};
_enemiesInVehicle = false; //Possible Side Restriction
{ {
if (side _unit getFriend side _x < 0.6) exitWith {_enemiesInVehicle = true}; if (side _unit getFriend side _x < 0.6) exitWith {_enemiesInVehicle = true};
@ -96,8 +94,7 @@ switch (_position) do {
}; };
case "turret" : { case "turret" : {
private "_turrets"; private _turrets = [_vehicle] call FUNC(getTurretsOther);
_turrets = [_vehicle] call FUNC(getTurretsOther);
if (_index != -1 && {_turret = _turrets select _index; CANGETINTURRETINDEX}) then { if (_index != -1 && {_turret = _turrets select _index; CANGETINTURRETINDEX}) then {
_script = [ _script = [
@ -122,8 +119,7 @@ switch (_position) do {
}; };
case "ffv" : { case "ffv" : {
private "_turrets"; private _turrets = [_vehicle] call FUNC(getTurretsFFV);
_turrets = [_vehicle] call FUNC(getTurretsFFV);
if (_index != -1 && {_turret = _turrets select _index; CANGETINTURRETINDEX}) then { if (_index != -1 && {_turret = _turrets select _index; CANGETINTURRETINDEX}) then {
_script = [ _script = [
@ -148,8 +144,7 @@ switch (_position) do {
}; };
case "codriver" : { case "codriver" : {
private "_positions"; private _positions = [typeOf _vehicle] call FUNC(getVehicleCodriver);
_positions = [typeOf _vehicle] call FUNC(getVehicleCodriver);
{ {
if (alive _x) then {_positions deleteAt (_positions find (_vehicle getCargoIndex _x))}; if (alive _x) then {_positions deleteAt (_positions find (_vehicle getCargoIndex _x))};
@ -207,11 +202,9 @@ switch (_position) do {
}; };
// this will execute all config based event handlers. Not script based ones unfortunately, but atleast we don't use any. // this will execute all config based event handlers. Not script based ones unfortunately, but atleast we don't use any.
private "_fnc_getInEH"; private _fnc_getInEH = {
_fnc_getInEH = {
private "_config";
// config based getIn EHs are assigned to the soldier, not the vehicle. Why Bis? Why? // config based getIn EHs are assigned to the soldier, not the vehicle. Why Bis? Why?
_config = configFile >> "CfgVehicles" >> typeOf _unit >> "EventHandlers"; private _config = configFile >> "CfgVehicles" >> typeOf _unit >> "EventHandlers";
if (isClass _config) then { if (isClass _config) then {
//getIn is local effects with global arguments. It doesn't trigger if the unit was already inside and only switched seats //getIn is local effects with global arguments. It doesn't trigger if the unit was already inside and only switched seats

View File

@ -15,23 +15,21 @@
params ["_item"]; params ["_item"];
private ["_cfgType", "_config", "_type", "_simulation", "_default"]; private _cfgType = [_item] call FUNC(getConfigType);
_cfgType = [_item] call FUNC(getConfigType);
if (_cfgType == "") exitWith {["", ""]}; if (_cfgType == "") exitWith {["", ""]};
if (_cfgType == "CfgGlasses") exitWith {["item", "glasses"]}; if (_cfgType == "CfgGlasses") exitWith {["item", "glasses"]};
_config = configFile >> _cfgType >> _item; private _config = configFile >> _cfgType >> _item;
_type = getNumber (_config >> "type"); private _type = getNumber (_config >> "type");
_simulation = getText (_config >> "simulation"); private _simulation = getText (_config >> "simulation");
if (isNumber (_config >> "ItemInfo" >> "type")) then { if (isNumber (_config >> "ItemInfo" >> "type")) then {
_type = getNumber (_config >> "ItemInfo" >> "type"); _type = getNumber (_config >> "ItemInfo" >> "type");
}; };
_default = ["item", "magazine"] select (_cfgType == "CfgMagazines"); private _default = ["item", "magazine"] select (_cfgType == "CfgMagazines");
switch (true) do { switch (true) do {
case (_type == 0): {[_default, "unknown"]}; case (_type == 0): {[_default, "unknown"]};

View File

@ -19,14 +19,12 @@
params ["_vehicle", "_light"]; params ["_vehicle", "_light"];
private ["_config", "_intensity", "_position", "_direction", "_innerAngle", "_outerAngle"]; private _config = configFile >> "CfgVehicles" >> typeOf _vehicle >> "Reflectors" >> _light;
_config = configFile >> "CfgVehicles" >> typeOf _vehicle >> "Reflectors" >> _light; private _intensity = getNumber (_config >> "intensity");
private _position = getText (_config >> "position");
_intensity = getNumber (_config >> "intensity"); private _direction = getText (_config >> "direction");
_position = getText (_config >> "position"); private _innerAngle = getNumber (_config >> "innerAngle");
_direction = getText (_config >> "direction"); private _outerAngle = getNumber (_config >> "outerAngle");
_innerAngle = getNumber (_config >> "innerAngle");
_outerAngle = getNumber (_config >> "outerAngle");
[_intensity, _position, _direction, _innerAngle, _outerAngle] [_intensity, _position, _direction, _innerAngle, _outerAngle]

View File

@ -18,16 +18,12 @@
params ["_weapon"]; params ["_weapon"];
// @todo: Can weapons themselves still have flashlights (no attachment)? private _config = configFile >> "CfgWeapons" >> _weapon >> "ItemInfo" >> "FlashLight";
private ["_config", "_intensity", "_position", "_direction", "_innerAngle", "_outerAngle"]; private _intensity = getNumber (_config >> "intensity");
private _position = getText (_config >> "position");
_config = configFile >> "CfgWeapons" >> _weapon >> "ItemInfo" >> "FlashLight"; private _direction = getText (_config >> "direction");
private _innerAngle = getNumber (_config >> "innerAngle");
_intensity = getNumber (_config >> "intensity"); private _outerAngle = getNumber (_config >> "outerAngle");
_position = getText (_config >> "position");
_direction = getText (_config >> "direction");
_innerAngle = getNumber (_config >> "innerAngle");
_outerAngle = getNumber (_config >> "outerAngle");
[_intensity, _position, _direction, _innerAngle, _outerAngle] [_intensity, _position, _direction, _innerAngle, _outerAngle]

View File

@ -18,11 +18,9 @@
params [["_map", worldName]]; params [["_map", worldName]];
private ["_long", "_lat", "_altitude", "_UTM", "_easting", "_northing", "_zone", "_band", "_GZD"]; private _long = getNumber (configFile >> "CfgWorlds" >> _map >> "longitude");
private _lat = getNumber (configFile >> "CfgWorlds" >> _map >> "latitude");
_long = getNumber (configFile >> "CfgWorlds" >> _map >> "longitude"); private _altitude = getNumber (configFile >> "CfgWorlds" >> _map >> "elevationOffset");
_lat = getNumber (configFile >> "CfgWorlds" >> _map >> "latitude");
_altitude = getNumber (configFile >> "CfgWorlds" >> _map >> "elevationOffset");
if (_map in ["Chernarus", "Bootcamp_ACR", "Woodland_ACR", "utes"]) then { _lat = 50; _altitude = 0; }; if (_map in ["Chernarus", "Bootcamp_ACR", "Woodland_ACR", "utes"]) then { _lat = 50; _altitude = 0; };
if (_map in ["Altis", "Stratis"]) then { _lat = 40; _altitude = 0; }; if (_map in ["Altis", "Stratis"]) then { _lat = 40; _altitude = 0; };
@ -46,14 +44,14 @@ if (_map in ["lingor"]) then { _lat = -4; _altitude = 0; };
if (_map in ["Panthera3"]) then { _lat = 46; _altitude = 0; }; if (_map in ["Panthera3"]) then { _lat = 46; _altitude = 0; };
if (_map in ["Kunduz"]) then { _lat = 37; _altitude = 400; }; if (_map in ["Kunduz"]) then { _lat = 37; _altitude = 400; };
_UTM = [_long,_lat] call BIS_fnc_posDegToUTM; private _UTM = [_long,_lat] call BIS_fnc_posDegToUTM;
_easting = _UTM select 0; private _easting = _UTM select 0;
_northing = _UTM select 1; private _northing = _UTM select 1;
//_zone = _UTM select 2; //private _zone = _UTM select 2;
TRACE_4("",_UTM,_easting,_northing,_zone); TRACE_4("",_UTM,_easting,_northing,_zone);
/* /*
_band = switch (true) do { private _band = switch (true) do {
case (_lat<-72): {"C"}; case (_lat<-72): {"C"};
case (_lat<-64): {"D"}; case (_lat<-64): {"D"};
case (_lat<-56): {"E"}; case (_lat<-56): {"E"};
@ -77,8 +75,8 @@ _band = switch (true) do {
}; };
*/ */
_zone = 1 + (floor ((_long + 180) / 6)); private _zone = 1 + (floor ((_long + 180) / 6));
_band = "Z"; private _band = "Z";
if (_lat <= -80) then { if (_lat <= -80) then {
_band = "A"; _band = "A";
@ -90,17 +88,17 @@ if (_lat <= -80) then {
if (_map == "VR") then {_zone = 0; _band = "RV";}; if (_map == "VR") then {_zone = 0; _band = "RV";};
_GZD = format ["%1%2",_zone,_band]; private _GZD = format ["%1%2",_zone,_band];
TRACE_3("",_zone,_band,_GZD); TRACE_3("",_zone,_band,_GZD);
private ["_set1", "_set2", "_set3", "_set4", "_set5", "_set6", "_metaE", "_metaN", "_letterE", "_letterN", "_grid100km"]; private ["_metaE", "_metaN", "_letterE", "_letterN"];
_set1 = [1,7,13,19,25,31,37,43,49,55]; private _set1 = [1,7,13,19,25,31,37,43,49,55];
_set2 = [2,8,14,20,26,32,38,44,50,56]; private _set2 = [2,8,14,20,26,32,38,44,50,56];
_set3 = [3,9,15,21,27,33,39,45,51,57]; private _set3 = [3,9,15,21,27,33,39,45,51,57];
_set4 = [4,10,16,22,28,34,40,46,52,58]; private _set4 = [4,10,16,22,28,34,40,46,52,58];
_set5 = [5,11,17,23,29,35,41,47,53,59]; private _set5 = [5,11,17,23,29,35,41,47,53,59];
_set6 = [6,12,18,24,30,36,42,48,54,60]; private _set6 = [6,12,18,24,30,36,42,48,54,60];
switch (true) do { switch (true) do {
case (_zone in _set1): {_metaE = 1; _metaN = 1;}; case (_zone in _set1): {_metaE = 1; _metaN = 1;};
@ -154,7 +152,7 @@ switch (true) do {
}; };
TRACE_1("",_letterN); TRACE_1("",_letterN);
_grid100km = _letterE + _letterN; private _grid100km = _letterE + _letterN;
TRACE_1("",_grid100km); TRACE_1("",_grid100km);
if (_map == worldName) then { if (_map == worldName) then {

View File

@ -19,20 +19,18 @@
GVAR(mapGridData) = []; GVAR(mapGridData) = [];
private ["_cfgGrid", "_offsetX", "_offsetY", "_zoomMax", "_formatX", "_formatY", "_stepX", "_stepY", "_zoom", "_letterGrid", "_heightOffset", "_startGrid", "_originGrid", "_realOffsetY"];
//--- Extract grid values from world config (Borrowed from BIS_fnc_gridToPos) //--- Extract grid values from world config (Borrowed from BIS_fnc_gridToPos)
_cfgGrid = configFile >> "CfgWorlds" >> worldName >> "Grid"; private _cfgGrid = configFile >> "CfgWorlds" >> worldName >> "Grid";
_offsetX = getNumber (_cfgGrid >> "offsetX"); private _offsetX = getNumber (_cfgGrid >> "offsetX");
_offsetY = getNumber (_cfgGrid >> "offsetY"); private _offsetY = getNumber (_cfgGrid >> "offsetY");
_zoomMax = 1e99; private _zoomMax = 1e99;
_formatX = ""; private _formatX = "";
_formatY = ""; private _formatY = "";
_stepX = 1e10; private _stepX = 1e10;
_stepY = 1e10; private _stepY = 1e10;
{ {
_zoom = getnumber (_x >> "zoomMax"); private _zoom = getnumber (_x >> "zoomMax");
if (_zoom < _zoomMax) then { if (_zoom < _zoomMax) then {
_zoomMax = _zoom; _zoomMax = _zoom;
_formatX = getText (_x >> "formatX"); _formatX = getText (_x >> "formatX");
@ -43,7 +41,7 @@ _stepY = 1e10;
false false
} count configProperties [_cfgGrid, "isClass _x", false]; } count configProperties [_cfgGrid, "isClass _x", false];
_letterGrid = false; private _letterGrid = false;
if (toLower _formatX find "a" != -1) then {_letterGrid = true}; if (toLower _formatX find "a" != -1) then {_letterGrid = true};
if (toLower _formatY find "a" != -1) then {_letterGrid = true}; if (toLower _formatY find "a" != -1) then {_letterGrid = true};
@ -53,9 +51,9 @@ if (_letterGrid) exitWith {
}; };
//Start at [0, 500] and move north until we get a change in grid //Start at [0, 500] and move north until we get a change in grid
_heightOffset = 500; private _heightOffset = 500;
_startGrid = mapGridPosition [0, _heightOffset]; private _startGrid = mapGridPosition [0, _heightOffset];
_originGrid = _startGrid; private _originGrid = _startGrid;
while {_startGrid == _originGrid} do { while {_startGrid == _originGrid} do {
_heightOffset = _heightOffset + 1; _heightOffset = _heightOffset + 1;
@ -63,7 +61,7 @@ while {_startGrid == _originGrid} do {
}; };
//Calculate the real y offset //Calculate the real y offset
_realOffsetY = (parseNumber (_originGrid select [count _formatX, count _formatY])) * _stepY + _heightOffset - 1; private _realOffsetY = (parseNumber (_originGrid select [count _formatX, count _formatY])) * _stepY + _heightOffset - 1;
//Calculate MGRS 10digit step - they should both be 1 meter: //Calculate MGRS 10digit step - they should both be 1 meter:
_stepXat5 = _stepX * 10 ^ ((count _formatX) - 5); _stepXat5 = _stepX * 10 ^ ((count _formatX) - 5);

View File

@ -19,24 +19,22 @@
params ["_pos", ["_returnSingleString", false]]; params ["_pos", ["_returnSingleString", false]];
private ["_nativeGrid", "_count", "_easting", "_northing"];
//Fallback, when map data is weird (letters) //Fallback, when map data is weird (letters)
if (GVAR(mapGridData) isEqualTo []) exitWith { if (GVAR(mapGridData) isEqualTo []) exitWith {
_nativeGrid = mapGridPosition _pos; private _nativeGrid = mapGridPosition _pos;
if (_returnSingleString) then { if (_returnSingleString) then {
_nativeGrid _nativeGrid
} else { } else {
_count = floor ((count _nativeGrid) / 2); private _count = floor ((count _nativeGrid) / 2);
[_nativeGrid select [0, _count], _nativeGrid select [_count, _count]] [_nativeGrid select [0, _count], _nativeGrid select [_count, _count]]
}; };
}; };
GVAR(mapGridData) params ["_offsetX", "_realOffsetY", "_stepXat5", "_stepYat5"]; GVAR(mapGridData) params ["_offsetX", "_realOffsetY", "_stepXat5", "_stepYat5"];
_easting = floor (((_pos select 0) - _offsetX) / _stepXat5); private _easting = floor (((_pos select 0) - _offsetX) / _stepXat5);
_northing = floor (((_pos select 1) - _realOffsetY) / _stepYat5); private _northing = floor (((_pos select 1) - _realOffsetY) / _stepYat5);
//Attempt to handle negative east/north (e.g.: moving west of map bounds) //Attempt to handle negative east/north (e.g.: moving west of map bounds)
if (_easting > 0) then { if (_easting > 0) then {

View File

@ -25,17 +25,15 @@ if (count GVAR(mapGridData) == 0) exitWith {
GVAR(mapGridData) params ["_offsetX", "_realOffsetY", "_stepXat5", "_stepYat5"]; GVAR(mapGridData) params ["_offsetX", "_realOffsetY", "_stepXat5", "_stepYat5"];
private ["_countInput", "_countInputHalf", "_xPart", "_yPart", "_xPos", "_yPos"]; private _countInput = count _inputString;
private _countInputHalf = floor (_countInput / 2);
_countInput = count _inputString;
_countInputHalf = floor (_countInput / 2);
//Split string, ignoring middle //Split string, ignoring middle
_xPart = _inputString select [0, _countInputHalf]; private _xPart = _inputString select [0, _countInputHalf];
_yPart = _inputString select [ceil (_countInput / 2), _countInputHalf]; private _yPart = _inputString select [ceil (_countInput / 2), _countInputHalf];
_xPos = ((parseNumber _xPart) * _stepXat5 * 10 ^ (5 - _countInputHalf)) + _offsetX; private _xPos = ((parseNumber _xPart) * _stepXat5 * 10 ^ (5 - _countInputHalf)) + _offsetX;
_yPos = ((parseNumber _yPart) * _stepYat5 * 10 ^ (5 - _countInputHalf)) + _realOffsetY; private _yPos = ((parseNumber _yPart) * _stepYat5 * 10 ^ (5 - _countInputHalf)) + _realOffsetY;
if (_getCenterOfGrid) then { if (_getCenterOfGrid) then {
_xPos = _xPos + 0.5 * _stepXat5 * 10 ^ (5 - _countInputHalf); _xPos = _xPos + 0.5 * _stepXat5 * 10 ^ (5 - _countInputHalf);

View File

@ -14,11 +14,9 @@
params ["_group"]; params ["_group"];
private ["_leader", "_vehicle", "_side"]; private _leader = leader _group;
private _vehicle = vehicle _leader;
_leader = leader _group; private _side = side _leader;
_vehicle = vehicle _leader;
_side = side _leader;
if (_vehicle == _leader) exitWith { if (_vehicle == _leader) exitWith {
if ( if (

View File

@ -5,24 +5,27 @@
* Arguments: * Arguments:
* 0: Object <OBJECT> * 0: Object <OBJECT>
* 1: Use effective commander name when used on vehicles (default: false) <BOOL> * 1: Use effective commander name when used on vehicles (default: false) <BOOL>
* 2: Get Raw Name (Don't sanatize HTML tags `</>`) (default: false) <BOOL>
* *
* Return Value: * Return Value:
* Object Name <STRING> * Object Name <STRING>
* *
* Example:
* [player, false, true] call ace_common_fnc_getName;
*
* Public: Yes * Public: Yes
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_unit", ["_showEffective", false]]; params ["_unit", ["_showEffective", false], ["_useRaw", false]];
private "_name"; private _name = "";
_name = "";
if (_unit isKindOf "CAManBase") then { if (_unit isKindOf "CAManBase") then {
_name = _unit getVariable ["ACE_Name", localize QUOTE(DOUBLES(STR,GVAR(Unknown)))]; _name = _unit getVariable [(["ACE_Name", "ACE_NameRaw"] select _useRaw), localize QUOTE(DOUBLES(STR,GVAR(Unknown)))];
} else { } else {
if (_showEffective) then { if (_showEffective) then {
_name = [effectiveCommander _unit] call FUNC(getName); _name = [effectiveCommander _unit, false, _useRaw] call FUNC(getName);
} else { } else {
_name = getText (configFile >> "CfgVehicles" >> typeOf _unit >> "displayName"); _name = getText (configFile >> "CfgVehicles" >> typeOf _unit >> "displayName");
}; };

View File

@ -15,8 +15,7 @@
params ["_unit", "_magazine"]; params ["_unit", "_magazine"];
private "_return"; private _return = 0;
_return = 0;
if (_unit isKindOf "CAManBase") then { if (_unit isKindOf "CAManBase") then {
_return = {_x == _magazine} count magazines _unit; _return = {_x == _magazine} count magazines _unit;

View File

@ -18,23 +18,18 @@
params ["_vehicle"]; params ["_vehicle"];
private ["_config", "_hitpoints", "_selections"]; private _config = configFile >> "CfgVehicles" >> typeOf _vehicle;
_config = configFile >> "CfgVehicles" >> typeOf _vehicle; private _hitpoints = [];
private _selections = [];
_hitpoints = [];
_selections = [];
// iterate through all parents // iterate through all parents
while {isClass _config} do { while {isClass _config} do {
private "_class"; private _class = _config >> "Reflectors";
_class = _config >> "Reflectors";
for "_i" from 0 to (count _class - 1) do { for "_i" from 0 to (count _class - 1) do {
private ["_entry", "_selection"]; private _entry = _class select _i;
private _selection = getText (_entry >> "hitpoint");
_entry = _class select _i;
_selection = getText (_entry >> "hitpoint");
if (!(_selection in _selections) && {!isNil {_vehicle getHit _selection}}) then { if (!(_selection in _selections) && {!isNil {_vehicle getHit _selection}}) then {
_hitpoints pushBack configName _entry; _hitpoints pushBack configName _entry;

View File

@ -13,11 +13,9 @@
params ["_vehicle"]; params ["_vehicle"];
private ["_hitPointsFull", "_allSelectionsWithoutHitpoints"]; private _hitPointsFull = getAllHitPointsDamage _vehicle;
_hitPointsFull = getAllHitPointsDamage _vehicle; private _allSelectionsWithoutHitpoints = [];
_allSelectionsWithoutHitpoints = [];
{ {
if (_x == "") then { if (_x == "") then {

View File

@ -23,12 +23,13 @@
params ["_name"]; params ["_name"];
private "_value"; scopeName "main";
_value = [];
{ {
if (_x select 0 == _name) exitWith {_value = _x}; if (_x select 0 == _name) then {
_x breakOut "main";
};
false false
} count GVAR(settings); } count GVAR(settings);
_value []

View File

@ -0,0 +1,15 @@
/*
* Author: commy2
* Returns the control of the Stamina Bar from Arma 1.54.
*
* Arguments:
* None
*
* Return Value:
* Stamina Bar control <CONTROL>
*
* Public: No
*/
#include "script_component.hpp"
(uiNamespace getVariable [QGVAR(dlgStaminaBar), displayNull]) displayCtrl IDC_STAMINA_BAR

View File

@ -14,13 +14,11 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_path", "_mission", "_class", "_index", "_array", "_entry"]; [_this] params ["_path", [], [[]]];
_path = _this;
if (missionName == "") exitWith {""}; if (missionName == "") exitWith {""};
_mission = toArray toLower loadFile "mission.sqm"; private _mission = toArray toLower loadFile "mission.sqm";
_mission resize 65536; _mission resize 65536;
{ {
@ -34,11 +32,9 @@ _mission = toString (_mission - [-1]);
{_path set [_forEachIndex, toLower _x]} forEach _path; {_path set [_forEachIndex, toLower _x]} forEach _path;
for "_a" from 0 to (count _path - 2) do { for "_a" from 0 to (count _path - 2) do {
_class = format ["class%1{", _path select _a]; private _class = format ["class%1{", _path select _a];
private _index = _mission find _class;
_index = _mission find _class; private _array = toArray _mission;
_array = toArray _mission;
for "_b" from 0 to (_index + count toArray _class - 1) do { for "_b" from 0 to (_index + count toArray _class - 1) do {
_array set [_b, -1]; _array set [_b, -1];
@ -49,7 +45,7 @@ for "_a" from 0 to (count _path - 2) do {
_mission = toString _array; _mission = toString _array;
}; };
_entry = format ["%1=", _path select (count _path - 1)]; private _entry = format ["%1=", _path select (count _path - 1)];
_index = _mission find _entry; _index = _mission find _entry;
if (_index == -1) exitWith {""}; if (_index == -1) exitWith {""};

View File

@ -13,13 +13,11 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_position", "_direction", "_azimuth", "_inclination"]; private _position = ATLToASL positionCameraToWorld [0, 0, 0];
private _direction = ATLToASL positionCameraToWorld [0, 0, 1];
_position = ATLToASL positionCameraToWorld [0, 0, 0]; private _azimuth = ((_direction select 0) - (_position select 0)) atan2 ((_direction select 1) - (_position select 1));
_direction = ATLToASL positionCameraToWorld [0, 0, 1]; private _inclination = asin ((_direction select 2) - (_position select 2));
_azimuth = ((_direction select 0) - (_position select 0)) atan2 ((_direction select 1) - (_position select 1));
_inclination = asin ((_direction select 2) - (_position select 2));
if (_azimuth < 0) then {_azimuth = _azimuth + 360}; if (_azimuth < 0) then {_azimuth = _azimuth + 360};

View File

@ -16,16 +16,14 @@
params ["_interval", "_maxDistance", "_minDistance"]; params ["_interval", "_maxDistance", "_minDistance"];
private ["_position", "_laser", "_line", "_distance", "_iteration"]; private _position = ATLToASL positionCameraToWorld [0, 0, 0];
_position = ATLToASL positionCameraToWorld [0, 0, 0];
_position set [2, (_position select 2) - (getTerrainHeightASL _position min 0)]; _position set [2, (_position select 2) - (getTerrainHeightASL _position min 0)];
_laser = + _position; private _laser = + _position;
_line = [_position, _laser]; private _line = [_position, _laser];
_distance = _maxDistance; private _distance = _maxDistance;
_iteration = _distance; private _iteration = _distance;
while { while {
_iteration > _interval / 2 _iteration > _interval / 2

View File

@ -14,15 +14,13 @@
params ["_maxDistance"]; params ["_maxDistance"];
private ["_position", "_laser", "_intersects"]; private _position = ATLToASL positionCameraToWorld [0, 0, 0];
_position = ATLToASL positionCameraToWorld [0, 0, 0];
_position set [2, (_position select 2) - (getTerrainHeightASL _position min 0)]; _position set [2, (_position select 2) - (getTerrainHeightASL _position min 0)];
_laser = ATLToASL positionCameraToWorld [0, 0, _maxDistance]; private _laser = ATLToASL positionCameraToWorld [0, 0, _maxDistance];
_laser set [2, (_laser select 2) - (getTerrainHeightASL _laser min 0)]; _laser set [2, (_laser select 2) - (getTerrainHeightASL _laser min 0)];
_intersects = lineIntersectsObjs [_position, _laser, objNull, objNull, true, 2]; private _intersects = lineIntersectsObjs [_position, _laser, objNull, objNull, true, 2];
if (_intersects isEqualTo []) exitWith {objNull}; if (_intersects isEqualTo []) exitWith {objNull};

View File

@ -16,15 +16,12 @@ params ["_vehicle"];
if (!isLightOn _vehicle) exitWith {[]}; if (!isLightOn _vehicle) exitWith {[]};
private ["_reflectorsWithSelections", "_lights", "_hitpoints", "_turnedOnLights"]; private _reflectorsWithSelections = [[_vehicle], FUNC(getReflectorsWithSelections), uiNamespace, format [QEGVAR(cache,%1_%2), QUOTE(DFUNC(getReflectorsWithSelections)), typeOf _vehicle], 1E11] call FUNC(cachedCall);
_reflectorsWithSelections = [[_vehicle], FUNC(getReflectorsWithSelections), uiNamespace, format [QEGVAR(cache,%1_%2), QUOTE(DFUNC(getReflectorsWithSelections)), typeOf _vehicle], 1E11] call FUNC(cachedCall);
//_reflectorsWithSelections = [_vehicle] call FUNC(getReflectorsWithSelections); //_reflectorsWithSelections = [_vehicle] call FUNC(getReflectorsWithSelections);
_lights = _reflectorsWithSelections select 0; _reflectorsWithSelections params ["_lights", "_hitpoints"];
_hitpoints = _reflectorsWithSelections select 1;
_turnedOnLights = []; private _turnedOnLights = [];
{ {
if (_vehicle getHit _x <= 0.9) then { if (_vehicle getHit _x <= 0.9) then {

View File

@ -12,16 +12,14 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_vehicle"]; params [["_vehicle", objNull, [objNull]]];
private ["_turrets", "_turret", "_config"]; private _turrets = allTurrets [_vehicle, true];
_turrets = allTurrets [_vehicle, true]; private _turret = [];
_turret = [];
{ {
_config = configFile >> "CfgVehicles" >> typeOf _vehicle; private _config = configFile >> "CfgVehicles" >> typeOf _vehicle;
_config = [_config, _x] call FUNC(getTurretConfigPath); _config = [_config, _x] call FUNC(getTurretConfigPath);

View File

@ -15,14 +15,12 @@
params ["_config", "_turretIndex"]; params ["_config", "_turretIndex"];
private ["_offset", "_config2", "_foundClasses"];
for "_index" from 0 to (count _turretIndex - 1) do { for "_index" from 0 to (count _turretIndex - 1) do {
_config = _config >> "Turrets"; _config = _config >> "Turrets";
_offset = 0; private _offset = 0;
_config2 = _config select 0; private _config2 = _config select 0;
_foundClasses = 0; private _foundClasses = 0;
for "_a" from 0 to (count _config - 1) do { for "_a" from 0 to (count _config - 1) do {
if (isClass _config2) then { if (isClass _config2) then {

View File

@ -12,16 +12,14 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_vehicle"]; params [["_vehicle", objNull, [objNull]]];
private ["_turrets", "_turret", "_config"]; private _turrets = allTurrets [_vehicle, true];
_turrets = allTurrets [_vehicle, true]; private _turret = [];
_turret = [];
{ {
_config = configFile >> "CfgVehicles" >> typeOf _vehicle; private _config = configFile >> "CfgVehicles" >> typeOf _vehicle;
_config = [_config, _x] call FUNC(getTurretConfigPath); _config = [_config, _x] call FUNC(getTurretConfigPath);

Some files were not shown because too many files have changed in this diff Show More