viewing paste Unknown #197 | C

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
int npc_event_sub(struct map_session_data* sd, struct event_data* ev, const char* eventname)
{
    if ( sd->npc_id != 0 )
    {
        //Enqueue the event trigger.
        int i;
        ARR_FIND( 0, MAX_EVENTQUEUE, i, sd->eventqueue[i][0] == '\0' );
        if( i < MAX_EVENTQUEUE )
        {
            safestrncpy(sd->eventqueue[i],eventname,50); //Event enqueued.
            return 0;
        }
 
        ShowWarning("npc_event: player's event queue is full, can't add event '%s' !\n", eventname);
        return 1;
    }
    if( ev->nd->sc.option&OPTION_INVISIBLE )
    {
        //Disabled npc, shouldn't trigger event.
        npc_event_dequeue(sd);
        return 2;
    }
    run_script(ev->nd->u.scr.script,ev->pos,sd->bl.id,ev->nd->bl.id);
    return 0;
}
Viewed 774 times, submitted by Guest.