Page 1 of 1

[2.1.9] Vehicle inventory bonus reset when teleported to another surface

Posted: Tue Jun 30, 2026 3:15 pm
by robot256
What did you do?
1. Load the attached save in stock Space Age.
2. Observe the Tank has one Toolbelt equipment installed in its equipment grid, so its inventory is 90 slots instead of the usual 80. It is filled with 900 water barrels.
3. Run the displayed Code Snippet by selecting the Tank. It will be teleported to Vulcanus, and the inventory contents before and after will be printed to the console. This is what the code snippet contains:

Code: Select all

local tank = game.get_entity_by_unit_number(15)
local trunk = tank.get_inventory(defines.inventory.car_trunk)
game.print("Tank inventory size before teleporting: "..tostring(#trunk))
game.print("Tank inventory contents before teleporting:\n"..serpent.block(trunk.get_contents()))
if tank.teleport({0,0},"vulcanus") then
    game.print("Tank was teleported to Vulcanus.")
else
    game.print("Error teleporting tank to Vulcanus.")
end
game.print("Tank inventory size after teleporting: "..tostring(#trunk))
game.print("Tank inventory contents after teleporting:\n"..serpent.block(trunk.get_contents()))
What happened?
The result of the last two commands shows that after teleporting to Vulcanus, the Tank trunk inventory only has 80 slots and 800 water barrels in it.
In this state, removing and replacing the toolbelt from the equipment grid adds 10 empty slots to the inventory.
What did you expect to happen?
I expected the toolbelt inventory bonus to remain after teleporting to Vulcanus, and for all 900 water barrels to remain in the inventory.

Note that the inventory bonus remains intact when teleporting to another position on the same surface, and when cloning the vehicle to another surface. Only teleporting to another surface resets the bonus.

This was reported to me weeks ago by a user of VehicleWagon2 because in that mod, I teleport vehicles to hidden surface while they are "on the train". When the player unloaded his tank from the train (teleporting it back to the visible surface), it had fewer items than when it was first loaded.

Re: [2.1.9] Vehicle inventory bonus reset when teleported to another surface

Posted: Tue Jun 30, 2026 9:01 pm
by Rseding91
Thanks for the report. This is now fixed for the next release.