Originally posted by [b]zippymccrackin[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=4554
I recently put an NPC with an OnTouch next to another NPC with an OnTouch. The first NPC was to detect if the player was on a quest and if not hide itself, and the other was to warp the player off of the airship depending on where the airship was. When I put the Quest NPC in, the warp stopped working, and I wondered as to why that happened. Investigating further, I found that when searching for an OnTouch, it will call only the first one it finds. My temporary fix is this:
function npc_touch_areanpc:
replace int i; with:
CODE
int i,j=0;
int npcs[map[m].npc_num];
int npccount = 0;
replace
CODE
&& y >= map[m].npc[i]->bl.y-ys && y <= map[m].npc[i]->bl.y+ys )
break;
with
CODE
&& y >= map[m].npc[i]->bl.y-ys && y <= map[m].npc[i]->bl.y+ys ) {
npcs[npccount++] = i;
f=0;
}
replace
CODE
if( i == map[m].npc_num )
with
CODE
if( npccount == 0 )
Then add this before the switch:
CODE
for( j=0; j<npccount; j++ ) {
i=npcs[j];
after the switch add the }
Any ramifications to doing this? I know this definitely fixed the problem for me.