Originally posted by [b]Koca[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=2419
Hello, after bugfix in Kiel Hyre Quest (.KHKilled -> mobcount()), the key isn't dropped anymore. That's because "Kill Event" of mob runs before the mob is removed from memory and for the last one killed, it returns "1". In mob_dead function, there's this help:
CODE
md->status.hp = 0; //So that npc_event invoked functions KNOW that mob is dead
That can be used in script.c, buildin_mobcount_sub function. diff fo fix this:
CODE
Index: script.c
===================================================================
--- script.c (revision 13347)
+++ script.c (working copy)
@@ -9530,7 +9530,8 @@
static int buildin_mobcount_sub(struct block_list *bl,va_list ap) // Added by RoVeRT
{
char *event=va_arg(ap,char *);
- if(strcmp(event,((struct mob_data *)bl)->npc_event)==0)
+ struct mob_data *md = ((struct mob_data *)bl);
+ if(strcmp(event,md->npc_event)==0 && md->status.hp > 0)
return 1;
return 0;
}
Thanks (IMG:
style_emoticons/default/ani_meow.gif)
This post has been edited by Koca: Nov 3 2008, 08:25 AM