Page 1 of 1
[0.17.2] Crash when shooting a unit: "Unset shooting target" (modded)
Posted: Thu Feb 28, 2019 6:44 pm
by TheSAguy
Hi,
For some reason, I'm getting a CTD when I shoot one of my created units.
I've created 8 new unit types, but for some reason it only seems to crashed on the two red unit types - 1 biter and 1 spitter...
I've attached the MOD, Save and LOG. the Mod has not yet been published.
Thanks.
Re: [0.17.2] Crash when shooting a unit - MOD
Posted: Thu Feb 28, 2019 7:00 pm
by orzelek
Are you doing something specific on death of those units?
While game should not crash it seems that there is something really weird going on in death handler.
Re: [0.17.2] Crash when shooting a unit - MOD
Posted: Thu Feb 28, 2019 7:23 pm
by TheSAguy
Okay, so yes I am doing some stuff in control.
I have these and this is causing the problem:
Code: Select all
--- Check for Fire Biter
function isFireBiter(entity)
return (string.find(entity.name, "ne%-biter%-fire%-") or string.find(entity.name, "ne%-spitter%-fire%-"))
end
Code: Select all
local function On_Death(event)
....
if isFireBiter(entity) and entity.type == "unit" and UnitNumber(entity) ~= nil then
if math.floor(UnitNumber(entity)) < 5 then
surface.create_entity({name="ne-small-fire-explosion", position = pos, force = "enemy"})
elseif math.floor(UnitNumber(entity)) < 15 then
surface.create_entity({name="ne-medium-fire-explosion", position = pos, force = "enemy"})
else
surface.create_entity({name="ne-big-fire-explosion", position = pos, force = "enemy"})
end
end
end
Re: [0.17.2] Crash when shooting a unit - MOD
Posted: Thu Feb 28, 2019 7:38 pm
by TheSAguy
So it's something to do with my fire-explosion creation, but what I'm having a hard time determining...
Re: [0.17.2] Crash when shooting a unit - MOD
Posted: Thu Feb 28, 2019 10:27 pm
by orzelek
I think dev will need to take a look. I have no idea what could be FluidBox doing in that call stack

Re: [0.17.2] Crash when shooting a unit: "Unset shooting target" (modded)
Posted: Tue Apr 02, 2019 11:16 am
by posila
Thanks for the report.
This should be fixed as of 0.17.12 or 0.17.13