raiguard / EditorExtensions

Extends the Factorio map editor with new features, testing tools, and other utilities to aid with sandbox play and scenario creation.
https://mods.factorio.com/mod/EditorExtensions
Other
26 stars 6 forks source link

Items from testing lab leak to normal game #143

Closed bo-rys closed 1 year ago

bo-rys commented 1 year ago

Description

I think it started happening after I changed some settings, but now every time I leave the testing lab, items from my testing lab inventory get dropped on the floor in the normal game with the message 'Cannot insert [item]. Inventory is full.'

Reproduction

  1. Load save file https://www.dropbox.com/s/ys77ox9xndgx9vl/SEK2%20go.zip?dl=0
  2. Enter the testing lab
  3. Shift click some items from the right panel into the testing lab inventory
  4. Exit the testing lab
  5. Find one or more items scattered on the floor from the testing lab inventory
bo-rys commented 1 year ago

I think it happened because I unclicked 'match research in the testing lab setting'. After I turned it back on, the problem disappeared

raiguard commented 1 year ago

Thanks for the report. This is happening because I am changing the player's force before the map editor is toggled, which causes the map editor's inventory size to change if the inventory slots bonus is not equal between the testing lab force and the player's force. This causes the items to get spilled on the ground.

I need to keep this logic during the pre event for other reasons, so what I have done to "fix" it is to change the player's force before teleporting, so that the items will be spilled in the testing lab instead of the real world.