VehicleSnap

by Zaflis

Smoothly snaps movement angle when driving cars or tanks.

Content
20 days ago
0.13 - 2.0
240K
Transportation

b Crash when player is killed when inside a vehicle

5 years ago

We have a scenario that has shared player damage and so a player can be killed while inside a healthy vehicle if their team mates take too much damage.
When this happens Vehicle Snap errors.
I wasn't on the server at the time so don't have the exact error message.
Found when using version 1.16.3.

This should be reproducible by being in a vehicle and using an API command to inflict enough damage on your player to kill you.

5 years ago
(updated 5 years ago)

Thanks for report, i'll check how to fix that. Using /c game.players[1].character.die() i got:

Error while running event VehicleSnap::on_tick (ID 0)
VehicleSnap/control.lua:102: attempt to index field 'vehicle' (a nil value)

It's not line 102 in 1.16.3 it seems.. I was still using 1.16.2 myself because it works fine in SP.

5 years ago

cool, glad it was reproducible :)

5 years ago

It's fixed now i hope. I didn't add a check for vehicle being not null because any extra code just adds to UPS. Instead using event on_player_died to recheck driving state. But if it continues to crash even rarely i might have to add the check.

New response