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

This subforum contains all the issues which we already resolved.
Post Reply
Haphollas
Burner Inserter
Burner Inserter
Posts: 9
Joined: Tue Apr 03, 2018 11:23 am
Contact:

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

Post 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

User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2228
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [0.17.69] Crash: EntityWithForce::forceReRegistration

Post 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.

User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2228
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [0.17.69] Crash: EntityWithForce::forceReRegistration

Post 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.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13176
Joined: Wed Jun 11, 2014 5:23 am
Contact:

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

Post by Rseding91 »

Thanks for the report. It's now fixed for the next version of 0.17.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Resolved Problems and Bugs”