Page 1 of 1

[Rseding91] [0.17.69] Crash: EntityWithForce::forceReRegistration

Posted: Sun Sep 22, 2019 5:51 pm
by Haphollas
I'm using a few mods in my current series including the Repair Turrets and the Construction drones.
When i want to manually pickup a specific construction drone the game will crash. I tried it twice to confirm that it's a repeatable error.
I uploaded the factorio-current.log and the savefile to my google drive here: https://drive.google.com/open?id=1EWQpp ... 10CVy_atyN
How to get the CTD:
Try to manually pickup the construction bot in front of the wall (red circle in the image)
https://drive.google.com/file/d/1dve_RC ... yuv-e/view

Re: [0.17.69] Crash: EntityWithForce::forceReRegistration

Posted: Sun Sep 22, 2019 8:22 pm
by boskid
I see why it crashes. Construction Drone when mined will trigger on_ai_command_completed(result=defines.behavior_result.fail) event that is catched by mod Construction Drones (construction_drone.lua:2291). It tries to update drone (process_drone_command) but drone is already being destroyed (player manual mining). I will try to make test for this.

Re: [0.17.69] Crash: EntityWithForce::forceReRegistration

Posted: Sun Sep 22, 2019 9:02 pm
by boskid
Yup, easy to reproduce in vanilla:
  1. New map at least 20x20
  2. Code: Select all

    /c
        function onAiDone(e)
            if global.biter and global.biter.valid then
                global.biter.teleport({5,5})
            end
        end
        script.on_event(defines.events.on_ai_command_completed, onAiDone);
        global.biter = game.surfaces["nauvis"].create_entity{name="small-biter", position={-5,-5}, force="enemy"};
        global.biter.set_command{type=defines.command.go_to_location, destination={-6,-6}}
        global.biter.destroy()
  3. Crash
    log
Notes: teleport must be during on_ai_command_completed, must teleport to different chunk and unit must have command set.

Re: [Rseding91] [0.17.69] Crash: EntityWithForce::forceReRegistration

Posted: Wed Sep 25, 2019 10:36 pm
by Rseding91
Thanks for the report. It's now fixed for the next version of 0.17.