Page 1 of 1

[Klonan] [2.1.12] Crash calling LuaCommandable.set_command() (BuildBaseBehavior::prepareBuilding)

Posted: Wed Jul 29, 2026 4:27 pm
by Luamaniemi
OS: Windows 11 x64 25h2 build 26200.8973
Factorio version: 2.1.12
DLCs: no

Description:
Crash in BuildBaseBehavior::prepareBuilding (Access Violation 0x000000000BADC0DE) when calling LuaCommandable.set_command inside on_build_base_arrived. The Lua event handler itself completes fully, but the game immediately crashes afterward.

The issue is not reproduced in 2.0.77
The issue is reproduced in vanilla and with space age dlc
factorio-previous.log attached

Minimal code that causes the crash (the relevant mod is attached):

Code: Select all

function set_command_function(event)
    local biter_group = event.group
    biter_group.set_command({
        type = defines.command.go_to_location,
        destination_entity = storage.crash_chest
    })
end

function register_chest(event)
    storage.crash_chest = event.entity
end

local event_filter =
{{filter = "name", name = "commandable-crash-test-chest"}}
script.on_event(defines.events.on_built_entity, register_chest, event_filter)
script.on_event(defines.events.on_build_base_arrived, set_command_function)
Steps to reproduce:
  1. Load the game with the attached mod or other implementation of the script above.
  2. Place the test entity (commandable-crash-test-chest).
  3. Allow a biter group to trigger a base build expansion.
  4. When on_build_base_arrived fires and biter_group.set_command is invoked, and the game crashes seemingly on the same tick after the Lua event handler returns
Expected Behavior:
No crash lol

Re: [Klonan] [2.1.12] Crash calling LuaCommandable.set_command() (BuildBaseBehavior::prepareBuilding)

Posted: Wed Jul 29, 2026 7:07 pm
by Klonan
Luamaniemi wrote: Wed Jul 29, 2026 4:27 pm Expected Behavior:
No crash lol
Thanks for the report, and welcome to the forum

It is now fixed for an upcoming release (most likely the next)