multitheftauto / mtasa-blue

Multi Theft Auto is a game engine that incorporates an extendable network play element into a proprietary commercial single-player game.
https://multitheftauto.com
GNU General Public License v3.0
1.4k stars 435 forks source link

Setting aircraft vehicle health to zero causes infinite blowing #2443

Open Xenius97 opened 2 years ago

Xenius97 commented 2 years ago

Describe the bug Spawn a helicopter or plane, change health to 0. When you change health, and heli explodes onVehicleExplode && onClientVehicleExplode won't detect. Sometimes heli keeps blowing after fixing it. + When you change health to zero sometimes it causes infinite blowing.

Expected behaviour Work as another vehicles

Screenshots https://youtu.be/ZBt0AzxKaao

Version Multi Theft Auto v1.5.9-release-21024.1

Lpsd commented 2 years ago

What you're seeing is intended behaviour.

All cars/helicopters/planes etc, once set to 0 health, will have ~5 seconds before they actually "explode" and are destroyed.

In the case of cars, they will set on fire before exploding. However with helicopters and planes, they have an explosion effect instead of being set on fire (which is what you describe as "infinite blowing"). This is the same in singleplayer.

blowVehicle instantly triggers the explosion which "destroys" the vehicle.

This is why the on(Client)VehicleExplode event fires instantly when using :blow(), but there's a delay when setting vehicle health to 0.

Xenius97 commented 2 years ago

If you change health to zero, onVehicleExplode && onClientVehicleExplode will never trigger on helicopters/planes. I think it's bug.

Lpsd commented 2 years ago

That's not shown either by your video, or by testing that I did myself. The event triggers fine after setting health to 0, just ~5 seconds afterwards as I've explained above.

Your own video shows the event firing after 5 seconds. At around 1:52 you set the helicopter health to 0, then at around 1:58 the event is triggered once the pre-explosion effects are finished (see debugscript output).

Please provide new details if you're experiencing something other than what's been shown and explained to be intended behaviour.