Tinter / Tinter-Furniture

Script to return the furniture from space
GNU General Public License v3.0
13 stars 4 forks source link

Killed event handler not triggered for partially destroyed buildings. #23

Closed Tinter closed 4 years ago

Tinter commented 4 years ago

Some buildings have partially destroyed models. If they go through this model, instead of dying outright, then the killed eventhandler will never fire, thus it won't get dressed down. Furniture will disappear with distance and stay gone however.

Tinter commented 4 years ago

Another symptom of this issue is floating furniture, when the floor disappears, the furniture stay will hover.

I don't know of any way to detect whether a building has been damaged enough to be replaced by another building, I assumed the killed event handler would do this. I tried a fix where I would check the height of furniture above a given surface when damaged, but it would result in furniture on upper floors disappearing when you threw a grenade in, since the damage threshold is too low.

Tinter commented 4 years ago

Workaround is possible by using the damaged eventhandler and then waiting a small bit and see if the alive variable has changed. Commit b55c613 does this.