Page MenuHomeFeedback Tracker

BuildingChanged returns true for isRuin when you destroy glass
Feedback, NormalPublic

Description

isRuin returns true when you break glass on a building. Tested on a few vanilla buildings and it seems to fire, not really ideal as you'd expect the building to be destroyed when this happens.

For example, I want to delete all the placed objects in a building when it's destroyed to stop them floating. Currently if you break a window, then it would clean up everything. I'd expect isRuin to only fire when the actual model changes from normal to the ruined one.

Details

Severity
Minor
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Category
Scripting
Steps To Reproduce

Place a building with destructable glass (possibly other destructable bits, not sure what else can be done in cfg). Run the below code in debug and pretend your the baddie in Die Hard, "schieß dem fenster".

addMissionEventHandler ["BuildingChanged", {call my_test_fnc}];

my_test_fnc= {
    params ["_buildingOld", "", "_isRuin"];

    if (_isRuin) then {
        systemChat format ["%1 is a ruin: %2",_buildingOld,_isRuin];
    };
};

Checked Land_i_Shed_Ind_F, Land_Addon_04_F and Land_Airport_02_controlTower_F

Additional Information

Perf branch: 2.08.149689

Event Timeline

Cyruz created this task.Jul 16 2022, 4:02 PM
Cyruz edited Additional Information. (Show Details)Jul 16 2022, 4:07 PM

Checked on stable, works as expected (doesn't fire the EH on glass break)

NOOOOOOOOOOOOOOOOOOOOOO

BIS_fnc_KK removed BIS_fnc_KK as the assignee of this task.Jul 21 2022, 1:06 PM
BIS_fnc_KK changed the task status from New to Feedback.
BIS_fnc_KK added a subscriber: BIS_fnc_KK.