Merge pull request #5414 from acemod/buildingLitter

Delete medical litter on building explosion
This commit is contained in:
commy2 2017-12-04 13:56:13 +01:00 committed by GitHub
commit bbda53ca1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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", {