fodev.net
FOnline Development => Questions and Answers => Topic started by: SEGA_RUS on August 16, 2015, 04:31:13 pm
-
[14:09:560] Script exception: Null pointer access : main : void critter_dead(Critter&inout, Critter@) : 5474, 3 : FOServer::KillCritter : Npc (5002122).
[14:09:560] Execution of script stopped due to exception.
[14:09:560] Context<FOServer::KillCritter : Npc (5002122)>, state<Exception>, call stack<1>:
[14:09:560] 0) main : void critter_dead(Critter&inout, Critter@) : 5474, 3.
My path
void critter_dead(Critter& cr, Critter@ killer)
............................................
// npc
if(cr.IsNpc() && killer.IsPlayer() )
{
// Добавляет в стек игрока. Было Clear NPC memory about enemies after it dies.
cr.AddEnemyInStack(killer.Id);
}
else // players
NPC with 5002122 ID have 1 player in enemy stack?
Is it something wrong in critter_dead working?
How to disable that callbacks or fix it?
-
killer can be null and you're not checking it before using.
if(cr.IsNpc() && (valid(killer) && killer.IsPlayer()) )
Oh btw, your code does exactly opposite of what comment says :P [at least english part]
-
killer can be null and you're not checking it before using.
if(cr.IsNpc() && (valid(killer) && killer.IsPlayer()) )
Oh btw, your code does exactly opposite of what comment says :P [at least english part]
Thanks Wipe. I found 4 ghouls in 1 Glow lvl. They are dying and respawning after some sec.
// npc
if(cr.IsNpc())
{
if(valid(killer) && killer.IsPlayer())
{
// Добавляет в стек убийцу. Было Clear NPC memory about enemies after it dies.
cr.AddEnemyInStack(killer.Id);
}
}
else // players
btw there is on russian Add killer in stack. Was Clear NPC memory about enemies after it dies.