Page 1 of 1

[2.1.19] Using damage_tile to destroy a tile underneath of an entity that just died causes a game freeze

Posted: Sun Sep 20, 2026 9:04 pm
by oofmanstan
In my mod I have this code set up to damage half of a space platform tiles hp when the entity on top of it dies.

script.on_event(defines.events.on_entity_died, function(event)
local position = event.entity.position
position.x = math.floor(position.x, clamped)
position.y = math.floor(position.y, clamped)
game.print(position)
local tile = event.entity.surface.get_tile(position)
if tile and tile.name == "space-platform-foundation" then
event.entity.surface.platform.damage_tile{position = position, damage = 25}
end
end)


When the entity (I am testing this with walls) dies the first time, the space platform beneath it is dealt 25 damage and nothing unexpected happens.
However, after the wall is rebuilt and destroyed again with the tile underneath of it not having been repaired, the game will freeze.

I am not sure what is causing this. Also, if anyone has a better way to mimic the behaviour of colliding with both space platform tiles and entities on top of them like asteroids, please tell me because I cannot figure it out and this is my best effort.

Thanks!

Re: [2.1.19] Using damage_tile to destroy a tile underneath of an entity that just died causes a game freeze

Posted: Mon Sep 21, 2026 12:45 pm
by Rseding91
Thanks for the report. This is now fixed for the next release.