DrVrej/VJ-Base

LUA-Error when VJ_PlayerDeath gets called without an attacker

CubeMath opened this issue · 3 comments

There is a gamemode that has nothing to do with the VJ Base mod, but has it installed.
That gamemode calls a Hook named "PlayerDeath" where their attacker is nil.
The function VJ_NPCPLY_DEATH causes the LUA-Error.

Can you check if the attacker is nil?

Something like this:

local function VJ_NPCPLY_DEATH(npc, attacker, inflictor)
	if attacker != nil && attacker.IsVJBaseSNPC == true then
		attacker:DoKilledEnemy(npc, attacker, inflictor)
		attacker:DoEntityRelationshipCheck()
	end
end

Thanks for the report, will be fixed soon.

If I spawn friendly and hostile NPCs with VJ_AK47, if someone kills each other, game hangs. Is this it?

Fixed in dba5875, thanks again for the report!

@nsherbina1999 No that sounds like a conflicting addon.