Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
7e84f5a
Improved various aspects of grenades
johnb432 Apr 27, 2024
89f30f8
Update addons/grenades/functions/fnc_flashbangExplosionEH.sqf
johnb432 Apr 28, 2024
73fccf0
Update addons/grenades/functions/fnc_incendiary.sqf
johnb432 Apr 28, 2024
9fda8b9
Update addons/grenades/functions/fnc_incendiary.sqf
johnb432 Apr 28, 2024
e3b72d1
Update fnc_flashbangExplosionEH.sqf
johnb432 Apr 28, 2024
331454b
Merge branch 'master' into grenades-fixes
johnb432 Apr 28, 2024
e4ec5bb
Merge branch 'master' into grenades-fixes
johnb432 May 1, 2024
e5387b2
More cleanup
johnb432 May 1, 2024
d957d43
Update fnc_incendiary.sqf
johnb432 May 22, 2024
22436b0
Merge branch 'master' into grenades-fixes
johnb432 May 22, 2024
3cb689b
Update fnc_incendiary.sqf
johnb432 May 22, 2024
a2b10e4
Update fnc_flashbangThrownFuze.sqf
johnb432 May 22, 2024
fe48f5e
Merge branch 'master' into grenades-fixes
johnb432 May 22, 2024
1dfca47
Update fnc_flashbangThrownFuze.sqf
johnb432 May 22, 2024
644feaa
Update addons/grenades/functions/fnc_nextMode.sqf
johnb432 May 23, 2024
c1377ff
Update addons/grenades/functions/fnc_flashbangExplosionEH.sqf
johnb432 May 23, 2024
b2b2e5a
Update addons/grenades/functions/fnc_incendiary.sqf
johnb432 May 23, 2024
e2e805b
Merged main
johnb432 May 27, 2024
bdf7b5d
Removed fix that is included in another PR
johnb432 May 27, 2024
5ec5f72
Update fnc_incendiary.sqf
johnb432 May 27, 2024
9756065
Merge branch 'master' into grenades-fixes
johnb432 Jun 5, 2024
c0226da
Merge branch 'master' into grenades-fixes
johnb432 Jun 13, 2024
4875150
Messed up merge conflict resolution
johnb432 Jun 13, 2024
5859567
Merge branch 'master' into grenades-fixes
johnb432 Jun 13, 2024
9113716
Merge main
johnb432 Jun 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions addons/common/functions/fnc_addToInventory.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,18 @@ switch (_container) do {
};
};

if (_type select 0 == "magazine") then {
if (_ammoCount == -1) then {
_ammoCount = getNumber (configFile >> "CfgMagazines" >> _classname >> "count");
};

// https://feedback.bistudio.com/T74244
// When adding throwables with the addXXXCargo(Global) commands, they don't show up in the throwables list
if (_ammoCount == 1 && {_classname call BIS_fnc_isThrowable}) then {
_type set [0, "item"];
};
};

switch (_type select 0) do {
case "weapon": {
if (_canAdd || {_canFitWeaponSlot}) then {
Expand Down Expand Up @@ -106,10 +118,6 @@ switch (_type select 0) do {
};

case "magazine": {
if (_ammoCount == -1) then {
_ammoCount = getNumber (configFile >> "CfgMagazines" >> _classname >> "count");
};

if (_canAdd) then {
_addedToUnit = true;

Expand Down
1 change: 0 additions & 1 deletion addons/grenades/CfgEventHandlers.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

class Extended_PreStart_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_SCRIPT(XEH_preStart));
Expand Down
1 change: 0 additions & 1 deletion addons/grenades/XEH_PREP.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

PREP(flare);
PREP(flashbangExplosionEH);
PREP(flashbangThrownFuze);
Expand Down
9 changes: 5 additions & 4 deletions addons/grenades/XEH_postInit.sqf
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// by commy2

#include "script_component.hpp"
#include "\a3\ui_f\hpp\defineDIKCodes.inc"

["ace_flashbangExploded", LINKFUNC(flashbangExplosionEH)] call CBA_fnc_addEventHandler;

Expand All @@ -15,7 +16,7 @@ GVAR(flashbangPPEffectCC) = ppEffectCreate ["ColorCorrections", 4265];
GVAR(flashbangPPEffectCC) ppEffectForceInNVG true;

// Add keybinds
["ACE3 Weapons", QGVAR(switchGrenadeMode), localize LSTRING(SwitchGrenadeMode), {
["ACE3 Weapons", QGVAR(switchGrenadeMode), LLSTRING(SwitchGrenadeMode), {
// Conditions: canInteract
if !([ACE_player, objNull, ["isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false};
// Conditions: specific
Expand All @@ -24,11 +25,11 @@ GVAR(flashbangPPEffectCC) ppEffectForceInNVG true;
if (ACE_player getVariable [QEGVAR(advanced_throwing,inHand), false]) exitWith {false};

// Statement
[] call FUNC(nextMode);
}, {false}, [9, [false, false, false]], false] call CBA_fnc_addKeybind; //8 Key
call FUNC(nextMode) // return
}, {}, [DIK_8, [false, false, false]], false] call CBA_fnc_addKeybind; // 8 Key

["CBA_settingsInitialized", {
if (GVAR(convertExplosives)) then {
[] call FUNC(addChangeFuseItemContextMenuOptions);
call FUNC(addChangeFuseItemContextMenuOptions);
};
}] call CBA_fnc_addEventHandler;
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "..\script_component.hpp"
/*
* Author: Cyruz
* Allows conversion of explosive charges in to throwable versions
* Allows conversion of explosive charges into throwable versions.
*
* Arguments:
* None
Expand All @@ -14,7 +14,8 @@
*
* Public: No
*/
TRACE_1("addChangeFuseItemContextMenuOptions",_this);

LOG("addChangeFuseItemContextMenuOptions");

{
_x params ["_mag", "_throwableMag"];
Expand All @@ -29,21 +30,25 @@
{true},
{
params ["", "", "_item", "", "_magArr"];
_item isEqualTo (_magArr select 0);

_item == (_magArr select 0)
}
],
{
params ["_unit", "", "", "_slot", "_magArr"];
private _container = "";
switch _slot do {

private _container = switch (_slot) do {
case "UNIFORM_CONTAINER": {
_container = "uniform";
"uniform"
};
case "VEST_CONTAINER": {
_container = "vest";
"vest"
};
case "BACKPACK_CONTAINER": {
_container = "backpack";
"backpack"
};
default {
""
};
};

Expand All @@ -54,7 +59,7 @@
false
},
true,
[_mag,_throwableMag]
[_mag, _throwableMag]
] call CBA_fnc_addItemContextMenuOption;

[
Expand All @@ -67,21 +72,25 @@
{true},
{
params ["", "", "_item", "", "_magArr"];
_item isEqualTo (_magArr select 1);

_item == (_magArr select 1)
}
],
{
params ["_unit", "", "", "_slot", "_magArr"];
private _container = "";
switch _slot do {

private _container = switch (_slot) do {
case "UNIFORM_CONTAINER": {
_container = "uniform";
"uniform"
};
case "VEST_CONTAINER": {
_container = "vest";
"vest"
};
case "BACKPACK_CONTAINER": {
_container = "backpack";
"backpack"
};
default {
""
};
};

Expand All @@ -92,7 +101,7 @@
false
},
true,
[_mag,_throwableMag]
[_mag, _throwableMag]
] call CBA_fnc_addItemContextMenuOption;
} forEach [
["SatchelCharge_Remote_Mag", "ACE_SatchelCharge_Remote_Mag_Throwable"],
Expand Down
Loading