[0.9.8 Script Crash] onentitydied event.entity.destroy()

This subforum contains all the issues which we already resolved.
Post Reply
User avatar
FreeER
Smart Inserter
Smart Inserter
Posts: 1266
Joined: Mon Feb 18, 2013 4:26 am
Contact:

[0.9.8 Script Crash] onentitydied event.entity.destroy()

Post by FreeER »

So as the title says, calling destroy() on the entity from the onentitydied event crashes Factorio to the desktop...Should probably raise a script error (or ignore the call) instead. Yes I realize it's a minor issue but thought I'd mention it.
As a side note, this bug was discovered when attempting to prevent ghosts from being created for an entity see Modding help: Ghost entities

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.9.8 Script Crash] onentitydied event.entity.destroy()

Post by kovarex »

Hi, thanks for the report.

Yes, and not even talking about trying to call entity.die() :)
My humble guess is, that crashes on stack overflow.

Fixed for 0.10, it will not throw error, but calling die, or destroy on entity in the process of destroying it will just be silently discarded.

P.S. I don't have time to test this kind of bug, but as the fix is quite simple, it should work, let me know if it isn't so.

User avatar
FreeER
Smart Inserter
Smart Inserter
Posts: 1266
Joined: Mon Feb 18, 2013 4:26 am
Contact:

Re: [0.9.8 Script Crash] onentitydied event.entity.destroy()

Post by FreeER »

kovarex wrote:Yes, and not even talking about trying to call entity.die() :)
Oh, I hadn't even tested die(), figured if destroy crashed it die would likely be just as bad (since it involves health and dropping the loot as well). I suppose I got a bit lazy there, :lol:
My humble guess is, that crashes on stack overflow.
Seems like a fair guess
P.S. I don't have time to test this kind of bug, but as the fix is quite simple, it should work, let me know if it isn't so.
A 'quick' build of master (which takes a nice 45 minutes or so on my laptop...) reveals no crashes, I'll test again with the official release of 0.10, when it's out, to be sure but I doubt any problems would be reintroduced at this point.

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.9.8 Script Crash] onentitydied event.entity.destroy()

Post by kovarex »

FreeER wrote:A 'quick' build of master (which takes a nice 45 minutes or so on my laptop...) reveals no crashes, I'll test again with the official release of 0.10, when it's out, to be sure but I doubt any problems would be reintroduced at this point.
Great, thanks for the check, we should find a time to optimise the make again :)

Post Reply

Return to “Resolved Problems and Bugs”