mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Fix deadman range, fix clacker transfer, use setShotParents (#4689)
This commit is contained in:
parent
4f20d1f7c6
commit
5379503772
@ -22,6 +22,19 @@
|
||||
//When getting knocked out in medical, trigger deadman explosives:
|
||||
//Event is global, only run on server (ref: ace_medical_fnc_setUnconscious)
|
||||
if (isServer) then {
|
||||
[QGVAR(detonate), {
|
||||
params ["_unit", "_explosive", "_delay"];
|
||||
TRACE_3("server detonate EH",_unit,_explosive,_delay);
|
||||
_explosive setShotParents [_unit, _unit];
|
||||
[{
|
||||
params ["_explosive"];
|
||||
TRACE_1("exploding",_explosive);
|
||||
if (!isNull _explosive) then {
|
||||
_explosive setDamage 1;
|
||||
};
|
||||
}, _explosive, _delay] call CBA_fnc_waitAndExecute;
|
||||
}] call CBA_fnc_addEventHandler;
|
||||
|
||||
["ace_unconscious", {
|
||||
params ["_unit", "_isUnconscious"];
|
||||
if (!_isUnconscious) exitWith {};
|
||||
|
@ -43,12 +43,7 @@ if (getNumber (ConfigFile >> "CfgAmmo" >> typeOf (_item select 0) >> "TriggerWhe
|
||||
_exp setPosASL _pos;
|
||||
};
|
||||
};
|
||||
[{
|
||||
params ["_explosive"];
|
||||
TRACE_1("exploding",_explosive);
|
||||
if (!isNull _explosive) then {
|
||||
_explosive setDamage 1;
|
||||
};
|
||||
}, [_item select 0], (_item select 1)] call CBA_fnc_waitAndExecute;
|
||||
|
||||
[QGVAR(detonate), [_unit, _item select 0, _item select 1]] call CBA_fnc_serverEvent;
|
||||
|
||||
_result
|
||||
|
@ -19,11 +19,14 @@
|
||||
params ["_unit"];
|
||||
TRACE_1("params",_unit);
|
||||
|
||||
private ["_deadman"];
|
||||
// Exit if no item:
|
||||
if (({_x == "ACE_DeadManSwitch"} count (items _unit)) == 0) exitWith {};
|
||||
|
||||
_deadman = [_unit, "DeadManSwitch"] call FUNC(getPlacedExplosives);
|
||||
private _range = getNumber (configFile >> "CfgWeapons" >> "ACE_DeadManSwitch" >> QGVAR(range));
|
||||
private _deadman = [_unit, "DeadManSwitch"] call FUNC(getPlacedExplosives);
|
||||
TRACE_2("placed",_deadman,_range);
|
||||
{
|
||||
[_unit, -1, _x, true] call FUNC(detonateExplosive);
|
||||
[_unit, _range, _x, true] call FUNC(detonateExplosive);
|
||||
} forEach _deadman;
|
||||
|
||||
//Handle deadman connected to explosive in inventory
|
||||
@ -44,5 +47,5 @@ if (_connectedInventoryExplosive != "") then {
|
||||
|
||||
private _explosive = createVehicle [_ammo, (getPos _unit), [], 0, "NONE"];
|
||||
_explosive setPosASL (getPosASL _unit);
|
||||
[_unit, -1, [_explosive, -1]] call FUNC(detonateExplosive); //Explode, ignoring range, with a random 0-1 second delay
|
||||
[_unit, -1, [_explosive, 0.5]] call FUNC(detonateExplosive); //Explode, ignoring range, with a 0.5 second delay
|
||||
};
|
||||
|
@ -21,17 +21,15 @@
|
||||
params ["_receiver", "_giver", "_item"];
|
||||
TRACE_3("params",_receiver,_giver,_item);
|
||||
|
||||
private ["_config", "_detonators"];
|
||||
if ((_receiver != ace_player) && {_giver != ace_player}) exitWith {};
|
||||
|
||||
if (_receiver != ace_player) exitWith {};
|
||||
|
||||
_config = ConfigFile >> "CfgWeapons" >> _item;
|
||||
private _config = ConfigFile >> "CfgWeapons" >> _item;
|
||||
if (isClass _config && {getNumber(_config >> QGVAR(Detonator)) == 1}) then {
|
||||
private ["_clackerItems"];
|
||||
_clackerItems = _giver getVariable [QGVAR(Clackers), []];
|
||||
_receiver setVariable [QGVAR(Clackers), (_receiver getVariable [QGVAR(Clackers), []]) + _clackerItems, true];
|
||||
|
||||
_detonators = [_giver] call FUNC(getDetonators);
|
||||
private _detonators = [_giver] call FUNC(getDetonators);
|
||||
if (count _detonators == 0) then {
|
||||
_giver setVariable [QGVAR(Clackers), nil, true];
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user