I got this fixed with the help with ChatGPT ... lol
Replace lines 85–87 in events/toggle-map.lua.
Original lines:
local physical_vehicle = player.physical_vehicle --[[@as LuaEntity]] --BUG docu means a MapPosition, but it is a LuaEntity
local driver = physical_vehicle and physical_vehicle.get_driver() or nil
local passenger = physical_vehicle and physical_vehicle.get_passenger() or nil
Replace with this:
local physical_vehicle = player.physical_vehicle --[[@as LuaEntity]] --BUG docu means a MapPosition, but it is a LuaEntity
local is_vehicle_with_seats =
physical_vehicle
and physical_vehicle.valid
and (
physical_vehicle.type == "car"
or physical_vehicle.type == "spider-vehicle"
or physical_vehicle.type == "cargo-pod"
)
local driver = is_vehicle_with_seats and physical_vehicle.get_driver() or nil
local passenger = is_vehicle_with_seats and physical_vehicle.get_passenger() or nil
and then Line 100 (it will actually be further down if you replace the lines above first)
Original code:
if physical_vehicle then
replace with:
if is_vehicle_with_seats then
However - be warned that if you are traveling at high speeds in the train, when you depart map view - you will be ejected from the train and the train with keep going at high speeds lol so be prepared to try to JUMP BACK ON!