mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge pull request #5414 from acemod/buildingLitter
Delete medical litter on building explosion
This commit is contained in:
commit
bbda53ca1a
@ -31,6 +31,20 @@ GVAR(heartBeatSounds_Slow) = ["ACE_heartbeat_slow_1", "ACE_heartbeat_slow_2"];
|
||||
if (isServer) then {
|
||||
["ace_placedInBodyBag", FUNC(serverRemoveBody)] call CBA_fnc_addEventHandler;
|
||||
[QGVAR(createLitterServer), FUNC(handleCreateLitter)] call CBA_fnc_addEventHandler;
|
||||
addMissionEventHandler ["BuildingChanged", {
|
||||
if (isNil QGVAR(allCreatedLitter)) exitWith {};
|
||||
params ["_buildingOld", "_buildingNew", "_isRuin"];
|
||||
TRACE_3("BuildingChanged",_buildingOld,_buildingNew,_isRuin);
|
||||
private _radius = sizeOf typeOf _buildingOld / 2;
|
||||
TRACE_1("",_radius);
|
||||
{
|
||||
_x params ["", "_objects"];
|
||||
if (({(_x distance2d _buildingOld) < _radius && {getPos _x select 2 > 0.1}} count _objects) > 0) then {
|
||||
GVAR(allCreatedLitter) deleteAt (GVAR(allCreatedLitter) find _x);
|
||||
{ TRACE_1("deleting",_x); deleteVehicle _x } forEach _objects;
|
||||
};
|
||||
} forEach (+GVAR(allCreatedLitter));
|
||||
}];
|
||||
};
|
||||
|
||||
["ace_unconscious", {
|
||||
|
Loading…
Reference in New Issue
Block a user