[0.17.2] Crash when shooting a unit: "Unset shooting target" (modded)

This subforum contains all the issues which we already resolved.
TheSAguy
Smart Inserter
Smart Inserter
Posts: 1459
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

[0.17.2] Crash when shooting a unit: "Unset shooting target" (modded)

Post 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.
Attachments
Crash.zip
(1.38 MiB) Downloaded 40 times
Natural_Evolution_Enemies_0.17.0.zip
(1.34 MiB) Downloaded 41 times
factorio-current.log
(12.08 KiB) Downloaded 51 times
orzelek
Smart Inserter
Smart Inserter
Posts: 3928
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [0.17.2] Crash when shooting a unit - MOD

Post 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.
TheSAguy
Smart Inserter
Smart Inserter
Posts: 1459
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Re: [0.17.2] Crash when shooting a unit - MOD

Post 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
	
TheSAguy
Smart Inserter
Smart Inserter
Posts: 1459
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Re: [0.17.2] Crash when shooting a unit - MOD

Post by TheSAguy »

So it's something to do with my fire-explosion creation, but what I'm having a hard time determining...
orzelek
Smart Inserter
Smart Inserter
Posts: 3928
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [0.17.2] Crash when shooting a unit - MOD

Post by orzelek »

I think dev will need to take a look. I have no idea what could be FluidBox doing in that call stack :D
posila
Former Staff
Former Staff
Posts: 5448
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: [0.17.2] Crash when shooting a unit: "Unset shooting target" (modded)

Post by posila »

Thanks for the report.
This should be fixed as of 0.17.12 or 0.17.13
Post Reply

Return to “Resolved Problems and Bugs”