mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
cookoff ammo selections default values (#4604)
* cookoff ammo selections default values * Add missing subTurret cache for Wheeled APCs
This commit is contained in:
parent
2df4a28145
commit
eb38290aaf
@ -28,20 +28,16 @@ class CfgVehicles {
|
|||||||
|
|
||||||
class Tank;
|
class Tank;
|
||||||
class Tank_F: Tank {
|
class Tank_F: Tank {
|
||||||
GVAR(ammoLocation) = "HitTurret";
|
GVAR(ammoLocation) = "HitHull";
|
||||||
GVAR(cookoffSelections)[] = {"poklop_gunner","poklop_commander"};
|
GVAR(cookoffSelections)[] = {"poklop_gunner","poklop_commander"};
|
||||||
};
|
};
|
||||||
|
class MBT_02_base_F: Tank_F {
|
||||||
class MBT_01_base_F: Tank_F {
|
GVAR(ammoLocation) = "HitTurret";
|
||||||
GVAR(ammoLocation) = "HitHull";
|
|
||||||
};
|
|
||||||
class APC_Tracked_01_base_F: Tank_F {
|
|
||||||
GVAR(ammoLocation) = "HitHull";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class Car_F;
|
class Car_F;
|
||||||
class Wheeled_APC_F: Car_F {
|
class Wheeled_APC_F: Car_F {
|
||||||
GVAR(ammoLocation) = "HitTurret";
|
GVAR(ammoLocation) = "HitHull";
|
||||||
GVAR(cookoffSelections)[] = {"poklop_gunner","poklop_commander"};
|
GVAR(cookoffSelections)[] = {"poklop_gunner","poklop_commander"};
|
||||||
|
|
||||||
// big explosions for wheeled APCs (same as for tanks)
|
// big explosions for wheeled APCs (same as for tanks)
|
||||||
|
@ -36,6 +36,22 @@ GVAR(cacheTankDuplicates) = call CBA_fnc_createNamespace;
|
|||||||
["Wheeled_APC_F", "init", {
|
["Wheeled_APC_F", "init", {
|
||||||
params ["_vehicle"];
|
params ["_vehicle"];
|
||||||
|
|
||||||
|
private _typeOf = typeOf _vehicle;
|
||||||
|
|
||||||
|
if (isNil {GVAR(cacheTankDuplicates) getVariable _typeOf}) then {
|
||||||
|
private _hitpoints = (getAllHitPointsDamage _vehicle param [0, []]) apply {toLower _x};
|
||||||
|
private _duplicateHitpoints = [];
|
||||||
|
|
||||||
|
{
|
||||||
|
if ((_x != "") && {_x in (_hitpoints select [0,_forEachIndex])}) then {
|
||||||
|
_duplicateHitpoints pushBack _forEachIndex;
|
||||||
|
};
|
||||||
|
} forEach _hitpoints;
|
||||||
|
|
||||||
|
TRACE_2("dupes",_typeOf,_duplicateHitpoints);
|
||||||
|
GVAR(cacheTankDuplicates) setVariable [_typeOf, _duplicateHitpoints];
|
||||||
|
};
|
||||||
|
|
||||||
_vehicle addEventHandler ["HandleDamage", {
|
_vehicle addEventHandler ["HandleDamage", {
|
||||||
if ((_this select 0) getVariable [QGVAR(enable), GVAR(enable)]) then {
|
if ((_this select 0) getVariable [QGVAR(enable), GVAR(enable)]) then {
|
||||||
["tank", _this] call FUNC(handleDamage);
|
["tank", _this] call FUNC(handleDamage);
|
||||||
|
Loading…
Reference in New Issue
Block a user