[Raiguard] [2.0.15] Mod scripts interacting with remote view/driving can make a vehicle undrivable
Posted: Sun Nov 17, 2024 1:22 am
If a mod script executes the following code (given appropriate tank1/tank2/player references):
Then tank1 gets stuck in a state where it can't be driven. Selected in remote view, it will show the green "Drive Remotely" button, but clicking it fails and pops up the "Vehicle already has a driver" message. Entering the tank physically is possible, but it can't be driven.
Code: Select all
player.set_controller({
type = defines.controllers.remote,
position = tank1.position,
surface = tank1.surface,
})
tank1.set_driver(player)
player.set_controller({
type = defines.controllers.remote,
position = tank2.position,
surface = tank2.surface,
})
tank2.set_driver(player)
player.set_controller({
type = defines.controllers.remote,
position = tank1.position,
surface = tank1.surface,
})