Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue where running destroyCity with CUP interiors could crash #3359

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 11 additions & 14 deletions A3A/addons/core/functions/Base/fn_destroyCity.sqf
Original file line number Diff line number Diff line change
@@ -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;