mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Vehicle Damage - Add turret tossing again (#9989)
Co-authored-by: Jouni Järvinen <rautamiekka@users.noreply.github.com>
This commit is contained in:
parent
f45dff8a09
commit
56016a4816
@ -31,26 +31,14 @@
|
||||
["Car", "init", LINKFUNC(addEventHandler), true, [], true] call CBA_fnc_addClassEventHandler;
|
||||
};
|
||||
|
||||
// blow off turret effect
|
||||
/*
|
||||
Disabled temporarily due to issues with being able to repair tanks after death. Needs work
|
||||
*/
|
||||
/*["Tank", "killed", {
|
||||
if (random 1 < 0.15) then {
|
||||
// Blow off turret effect
|
||||
// TODO: Add blowing-off-turret effect to vehicles that cook-off but aren't destroyed (no catastrophic explosion)
|
||||
// The problem is that vehicles are repairable if they haven't been destroyed. So if the turret is gone and vehicle is repaired, how do we handle that?
|
||||
["Tank", "Killed", {
|
||||
if (_this select 3 && random 1 < 0.15) then {
|
||||
(_this select 0) call FUNC(blowOffTurret);
|
||||
};
|
||||
}, true, [], true] call CBA_fnc_addClassEventHandler;*/
|
||||
|
||||
// event to add a turret to a curator if the vehicle already belonged to that curator
|
||||
if (isServer) then {
|
||||
[QGVAR(addTurretToEditable), {
|
||||
params ["_vehicle", "_turret"];
|
||||
|
||||
{
|
||||
_x addCuratorEditableObjects [[_turret], false];
|
||||
} forEach (objectCurators _vehicle);
|
||||
}] call CBA_fnc_addEventHandler;
|
||||
};
|
||||
}, true, [], true] call CBA_fnc_addClassEventHandler;
|
||||
};
|
||||
|
||||
// init eject from destroyed vehicle
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Blow off turret effect.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Vehicle <Object>
|
||||
* 0: Vehicle <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
@ -15,13 +15,12 @@
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
// delayed so the object is spawned after the model changes to a wreck
|
||||
// the sudden change in the model would cause nearby physx objects to get stuck
|
||||
// Delayed so the object is spawned after the model changes to a wreck
|
||||
// The sudden change in the model would cause nearby PhysX objects to get stuck
|
||||
[{
|
||||
params ["_vehicle"];
|
||||
|
||||
private _config = _vehicle call CBA_fnc_getObjectConfig;
|
||||
getArray (_config >> QGVAR(turret)) params [["_model", "", [""]], ["_offset", [0,0,0], [[]], 3]];
|
||||
(getArray (configOf _vehicle >> QGVAR(turret))) params [["_model", "", [""]], ["_offset", [0, 0, 0], [[]], 3]];
|
||||
|
||||
if (_model isEqualTo "") exitWith {};
|
||||
|
||||
@ -31,6 +30,8 @@
|
||||
_turret setVectorUp [random 1, random 1, 1];
|
||||
_turret setVelocity [random 7, random 7, 8 + random 5];
|
||||
|
||||
// add turret to all curators that already own the wreck
|
||||
[QGVAR(addTurretToEditable), [_vehicle, _turret]] call CBA_fnc_serverEvent;
|
||||
// Add turret to all curators that already own the wreck
|
||||
if (["ace_zeus"] call EFUNC(common,isModLoaded)) then {
|
||||
[QEGVAR(zeus,addObjects), [[_turret], objectCurators _vehicle]] call CBA_fnc_serverEvent;
|
||||
};
|
||||
}, _this, 1] call CBA_fnc_waitAndExecute;
|
||||
|
Loading…
Reference in New Issue
Block a user