[Rseding91] [0.14.x] Hard crash on "on_entity_died" event.

This subforum contains all the issues which we already resolved.
BlackSalander
Burner Inserter
Burner Inserter
Posts: 5
Joined: Tue Mar 08, 2016 3:08 am
Contact:

[Rseding91] [0.14.x] Hard crash on "on_entity_died" event.

Post by BlackSalander »

The game hard crashes when I try to call "destroy()" inside "on_event_died" for the fire that killed the entity

I used this script that destroys any fire in an area around every entity killed

Code: Select all

script.on_event(defines.events.on_entity_died, function(event)
	local area_start = {event.entity.position.x - 10, event.entity.position.y - 10}
	local area_end = {event.entity.position.x + 10, event.entity.position.y + 10}

	for _, ent in pairs(event.entity.surface.find_entities{area_start, area_end}) do
		if ent.valid then
			if ent.type == "fire" then
				ent.destroy()
			end
		end
	end
end)
If I set something on fire on the game, it crashes right before the entity is killed
Attachments
factorio-current.log
(6 KiB) Downloaded 152 times
Rseding91
Factorio Staff
Factorio Staff
Posts: 14280
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [Rseding91] [0.14.x] Hard crash on "on_entity_died" event.

Post by Rseding91 »

Fixed for 0.14.13.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Resolved Problems and Bugs”