Calling .destroy() on a vehicle with a player inside is fine.
Creating a vehicle on top of a vehicle and calling .destroy() is fine.
Creating a vehicle on top of a vehicle with a player inside and calling .destroy() kills the player.
Code: Select all
/c p = game.player s = p.surface v1 = s.create_entity{name="car", position=p.position, force=p.force} v1.set_driver(p) v2 = s.create_entity{name="car", position=p.position, force=p.force} v1.destroy()
Code: Select all
/c p = game.player s = p.surface v1 = s.create_entity{name="car", position=p.position, force=p.force} v1.set_driver(p) v2 = s.create_entity{name="car", position=p.position, force=p.force} v2.set_driver(p) v1.destroy()