Reproduction steps:
- Set-up and load a minimal mod with the following control.lua script:
Code: Select all
function reproduce_bug(command) local player = game.players[command.player_index] if not global.inventory then global.inventory = global.inventory or game.create_inventory(1) global.inventory.insert({ name = "deconstruction-planner" }) end if not global.friendly then global.friendly = game.create_force("friendly") player.force.set_friend(global.friendly, true) global.friendly.set_friend(player.force, true) end deconstruction_planner = global.inventory[1] deconstruction_planner.tile_selection_mode = defines.deconstruction_item.tile_selection_mode.only local tiles = {} for x = -2, 2 do for y = -2, 2 do table.insert(tiles, {name = "stone-path", position = {x, y}}) end end player.surface.set_tiles(tiles) deconstruction_planner.deconstruct_area { surface = player.surface, force = global.friendly, area = { {-2, -2}, {2, 2} }, skip_fog_of_war = false, by_player = player } end commands.add_command("other_force_undo_crash", nil, reproduce_bug)
- Start a new game with only the crash reproduction mod and default map settings.
- Run the console command (this will spawn some tiles, and order their deconstruction for a force to which the player does not belong, but still mark it as initiated by the player) :
Code: Select all
/other_force_undo_crash
- Trigger undo action (CTRL-Z).
Expected results:
- During step (4), nothing happens.
- During step (4), the game crashes.
- Log file has been attached. Take note that I use a management script in order to run multiple Factorio instances in their dedicated directories (therefore the weird paths).
- This is fairly anomalous thing for a script to do, but I happened to be working on some code for the Construction Planner Continued mod which does some weird things with multiple forces and deconstruction planners when I ended-up triggering this (it was error in my mod code that this happened in the first place).
- Not sure what the real expected behaviour would be in this case since players normally do not deconstruct tiles in the name of other entities.
- I have not seen any issues being caused for entities, I think it affects only tiles.
- Crash was reproduced with versions 1.1.61 and 1.1.64.