Skip to content

Commit

Permalink
Merge branch 'master' into csw-separate-settings
Browse files Browse the repository at this point in the history
  • Loading branch information
johnb432 committed Apr 7, 2024
2 parents 36b6cb8 + 6a2f3a2 commit 256665c
Show file tree
Hide file tree
Showing 154 changed files with 642 additions and 391 deletions.
5 changes: 2 additions & 3 deletions addons/advanced_throwing/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ GVAR(ammoMagLookup) = call CBA_fnc_createNamespace;
{
private _ammo = getText (configFile >> "CfgMagazines" >> _x >> "ammo");
if (_ammo != "") then { GVAR(ammoMagLookup) setVariable [_ammo, _x]; };
} count (getArray (configFile >> "CfgWeapons" >> "Throw" >> _x >> "magazines"));
nil
} count getArray (configFile >> "CfgWeapons" >> "Throw" >> "muzzles");
} forEach (getArray (configFile >> "CfgWeapons" >> "Throw" >> _x >> "magazines"));
} forEach getArray (configFile >> "CfgWeapons" >> "Throw" >> "muzzles");


// Add keybinds
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@
_addedPickUpHelpers pushBack _pickUpHelper;
_throwablesHelped pushBack _x;
};
nil
} count _nearThrowables;
} forEach _nearThrowables;

_args set [0, getPosASL ACE_player];
_args set [3, _nearThrowables];
Expand All @@ -56,11 +55,10 @@
{
// Only handling with attachTo works nicely
_x attachTo [_x getVariable [QGVAR(throwable), objNull], [0, 0, 0]];
nil
} count _addedPickUpHelpers;
} forEach _addedPickUpHelpers;
} else {
TRACE_1("Cleaning Pick Up Helpers",count _addedPickUpHelpers);
{deleteVehicle _x} count _addedPickUpHelpers;
{deleteVehicle _x} forEach _addedPickUpHelpers;
[_idPFH] call CBA_fnc_removePerFrameHandler;
};
}, 0, [(getPosASL ACE_player) vectorAdd [-100, 0, 0], [], [], []]] call CBA_fnc_addPerFrameHandler;
2 changes: 2 additions & 0 deletions addons/advanced_throwing/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,15 @@
<Italian>Mostra informazioni sul vento temporaneamente</Italian>
<Japanese>一時的に風の情報を表示</Japanese>
<Korean>바람 정보 임시로 표시</Korean>
<French>Afficher temporairement les informations sur le vent</French>
</Key>
<Key ID="STR_ACE_Advanced_Throwing_EnableTempWindInfo_Description">
<English>Temporarily display Wind Info while throwing, to aid in placing smoke grenades effectively.</English>
<German>Zeige während des werfens Windinformationen an, um Rauchgranaten effektiver zu platzieren.</German>
<Italian>Mostra le informazioni sul vento durante il lancio di granate, facilitando il piazzamento ottimale di fumogeni.</Italian>
<Japanese>投擲行動中に風向きの情報を一時的に表示し、発煙手榴弾の煙幕を効果的に展開しやすくします。</Japanese>
<Korean>연막탄을 효과적으로 배치하는 데 도움이 되도록 투척하는 동안 일시적으로 바람 정보를 표시합니다.</Korean>
<French>Affiche les informations sur le vent pendant le lancement pour placer les grenades fumigènes plus efficacement.</French>
</Key>
<Key ID="STR_ACE_Advanced_Throwing_Prepare">
<English>Prepare/Change Throwable</English>
Expand Down
4 changes: 2 additions & 2 deletions addons/ai/functions/fnc_garrison.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ if (_startingPos isEqualTo [0,0,0]) exitWith {
[LSTRING(GarrisonInvalidPosition)] call EFUNC(common,displayTextStructured);
};

