Skip to content

Commit

Permalink
1.6.9.0 (#36)
Browse files Browse the repository at this point in the history
* 1.6.9.0
  • Loading branch information
johnb432 authored Oct 13, 2024
1 parent 7a25fa5 commit 2f558d4
Show file tree
Hide file tree
Showing 30 changed files with 181 additions and 215 deletions.
10 changes: 9 additions & 1 deletion .hemtt/project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,13 @@ include = [
"meta.cpp",
"mod.cpp",
"LICENSE",
"README.md"
"README.md",
]

[lints.sqf.banned_commands]
options.banned = [
"execVM",
]
options.ignore = [
"addPublicVariableEventHandler",
]
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Changelog for Zeus Additions 31.10.2024

1.6.9.0
- Updated to use 2.18 commands.
- Raised limit for automatic parachute deployment from 100 m to 150 m.
- Updated to support ACE 3.18.0
- Fixed bug with VBIED where vehicle could blow up numerous time in rapid succession.

# Changelog for Zeus Additions 6.5.2024

1.6.8.0
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
* **Toggle Consciousness (Forced):** Allows the Zeus to toggle a unit's consciousness state. This disregards any wake up conditions such as stable vitals, except if the unit is a player and they are in cardiac arrest.
* **Unit Death Tracking:** Allows the Zeus to select units to track. When a selected unit dies, the Zeus will be notified the way he set it.
* **Unload ACE Cargo:** Allows the Zeus to unload ACE Cargo items from a vehicle.
* **Vehicle Explosion Prevention:** This module makes vehicles not able to blow up, but still allows them to take damage.
* **Vehicle Explosion Prevention:** This module makes vehicles not able to blow up, but still allows them to take damage. **This module is incompatible with ACE Advanced Vehicle Damage.**

<h2>CBA Settings</h2>

Expand Down
10 changes: 7 additions & 3 deletions addons/main/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if (!hasInterface) exitWith {};
};

// Add Drag Bodies module
if (!isNil "ace_dragging") then {
if (!isNil "ace_dragging" && {getNumber (_cfgPatches >> "ace_main" >> "version") < 3.18}) then {
#include "modules\module_dragBodies.inc.sqf"
};
}] call CBA_fnc_addEventHandlerArgs;
Expand Down Expand Up @@ -63,7 +63,11 @@ if (!hasInterface) exitWith {};

// Optionals
private _cfgPatches = configFile >> "CfgPatches";
GVAR(ACEClipboardLoaded) = isClass (configFile >> "ACE_Extensions" >> "ace_clipboard");
GVAR(ACEClipboardLoaded) = if (getNumber (_cfgPatches >> "ace_main" >> "version") >= 3.18) then {
[0, 2] select (("ace" callExtension ["version", []]) params [["_versionEx", "", [""]], ["_returnCode", -1, [-1]]])
} else {
parseNumber (isClass (configFile >> "ACE_Extensions" >> "ace_clipboard"))
};

