Autodrive

by Pi-C

Car equipment for train avoidance, logistic network integration, circuit network connectivity, fuel refill, ammo reload, vehicle repair, radio control, enemy targeting, and gate control.

Content
24 days ago
0.17 - 1.1
2.43K
Transportation

b FIXED: Dummy passenger left on surface when vehicle is destroyed

4 years ago

Just found another bug:

  • Place a vehicle and make sure nobody is inside.
  • Use Follow-player sensor, Circuit-network sensor, or Radio Control to send it somewhere.
  • While the vehicle is moving, kill it.
  • The character of the dummy passenger will be left next to the remnants of the vehicle.

For now, I've included a fix in GCKI 0.17.11 (uploaded some minutes ago). However, this really should be fixed in Autodrive as not every user of your mod will also use mine. You just need to check in on_entity_died whether "autodrive-passenger" was in the killed vehicle and destroy it.

BTW: With Factorio 0.17.75, you can use event filters:

script.on_event(defines.events.on_entity_died, function(event)
    -- Your function goes here!
end, {LuaEntityDiedEventFilters = {filter = "type", type = "car"}})

I recommend filtering by type because {filter = "vehicle"} will also be triggered by locomotives and wagons. :-)

New response