if (count _unitsArray == 0 || {isNull (_unitsArray select 0)}) exitWith {
if (_unitsArray isEqualTo [] || {isNull (_unitsArray select 0)}) exitWith {
TRACE_1("fnc_garrison: Units error",_unitsArray);
[LSTRING(GarrisonNoUnits)] call EFUNC(common,displayTextStructured);
};
Expand All @@ -43,7 +43,7 @@ if (_fillingRadius >= 50) then {
_buildings = [_buildings] call CBA_fnc_shuffle;
};

if (count _buildings == 0) exitWith {
if (_buildings isEqualTo []) exitWith {
TRACE_1("fnc_garrison: Building error",_buildings);
[LSTRING(GarrisonNoBuilding)] call EFUNC(common,displayTextStructured);
};
Expand Down
2 changes: 1 addition & 1 deletion addons/aircraft/functions/fnc_canShowEject.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ _vehicle == vehicle _unit
if (_unit == _x select FULLCREW_UNIT) exitWith {
_ejectVarName = format [QGVAR(ejectAction_%1_%2), _x select FULLCREW_ROLE, _x select FULLCREW_TURRETPATH];
};
} count fullCrew _vehicle;
} forEach fullCrew _vehicle;
_vehicle getVariable [_ejectVarName, false]
}
8 changes: 8 additions & 0 deletions addons/arsenal/functions/fnc_baseAttachment.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ private _cfgWeapons = configfile >> "CfgWeapons";
private _config = _cfgWeapons >> _item;
_item = configName _config;

// If the switch config entries are inherited, ignore
if (
(inheritsFrom (_config >> "MRT_SwitchItemNextClass") isNotEqualTo _config) ||
{inheritsFrom (_config >> "MRT_SwitchItemPrevClass") isNotEqualTo _config}
) exitWith {
_item // return
};

