diff --git a/A3A/addons/core/functions/Base/fn_destroyCity.sqf b/A3A/addons/core/functions/Base/fn_destroyCity.sqf index 3814493f32..f6de9102e1 100644 --- a/A3A/addons/core/functions/Base/fn_destroyCity.sqf +++ b/A3A/addons/core/functions/Base/fn_destroyCity.sqf @@ -1,21 +1,18 @@ -private ["_markerX","_positionX","_size","_buildings"]; +params ["_markerX"]; -_markerX = _this select 0; +private _positionX = getMarkerPos _markerX; +private _size = [_markerX] call A3A_fnc_sizeMarker; -_positionX = getMarkerPos _markerX; -_size = [_markerX] call A3A_fnc_sizeMarker; - -_buildings = _positionX nearobjects ["house",_size]; +private _buildings = _positionX nearObjects ["house",_size]; { -if (random 100 < 70) then - { - for "_i" from 1 to 7 do - { - _x sethit [format ["dam%1",_i],1]; - _x sethit [format ["dam %1",_i],1]; - }; - } + private _hitpoints = getAllHitPointsDamage _x; + if (_hitpoints isEqualTo []) then { continue }; + if (random 100 < 30) then { continue }; + private _building = _x; + { + _building setHit [_x, 1]; + } forEach (_hitpoints # 1 select { _x find "dam" == 0 }); } forEach _buildings; [_markerX,false] spawn A3A_fnc_blackout; \ No newline at end of file