mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
whatever this is
This commit is contained in:
parent
474ecdd93b
commit
7481fb2100
3
addons/casings/CfgAmmo.hpp
Normal file
3
addons/casings/CfgAmmo.hpp
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
class CfgAmmo {
|
||||||
|
|
||||||
|
};
|
@ -1,7 +1,17 @@
|
|||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
if (!hasInterface || !GVAR(enabled)) exitWith {};
|
if (!hasInterface) exitWith {};
|
||||||
|
|
||||||
GVAR(cachedCasings) = createHashMap;
|
["CBA_settingsInitialized", {
|
||||||
GVAR(casings) = [];
|
if (!GVAR(enabled)) exitWith {};
|
||||||
["CAManBase", "FiredMan", {call FUNC(createCasing)}] call CBA_fnc_addClassEventHandler;
|
|
||||||
|
GVAR(cachedCasings) = createHashMap;
|
||||||
|
GVAR(caselessWeapons) = createHashMap;
|
||||||
|
GVAR(casings) = [];
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
} forEach ((toString {getText (_x >> "cartridgePos")}))
|
||||||
|
|
||||||
|
["CAManBase", "FiredMan", LINKFUNC(createCasing)] call CBA_fnc_addClassEventHandler;
|
||||||
|
}] call CBA_fnc_addEventHandler;
|
||||||
|
@ -14,4 +14,6 @@ class CfgPatches {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#include "CfgAmmo.hpp"
|
||||||
|
#include "CfgWeapons.hpp"
|
||||||
#include "CfgEventHandlers.hpp"
|
#include "CfgEventHandlers.hpp"
|
||||||
|
@ -4,8 +4,14 @@
|
|||||||
* Produces a casing matching the fired weapons caliber on the ground around the unit
|
* Produces a casing matching the fired weapons caliber on the ground around the unit
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* 0: unit - Object the event handler is assigned to <OBJECT>
|
* 0: Unit that pulled the trigger <OBJECT>
|
||||||
* 1: ammo - Ammo used <STRING>
|
* 1: Weapon <STRING>
|
||||||
|
* 2: Muzzle <STRING>
|
||||||
|
* 3: Weapon Mode (unused) <STRING>
|
||||||
|
* 4: Ammo <STRING>
|
||||||
|
* 5: Magazine <STRING>
|
||||||
|
* 6: Projectile (unused) <OBJECT>
|
||||||
|
* 7: Vehicle <OBJECT>
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* None
|
* None
|
||||||
@ -16,33 +22,43 @@
|
|||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
|
|
||||||
params ["_unit", "", "", "", "_ammo"];
|
params ["_unit", "_weapon", "_muzzle", "", "_ammo", "", "", "_vehicle"];
|
||||||
|
|
||||||
if (!isNull objectParent _unit) exitWith {};
|
if (!isNull _vehicle) exitWith {};
|
||||||
|
|
||||||
|
private _isCaseless = GVAR(caselessWeapons) getOrDefault [[_weapon, _muzzle], false, true];
|
||||||
|
if (_isCaseless) exitWith {};
|
||||||
|
|
||||||
private _modelPath = GVAR(cachedCasings) get _ammo;
|
private _modelPath = GVAR(cachedCasings) get _ammo;
|
||||||
|
|
||||||
if (isNil "_modelPath") then {
|
if (isNil "_modelPath") then {
|
||||||
private _cartridge = getText (configFile >> "CfgAmmo" >> _ammo >> "cartridge");
|
private _ammoCfg = configFile >> "CfgAmmo" >> _ammo;
|
||||||
//Default cartridge is a 5.56mm model
|
|
||||||
_modelPath = switch (_cartridge) do {
|
if (isClass (_ammoCfg >> QGVAR(modelPath))) then {
|
||||||
case "FxCartridge_9mm": { "A3\Weapons_f\ammo\cartridge_small.p3d" };
|
_modelPath = getText (_ammoCfg >> QGVAR(modelPath));
|
||||||
case "FxCartridge_65": { "A3\weapons_f\ammo\cartridge_65.p3d" };
|
} else {
|
||||||
case "FxCartridge_762": { "A3\weapons_f\ammo\cartridge_762.p3d" };
|
private _cartridge = getText (_ammoCfg >> "cartridge");
|
||||||
case "FxCartridge_762x39": { "A3\weapons_f_enoch\ammo\cartridge_762x39.p3d" };
|
//Default cartridge is a 5.56mm model
|
||||||
case "FxCartridge_93x64_Ball": { "A3\Weapons_F_Mark\Ammo\cartridge_93x64.p3d" };
|
_modelPath = switch (_cartridge) do {
|
||||||
case "FxCartridge_338_Ball": { "A3\Weapons_F_Mark\Ammo\cartridge_338_LM.p3d" };
|
case "FxCartridge_9mm": { "A3\Weapons_f\ammo\cartridge_small.p3d" };
|
||||||
case "FxCartridge_338_NM": { "A3\Weapons_F_Mark\Ammo\cartridge_338_NM.p3d" };
|
case "FxCartridge_65": { "A3\weapons_f\ammo\cartridge_65.p3d" };
|
||||||
case "FxCartridge_127": { "A3\weapons_f\ammo\cartridge_127.p3d" };
|
case "FxCartridge_762": { "A3\weapons_f\ammo\cartridge_762.p3d" };
|
||||||
case "FxCartridge_127x54": { "A3\Weapons_F_Mark\Ammo\cartridge_127x54.p3d" };
|
case "FxCartridge_762x39": { "A3\weapons_f_enoch\ammo\cartridge_762x39.p3d" };
|
||||||
case "FxCartridge_slug": { "A3\weapons_f\ammo\cartridge_slug.p3d" };
|
case "FxCartridge_93x64_Ball": { "A3\Weapons_F_Mark\Ammo\cartridge_93x64.p3d" };
|
||||||
case "FxCartridge_12Gauge_HE_lxWS": { "lxWS\weapons_1_f_lxws\Ammo\cartridge_he_lxws.p3d" };
|
case "FxCartridge_338_Ball": { "A3\Weapons_F_Mark\Ammo\cartridge_338_LM.p3d" };
|
||||||
case "FxCartridge_12Gauge_Slug_lxWS": { "lxWS\weapons_1_f_lxws\Ammo\cartridge_slug_lxws.p3d" };
|
case "FxCartridge_338_NM": { "A3\Weapons_F_Mark\Ammo\cartridge_338_NM.p3d" };
|
||||||
case "FxCartridge_12Gauge_Smoke_lxWS": { "lxWS\weapons_1_f_lxws\Ammo\cartridge_smoke_lxws.p3d" };
|
case "FxCartridge_127": { "A3\weapons_f\ammo\cartridge_127.p3d" };
|
||||||
case "FxCartridge_12Gauge_Pellet_lxWS": { "lxWS\weapons_1_f_lxws\Ammo\cartridge_pellet_lxws.p3d" };
|
case "FxCartridge_127x54": { "A3\Weapons_F_Mark\Ammo\cartridge_127x54.p3d" };
|
||||||
case "": { "" };
|
case "FxCartridge_slug": { "A3\weapons_f\ammo\cartridge_slug.p3d" };
|
||||||
default { "A3\Weapons_f\ammo\cartridge.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 "": { "" };
|
||||||
|
default { "A3\Weapons_f\ammo\cartridge.p3d" };
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
GVAR(cachedCasings) set [_ammo, _modelPath];
|
GVAR(cachedCasings) set [_ammo, _modelPath];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#include "\z\ace\addons\main\script_mod.hpp"
|
#include "\z\ace\addons\main\script_mod.hpp"
|
||||||
|
|
||||||
// #define DEBUG_MODE_FULL
|
// #define DEBUG_MODE_FULL
|
||||||
// #define DISABLE_COMPILE_CACHE
|
#define DISABLE_COMPILE_CACHE
|
||||||
// #define ENABLE_PERFORMANCE_COUNTERS
|
// #define ENABLE_PERFORMANCE_COUNTERS
|
||||||
|
|
||||||
#ifdef DEBUG_ENABLED_CASINGS
|
#ifdef DEBUG_ENABLED_CASINGS
|
||||||
|
Loading…
Reference in New Issue
Block a user