while {
_config = _cfgWeapons >> getText (_config >> "MRT_SwitchItemNextClass");
isClass _config && {_switchableClasses pushBackUnique configName _config != -1}
Expand Down
4 changes: 4 additions & 0 deletions addons/arsenal/functions/fnc_verifyLoadout.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ private _extendedInfo = createHashMap;
// Check if the provided loadout is a CBA extended loadout
if (count _loadout == 2) then {
_extendedInfo = +(_loadout select 1); // Copy the hashmap to prevent events from modifiyng the profileNamespace extendedInfo
if (_extendedInfo isEqualType []) then { // Hashmaps are serialized as arrays, convert back to hashmap
_extendedInfo = createHashMapFromArray _extendedInfo;
_loadout set [1, _extendedInfo]; // Also fix source variable, technically not needed but doesn't hurt
};
_loadout = _loadout select 0;
};

Expand Down
3 changes: 3 additions & 0 deletions addons/arsenal/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1244,13 +1244,15 @@
<Japanese>熱画像装置内蔵</Japanese>
<Russian>Интегрирован тепловизор.</Russian>
<Korean>열화상 내장</Korean>
<French>Thermique intégrée</French>
</Key>
<Key ID="STR_ACE_Arsenal_statVisionMode_intPrimTi">
<English>Thermal &amp; Primary integrated</English>
<Italian>Termico e Primario integrato</Italian>
<Japanese>熱画像装置内蔵・プライマリに内蔵</Japanese>
<Russian>Интегрирован тепловизор и осн.прицел.</Russian>
<Korean>열화상과 주무기 내장</Korean>
<French>Thermique et primaire intégrés</French>
</Key>
<Key ID="STR_ACE_Arsenal_statVisionMode_NoSup">
<English>Not Supported</English>
Expand Down Expand Up @@ -1718,6 +1720,7 @@
<Japanese>検索\nCTRL + クリックで検索結果の即時表示を有効化</Japanese>
<Korean>검색\nCtrl + 클릭으로 실시간 검색 결과를 활성화</Korean>
<Russian>Поиск\nCtrl + Click для включения результатов в реальном времени</Russian>
<French>Recherche\nCTRL + clic pour modifier les résultats tout en écrivant</French>
</Key>
</Package>
</Project>
4 changes: 2 additions & 2 deletions addons/cargo/functions/fnc_initVehicle.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ private _type = typeOf _vehicle;
private _config = configOf _vehicle;

// If vehicle had space given to it via eden/public, then override config hasCargo setting
private _hasCargoPublic = _item getVariable QGVAR(hasCargo);
private _hasCargoPublic = _vehicle getVariable QGVAR(hasCargo);
private _hasCargoPublicDefined = !isNil "_canLoadPublic";

if (_hasCargoPublicDefined && {!(_hasCargoPublic isEqualType false)}) then {
WARNING_4("%1[%2] - Variable %3 is %4 - Should be bool",_item,_type,QGVAR(hasCargo),_hasCargoPublic);
WARNING_4("%1[%2] - Variable %3 is %4 - Should be bool",_vehicle,_type,QGVAR(hasCargo),_hasCargoPublic);
};

private _hasCargoConfig = getNumber (_config >> QGVAR(hasCargo)) == 1;
Expand Down
5 changes: 5 additions & 0 deletions addons/cargo/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<Russian>Разместить</Russian>
<Japanese>配置する</Japanese>
<Korean>배치하기</Korean>
<French>Déployer</French>
</Key>
<Key ID="STR_ACE_Cargo_ScrollAction">
<English>Raise/Lower | (Ctrl + Scroll) Rotate</English>
Expand Down Expand Up @@ -285,6 +286,7 @@
<Japanese>%1 を %2 に積み込んでいます・・・</Japanese>
<Russian>Загружаем %1 в %2...</Russian>
<Korean>%1을(를) %2에 싣는 중...</Korean>
<French>Chargement %1 dans %2...</French>
</Key>
<Key ID="STR_ACE_Cargo_UnloadingItem">
<English>Unloading %1 from %2...</English>
Expand All @@ -293,6 +295,7 @@
<Japanese>%1 を %2 から降ろしています・・・</Japanese>
<Russian>Выгружаем %1 из %2...</Russian>
<Korean>%1을(를) %2(으)로부터 내리는 중...</Korean>
<French>Déchargement %1 de %2...</French>
</Key>
<Key ID="STR_ACE_Cargo_LoadingFailed">
<English>%1&lt;br/&gt;could not be loaded</English>
Expand Down Expand Up @@ -580,13 +583,15 @@
<Russian>Включить размещение</Russian>
<Japanese>配置機能を有効化</Japanese>
<Korean>배치 활성화</Korean>
<French>Permettre le placement</French>
</Key>
<Key ID="STR_ACE_Cargo_enableDeploy_description">
<English>Controls whether cargo items can be unloaded via the deploy method.</English>
<Italian>Determina se oggetti in carico possono essere scaricati e piazzati direttamente.</Italian>
<Russian>Определяет, можно ли выгружать грузы с помощью метода размещения.</Russian>
<Japanese>配置機能を介して貨物アイテムを降ろすことが出来るかどうかを制御します。</Japanese>
<Korean>배치 방법을 통해 화물 아이템을 내릴 수 있는지 여부를 제어합니다.</Korean>
<French>Contrôler si les éléments de cargaison peuvent être déchargés via la méthode de déploiement.</French>
</Key>
</Package>
</Project>
6 changes: 6 additions & 0 deletions addons/casings/CfgVehicles.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class CfgVehicles {
class FxCartridge;
class FxCartridge_65_caseless: FxCartridge {
GVAR(model) = ""; // note: the vanilla 6.5 caseless don't actually use this, just being safe
};
};
1 change: 1 addition & 0 deletions addons/casings/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ class CfgPatches {
};

#include "CfgEventHandlers.hpp"
#include "CfgVehicles.hpp"
45 changes: 21 additions & 24 deletions addons/casings/functions/fnc_createCasing.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -20,33 +20,30 @@ params ["_unit", "", "", "", "_ammo"];

if (!isNull objectParent _unit) exitWith {};

private _modelPath = GVAR(cachedCasings) get _ammo;

if (isNil "_modelPath") then {
private _modelPath = GVAR(cachedCasings) getOrDefaultCall [_ammo, {
private _cartridge = getText (configFile >> "CfgAmmo" >> _ammo >> "cartridge");
//Default cartridge is a 5.56mm model
_modelPath = switch (_cartridge) do {
case "FxCartridge_9mm": { "A3\Weapons_f\ammo\cartridge_small.p3d" };
case "FxCartridge_65": { "A3\weapons_f\ammo\cartridge_65.p3d" };
case "FxCartridge_762": { "A3\weapons_f\ammo\cartridge_762.p3d" };
case "FxCartridge_762x39": { "A3\weapons_f_enoch\ammo\cartridge_762x39.p3d" };
case "FxCartridge_93x64_Ball": { "A3\Weapons_F_Mark\Ammo\cartridge_93x64.p3d" };
case "FxCartridge_338_Ball": { "A3\Weapons_F_Mark\Ammo\cartridge_338_LM.p3d" };
case "FxCartridge_338_NM": { "A3\Weapons_F_Mark\Ammo\cartridge_338_NM.p3d" };
case "FxCartridge_127": { "A3\weapons_f\ammo\cartridge_127.p3d" };
case "FxCartridge_127x54": { "A3\Weapons_F_Mark\Ammo\cartridge_127x54.p3d" };
case "FxCartridge_slug": { "A3\weapons_f\ammo\cartridge_slug.p3d" };
case "FxCartridge_12Gauge_HE_lxWS": { "lxWS\weapons_1_f_lxws\Ammo\cartridge_he_lxws.p3d" };
case "FxCartridge_12Gauge_Slug_lxWS": { "lxWS\weapons_1_f_lxws\Ammo\cartridge_slug_lxws.p3d" };
case "FxCartridge_12Gauge_Smoke_lxWS": { "lxWS\weapons_1_f_lxws\Ammo\cartridge_smoke_lxws.p3d" };
case "FxCartridge_12Gauge_Pellet_lxWS": { "lxWS\weapons_1_f_lxws\Ammo\cartridge_pellet_lxws.p3d" };
case "CUP_FxCartridge_545": { "CUP\Weapons\CUP_Weapons_Ammunition\magazines\cartridge545.p3d" };
case "CUP_FxCartridge_939": { "CUP\Weapons\CUP_Weapons_Ammunition\magazines\cartridge939.p3d" };
case "": { "" };
default { "A3\Weapons_f\ammo\cartridge.p3d" };
if (_cartridge == "") then { // return (note: can't use exitWith)
""
} else {
private _cartridgeConfig = configFile >> "CfgVehicles" >> _cartridge;

// if explicitly defined, use ACE's config
if (isText (_cartridgeConfig >> QGVAR(model))) exitWith {
getText (_cartridgeConfig >> QGVAR(model))
};
// use casing's default model
private _model = getText (_cartridgeConfig >> "model");
if ("a3\weapons_f\empty" in toLowerANSI _model) exitWith { "" };

// Add file extension if missing (fileExists needs file extension)
if ((_model select [count _model - 4]) != ".p3d") then {
_model = _model + ".p3d";
};

["", _model] select (fileExists _model)
};
GVAR(cachedCasings) set [_ammo, _modelPath];
};
}, true];

if (_modelPath isEqualTo "") exitWith {};

Expand Down
3 changes: 1 addition & 2 deletions addons/common/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,7 @@ if (isServer) then {
INFO_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);
} forEach (curatorEditableObjects _zeusLogic);
};
}];
};
Expand Down
3 changes: 1 addition & 2 deletions addons/common/functions/fnc__handleRequestSyncedEvent.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ if (isServer) then {
{
_x params ["", "_eventArgs","_ttl"];
[_eventName, _eventArgs, _ttl] call FUNC(_handleSyncedEvent);
false
} count _eventLog;
} forEach _eventLog;

