Page 1 of 1

Summons with hostile_on_attack set

Posted: Sat Oct 23, 2010 2:58 am
by yufra
Here is a fun bug. Anorithil are members of the Sunwall faction, which have the hostile_on_attack flag set to true. This means that any creatures summoned by an Anorithil, say by an artifact, will be set to the same faction and also have hostile_on_attack. When those creatures are killed by the time limit a call to NPC:die with no src provided (/mod/class/ai/summon.lua:26) yields the following bug:

Code: Select all

[LOG]	#PINK#Your summoned ninurlhing disappears.
Lua Error: /mod/class/NPC.lua:92: attempt to index local 'src' (a nil value)
	At [C]:-1 
	At /mod/class/NPC.lua:92 die
	At /mod/ai//summon.lua:26 
	At (tail call):-1 
	At (tail call):-1 
	At /mod/class/NPC.lua:43 act
	At /engine/GameEnergyBased.lua:73 tick
	At /engine/GameTurnBased.lua:44 tick
	At /mod/class/Game.lua:453 
Maybe the if statement on line 91 of /mod/class/NPC.lua should grow a "and src" check?

Re: Summons with hostile_on_attack set

Posted: Sat Oct 23, 2010 1:36 pm
by darkgod
Well spotted! :)