// Check if ACE Dragging is loaded
if (!isNil "ace_dragging") then {
Expand Down Expand Up @@ -106,7 +110,7 @@ if (isClass (_cfgPatches >> "rhs_main_loadorder")) then {
};

// Check if ACE Medical is loaded
if (!zen_common_aceMedical) then {
if !(GETMVAR("ace_medical_enabled",zen_common_aceMedical)) then {
private _string = LLSTRING(aceMedicalMissing);
INFO(_string);

Expand Down
6 changes: 0 additions & 6 deletions addons/main/addon.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
[rapify]
enabled = true

[binarize]
enabled = true

[asc]
enabled = true
8 changes: 4 additions & 4 deletions addons/main/functions/fnc_addParachute.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ private _showTransition = _unit == call CBA_fnc_currentUnit;
// If not player controlled, don't do transition screen or inform about paradrop
if (_showTransition) then {
cutText ["You are being paradropped...", "BLACK OUT", 2, true];
hint "The parachute will automatically deploy if you haven't deployed it before reaching 100m above ground level. Your backpack will be returned upon landing.";
hint "The parachute will automatically deploy if you haven't deployed it before reaching 150m above ground level. Your backpack will be returned upon landing.";
};

private _backpackClass = backpack _unit;
Expand Down Expand Up @@ -79,11 +79,11 @@ if (_backpackClass != "" && {_giveUnitParachute}) then {
};

[{
// Wait until the unit is <100m AGL or dead
(getPos _this) select 2 < 100 || {!alive _this}
// Wait until the unit is <150m AGL or dead
(getPos _this) select 2 < 150 || {!alive _this}
}, {
// If parachute is already open or unit is unconscious or dead, don't deploy parachute
if ((((objectParent _this) call BIS_fnc_objectType) select 1) == "Parachute" || {!alive _this} || {(lifeState _this) == "INCAPACITATED"}) exitWith {};
if ((((objectParent _this) call BIS_fnc_objectType) select 1) == "Parachute" || {!((lifeState _this) in ["HEALTHY", "INJURED"])}) exitWith {};

_this action ["OpenParachute", _this];
}, _unit] call CBA_fnc_waitUntilAndExecute;
Expand Down
6 changes: 1 addition & 5 deletions addons/main/functions/fnc_addParachuteAction.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,7 @@ _object setVariable [QGVAR(paradropActionID),

openMap true;

#ifdef ARMA_216
if (!isNil {_caller getVariable QGVAR(handleMapParadrop)}) exitWith {};
#else
if !(_caller isNil QGVAR(handleMapParadrop)) exitWith {};
#endif
if !(_caller isNil QGVAR(handleMapParadrop)) exitWith {};

_caller setVariable [QGVAR(handleMapParadrop), true];

Expand Down
8 changes: 1 addition & 7 deletions addons/main/functions/fnc_breachingEffectsVisual.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,7 @@ _light setLightAttenuation [0, 0, 0, 2.2, 500, 1000];

// Delete helpers after 100ms/1s
[{
#ifdef ARMA_216
{
deleteVehicle _x;
} forEach _this;
#else
deleteVehicle _this;
#endif
deleteVehicle _this;
}, [_source1, _light], 0.1] call CBA_fnc_waitAndExecute;

[{
Expand Down
2 changes: 1 addition & 1 deletion addons/main/functions/fnc_garrisonBuilding.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ private _fnc_moveUnit = {
private _unit = _group createUnit [_unitType, [-10000, -10000, 0], [], 0, "CAN_COLLIDE"];

if (surfaceIsWater _pos) then {
_unit setPosASL AGLtoASL _pos;
_unit setPosASL AGLToASL _pos;
} else {
_unit setPosATL _pos;
};
Expand Down
38 changes: 30 additions & 8 deletions addons/main/functions/fnc_gui_createResupply.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,22 @@ _ctrlListMagazines ctrlAddEventHandler ["LBDblClick", {
_ctrlListMagazines ctrlAddEventHandler ["KeyDown", {
params ["_ctrlListMagazines", "_key", "", "_control"];

if !(_key == DIK_C && {_control} && {GVAR(ACEClipboardLoaded)}) exitWith {};
if !(_key == DIK_C && _control) exitWith {};
if (GVAR(ACEClipboardLoaded) == 0 && !isServer) exitWith {};

// Copy to clipboard
"ace_clipboard" callExtension (str (_ctrlListMagazines lbTooltip (lbCurSel _ctrlListMagazines)) + ";");
"ace_clipboard" callExtension "--COMPLETE--";
private _export = str (_ctrlListMagazines lbTooltip (lbCurSel _ctrlListMagazines)) + ";";

if (GVAR(ACEClipboardLoaded) != 0) then {
if (GVAR(ACEClipboardLoaded) == 1) then {
"ace_clipboard" callExtension (_export + ";");
"ace_clipboard" callExtension "--COMPLETE--";
} else {
"ace" callExtension ["clipboard:append", [_export]];
"ace" callExtension ["clipboard:complete", []];
};
} else {
copyToClipboard _export
};

true
}];
Expand Down Expand Up @@ -171,11 +182,22 @@ _ctrlListSelected ctrlAddEventHandler ["LBDblClick", {
_ctrlListSelected ctrlAddEventHandler ["KeyDown", {
params ["_ctrlListSelected", "_key", "", "_control"];

if !(_key == DIK_C && {_control} && {GVAR(ACEClipboardLoaded)}) exitWith {};
if !(_key == DIK_C && _control) exitWith {};
if (GVAR(ACEClipboardLoaded) == 0 && !isServer) exitWith {};

// Copy to clipboard
"ace_clipboard" callExtension (str (_ctrlListSelected lbTooltip (lbCurSel _ctrlListSelected)) + ";");
"ace_clipboard" callExtension "--COMPLETE--";
private _export = str (_ctrlListSelected lbTooltip (lbCurSel _ctrlListSelected)) + ";";

if (GVAR(ACEClipboardLoaded) != 0) then {
if (GVAR(ACEClipboardLoaded) == 1) then {
"ace_clipboard" callExtension (_export + ";");
"ace_clipboard" callExtension "--COMPLETE--";
} else {
"ace" callExtension ["clipboard:append", [_export]];
"ace" callExtension ["clipboard:complete", []];
};
} else {
copyToClipboard _export
};

true
}];
Expand Down
2 changes: 1 addition & 1 deletion addons/main/functions/fnc_init.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ GVAR(init) = true;
INFO_4("Init: Net mode: %1 - %2 loaded: %3 - clientOwner %4",call BIS_fnc_getNetMode,toUpperANSI QUOTE(PREFIX),!isNil QUOTE(ADDON),clientOwner);

[QGVAR(executeFunction), {
(_this select 1) call (missionNamespace getVariable [_this select 0, {}]);
(_this select 1) call (GETMVAR(_this select 0,{}));
}] call CBA_fnc_addEventHandler;

[QGVAR(setUnloadInCombat), {
Expand Down
2 changes: 0 additions & 2 deletions addons/main/functions/fnc_sanitiseFunction.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ if (_function isEqualType {}) then {

if (_function == "") exitWith {};

private _index = -1;

// Remove headers (#line)
while {_function regexFind ["#line"] isNotEqualTo []} do {
_function = _function regexReplace ["#line[^\n\r]*(\n|\r)", ""];
Expand Down
4 changes: 4 additions & 0 deletions addons/main/functions/fnc_switchUnitStart.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ private _group = group _unit;
private _groupID = groupId _unit;
private _teamColor = assignedTeam _unit;

if (_teamColor == "") then {
_teamColor = "MAIN";
};

// Make unit local
if (!local _unit) then {
["zen_common_execute", [{
Expand Down
16 changes: 8 additions & 8 deletions addons/main/modules/functionality_dragBodies.inc.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@
["zen_curatorDisplayLoaded", {
private _curator = getAssignedCuratorLogic player;

#ifdef ARMA_216
if (!isNil {_curator getVariable QGVAR(curatorEhID)}) exitWith {};
#else
if !(_curator isNil QGVAR(curatorEhID)) exitWith {};
#endif
if !(_curator isNil QGVAR(curatorEhID)) exitWith {};

_curator setVariable [QGVAR(curatorEhID),
_curator addEventHandler ["CuratorObjectEdited", {
Expand All @@ -20,9 +16,13 @@
if (alive _entity || {!(_entity isKindOf "CAManBase")}) exitWith {};

// Sync the corpse
[QGVAR(awake), [_entity, true]] call CBA_fnc_globalEvent;
[QGVAR(awake), [_entity, false]] call CBA_fnc_globalEvent;
[QGVAR(awake), [_entity, true]] call CBA_fnc_globalEvent;
if (getNumber (_cfgPatches >> "ace_main" >> "version") >= 3.18) then {
["ace_dragging_moveCorpse", [_entity, getDir _entity, getPosATL _entity]] call CBA_fnc_globalEvent;
} else {
[QGVAR(awake), [_entity, true]] call CBA_fnc_globalEvent;
[QGVAR(awake), [_entity, false]] call CBA_fnc_globalEvent;
[QGVAR(awake), [_entity, true]] call CBA_fnc_globalEvent;
};
}]
];
}] call CBA_fnc_addEventHandler;
20 changes: 3 additions & 17 deletions addons/main/modules/module_behaviourCrew.inc.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,7 @@
["TOOLBOX:ENABLED", [LSTRING(enablePassengerDismount), LSTRING(enablePassengerDismountDesc)], _getUnloadInCombat select 0, true],
["TOOLBOX:ENABLED", [LSTRING(enableCrewDismount), LSTRING(enableCrewDismountDesc)], _getUnloadInCombat select 1, true],
["TOOLBOX:ENABLED", [LSTRING(enableCrewStayImmobile), LSTRING(enableCrewStayImmobileDesc)], isAllowedCrewInImmobile _object, true],
["TOOLBOX:YESNO", [LSTRING(enableAiTurnOut), LSTRING(enableAiTurnOutDesc)],
#ifdef ARMA_216
isNil {_object getVariable QGVAR(turnOutJIP)},
#else
_object isNil QGVAR(turnOutJIP),
#endif
true]
["TOOLBOX:YESNO", [LSTRING(enableAiTurnOut), LSTRING(enableAiTurnOutDesc)], _object isNil QGVAR(turnOutJIP), true]
], {
params ["_results", "_object"];
_results params ["_dismountPassengers", "_dismountCrew", "_stayCrew", "_allowTurnOut"];
Expand Down Expand Up @@ -58,11 +52,7 @@
[[QGVAR(setUnloadInCombat), [_object, _dismountPassengers, _dismountCrew], QGVAR(setUnload_) + hashValue _object] call FUNC(globalEventJIP), _object] call FUNC(removeGlobalEventJIP);

if (!_allowTurnOut) then {
#ifdef ARMA_216
if (!isNil {_object getVariable QGVAR(turnOutJIP)}) exitWith {};
#else
if !(_object isNil QGVAR(turnOutJIP)) exitWith {};
#endif
if !(_object isNil QGVAR(turnOutJIP)) exitWith {};

private _jipID = [QGVAR(executeFunction), [QFUNC(addBehaviourEh), _object]] call FUNC(globalEventJIP);
[_jipID, _object] call FUNC(removeGlobalEventJIP);
Expand Down Expand Up @@ -212,11 +202,7 @@
[LSTRING(addedAiDriverMessage)] call zen_common_fnc_showMessage;

// Prevent unit from turning out
#ifdef ARMA_216
if (!isNil {_object getVariable QGVAR(turnOutJIP)}) exitWith {};
#else
if !(_object isNil QGVAR(turnOutJIP)) exitWith {};
#endif
if (!isNil {_object getVariable QGVAR(turnOutJIP)}) exitWith {};

private _jipID = [QGVAR(executeFunction), [QFUNC(addBehaviourEh), _object]] call FUNC(globalEventJIP);
[_jipID, _object] call FUNC(removeGlobalEventJIP);
Expand Down
18 changes: 3 additions & 15 deletions addons/main/modules/module_behaviourCrew_init.inc.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@ INFO_1("Running %1",__FILE__);
DFUNC(addBehaviourEh) = [{
params ["_vehicle"];

#ifdef ARMA_216
if (!isNil {_vehicle getVariable QGVAR(turnOutEhIDs)}) exitWith {};
#else
if !(_vehicle isNil QGVAR(turnOutEhIDs)) exitWith {};
#endif
if !(_vehicle isNil QGVAR(turnOutEhIDs)) exitWith {};

_vehicle setVariable [QGVAR(turnOutEhIDs), [
_vehicle addEventHandler ["TurnOut", {
Expand Down Expand Up @@ -100,11 +96,7 @@ DFUNC(setBehaviourVehicleCrew) = [{
DFUNC(addGetInOutEh) = [{
params ["_vehicle"];

#ifdef ARMA_216
if (!isNil {_vehicle getVariable QGVAR(getInOutEhIDs)}) exitWith {};
#else
if !(_vehicle isNil QGVAR(getInOutEhIDs)) exitWith {};
#endif
if !(_vehicle isNil QGVAR(getInOutEhIDs)) exitWith {};

_vehicle setVariable [QGVAR(getInOutEhIDs), [
_vehicle addEventHandler ["GetIn", {
Expand Down Expand Up @@ -142,11 +134,7 @@ DFUNC(removeGetInOutEh) = [{
DFUNC(addAiDriverEh) = [{
params ["_vehicle", "_unit"];

#ifdef ARMA_216
if (!isNil {_vehicle getVariable QGVAR(aiDriverEhIDs)}) exitWith {};
#else
if !(_vehicle isNil QGVAR(aiDriverEhIDs)) exitWith {};
#endif
if !(_vehicle isNil QGVAR(aiDriverEhIDs)) exitWith {};

// Don't need to save these, as unit will be deleted
_unit addEventHandler ["GetOutMan", {
Expand Down
2 changes: 2 additions & 0 deletions addons/main/modules/module_captive.inc.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
};

if (_setCaptive) then {
// Only send function to all clients if script is enabled
if (isNil QFUNC(setCaptive)) then {
DFUNC(setCaptive) = [{
_this stop true;
Expand Down Expand Up @@ -150,6 +151,7 @@
}, _x] call CBA_fnc_waitUntilAndExecute;
} forEach (_units select {!captive _x});
} else {
// Only send function to all clients if script is enabled
if (isNil QFUNC(releaseCaptive)) then {
DFUNC(releaseCaptive) = [{
_this setCaptive false;
Expand Down
24 changes: 12 additions & 12 deletions addons/main/modules/module_carBomb.inc.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,7 @@
};

["str_a3_systems_commondescription.inccfgomphonecontacts_detonation0", [
["TOOLBOX:YESNO", [LSTRING(enableCarBomb), LSTRING(enableCarBombDesc)],
#ifdef ARMA_216
!isNil {_object getVariable QGVAR(detonateJIP)},
#else
!(_object isNil QGVAR(detonateJIP)),
#endif
true],
["TOOLBOX:YESNO", [LSTRING(enableCarBomb), LSTRING(enableCarBombDesc)], !(_object isNil QGVAR(detonateJIP)), true],
["TOOLBOX", [LSTRING_ZEN(modules,explosionSize), LSTRING(explosionSizeDesc)], [0, 1, 2, ["str_small", "str_large"]]]
], {
params ["_results", "_object"];
Expand All @@ -52,11 +46,7 @@
_object setVariable [QGVAR(IEDSize), _IEDSize, true];
_object setVariable ["zen_modules_isIED", true, true];

#ifdef ARMA_216
if (!isNil {_object getVariable QGVAR(detonateJIP)}) exitWith {};
#else
if !(_object isNil QGVAR(detonateJIP)) exitWith {};
#endif
if !(_object isNil QGVAR(detonateJIP)) exitWith {};

// Turn off engine
if (isEngineOn _object) then {
Expand All @@ -72,6 +62,16 @@

if (!local _object || {!_engineState}) exitWith {};

// Once triggered, remove EH, otherwise it spams explosions
["zen_common_execute", [{
private _ehID = _this getVariable QGVAR(detonateEhID);

if (isNil "_ehID") exitWith {};

_this removeEventHandler ["Engine", _ehID];
_this setVariable [QGVAR(detonateEhID), nil];
}, _object]] call CBA_fnc_globalEvent;

[{
// Create IED and trigger it
(createVehicle [["IEDLandSmall_Remote_Ammo", "IEDLandBig_Remote_Ammo"] select (_this getVariable [QGVAR(IEDSize), 1]), ASLToATL (getPosWorld _this)]) setDamage 1;
Expand Down
2 changes: 1 addition & 1 deletion addons/main/modules/module_configureDoors.inc.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
[([LSTRING(configureDoorsUnbreachableMessage), LSTRING(configureDoorsBreachableMessage), LSTRING(configureDoorsUnlockedMessage), LSTRING(configureDoorsOpenedMessage)] select _mode)] call zen_common_fnc_showMessage;

// 0 unbreachable, 1 breachable, 2 closed, 3 open
if (_mode != 1) exitwith {};
if (_mode != 1) exitWith {};

// Only send function to all clients if script is enabled
if (isNil QFUNC(breachingAddAction)) then {
Expand Down
Loading

0 comments on commit 2f558d4

Please sign in to comment.