INFO_1("[%1] synchronized",_eventName);
};
Expand Down
39 changes: 23 additions & 16 deletions addons/common/functions/fnc_addToInventory.sqf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "..\script_component.hpp"
/*
* Author: Garth 'L-H' de Wet
* Adds an item, weapon, or magazine to the unit's inventory or places it in a weaponHolder if no space.
* Adds an item, weapon, or magazine to the unit's inventory or places it in a weapon holder if no space.
*
* Arguments:
* 0: Unit <OBJECT>
Expand All @@ -11,10 +11,10 @@
*
* Return Value:
* 0: Added to player <BOOL>
* 1: weaponholder <OBJECT>
* 1: Weapon holder item was placed in <OBJECT>
*
* Example:
* [bob, "classname", "", 5] call ace_common_fnc_addToInventory
* [player, "30Rnd_65x39_caseless_mag", "", 5] call ace_common_fnc_addToInventory
*
* Public: Yes
*/
Expand All @@ -26,6 +26,7 @@ private _type = _classname call FUNC(getItemType);
private _canAdd = false;
private _canFitWeaponSlot = false;
private _addedToUnit = false;
private _weaponHolder = _unit;

switch (_container) do {
case "vest": {
Expand Down Expand Up @@ -94,11 +95,13 @@ switch (_type select 0) do {
} else {
_addedToUnit = false;

private _pos = _unit modelToWorldVisual [0,1,0.05];
_weaponHolder = nearestObject [_unit, "WeaponHolder"];

_unit = createVehicle ["WeaponHolder_Single_F", _pos, [], 0, "NONE"];
_unit addWeaponCargoGlobal [_classname, 1];
_unit setPosATL _pos;
if (isNull _weaponHolder || {_unit distance _weaponHolder > 2}) then {
_weaponHolder = createVehicle ["GroundWeaponHolder", _unit, [], 0, "CAN_COLLIDE"];
};

_weaponHolder addWeaponCargoGlobal [_classname, 1];
};
};

Expand Down Expand Up @@ -127,11 +130,13 @@ switch (_type select 0) do {
} else {
_addedToUnit = false;

private _pos = _unit modelToWorldVisual [0,1,0.05];
_weaponHolder = nearestObject [_unit, "WeaponHolder"];

if (isNull _weaponHolder || {_unit distance _weaponHolder > 2}) then {
_weaponHolder = createVehicle ["GroundWeaponHolder", _unit, [], 0, "CAN_COLLIDE"];
};

_unit = createVehicle ["WeaponHolder_Single_F", _pos, [], 0, "NONE"];
_unit addMagazineAmmoCargo [_classname, 1, _ammoCount];
_unit setPosATL _pos;
_weaponHolder addMagazineAmmoCargo [_classname, 1, _ammoCount];
};
};

Expand All @@ -156,11 +161,13 @@ switch (_type select 0) do {
} else {
_addedToUnit = false;

private _pos = _unit modelToWorldVisual [0,1,0.05];
_weaponHolder = nearestObject [_unit, "WeaponHolder"];

if (isNull _weaponHolder || {_unit distance _weaponHolder > 2}) then {
_weaponHolder = createVehicle ["GroundWeaponHolder", _unit, [], 0, "CAN_COLLIDE"];
};

_unit = createVehicle ["WeaponHolder_Single_F", _pos, [], 0, "NONE"];
_unit addItemCargoGlobal [_classname, 1];
_unit setPosATL _pos;
_weaponHolder addItemCargoGlobal [_classname, 1];
};
};

Expand All @@ -170,4 +177,4 @@ switch (_type select 0) do {
};
};

[_addedToUnit, _unit]
[_addedToUnit, _weaponHolder]
21 changes: 8 additions & 13 deletions addons/common/functions/fnc_assignObjectsInList.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,13 @@ if (_list isEqualType "") then {
};

{
if (!isNil "_x") then {
if (_x isEqualType objNull) then {
if (local _x) then {
if (_vehicle) then {
(vehicle _x) setVariable [_variable, _setting, _global];
TRACE_6("Set variable vehicle",_x,vehicle _x,typeOf (vehicle _x),_variable,_setting,_global);
} else {
_x setVariable [_variable, _setting, _global];
TRACE_5("Set variable",_x,typeOf _x,_variable,_setting,_global);
};
};
if (!isNil "_x" && {_x isEqualType objNull} && {local _x}) then {
if (_vehicle) then {
(vehicle _x) setVariable [_variable, _setting, _global];
TRACE_6("Set variable vehicle",_x,vehicle _x,typeOf (vehicle _x),_variable,_setting,_global);
} else {
_x setVariable [_variable, _setting, _global];
TRACE_5("Set variable",_x,typeOf _x,_variable,_setting,_global);
};
};
false
} count _list;
} forEach _list;
3 changes: 1 addition & 2 deletions addons/common/functions/fnc_cbaSettings.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ GVAR(settingsMovedToSQF) = [];
INFO_1("%1 delayed functions running.",count GVAR(runAtSettingsInitialized));
{
(_x select 1) call (_x select 0);
false
} count GVAR(runAtSettingsInitialized);
} forEach GVAR(runAtSettingsInitialized);
GVAR(runAtSettingsInitialized) = nil; //cleanup

#ifdef DEBUG_MODE_FULL
Expand Down
Loading

0 comments on commit 256665c

Please sign in to comment.