viewing paste Unknown #6059 | Text

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 26 27 28 29 30 31 32
Index: src/map/script.c
===================================================================
--- src/map/script.c    (revision 17341)
+++ src/map/script.c    (working copy)
@@ -627,11 +627,14 @@
 static char* script_getfuncname(struct script_state *st)
 {
    int i;
-   char* name = "";
+   char* name = NULL;
    for( i = 0; i < st->stack->sp; ++i ) {
        struct script_data* data = &st->stack->stack_data[i];
-       if(data->type == C_NAME && str_data[data->u.num].type == C_FUNC)
+       if(data->type == C_NAME && str_data[data->u.num].type == C_FUNC) {
            name = reference_getname(data);
+           if(strcmp(name,"jump_zero"))
+               break;
+       }
    }
    return name;
 }
@@ -9830,9 +9833,9 @@
 
    //If from NPC we make default flag 1 to be unavoidable
    if(nd && nd->bl.id == fake_nd->bl.id)
+       flag = script_hasdata(st,5+start_type)?script_getnum(st,5+start_type):2;
+   else
        flag = script_hasdata(st,5+start_type)?script_getnum(st,5+start_type):1;
-   else
-       flag = script_hasdata(st,5+start_type)?script_getnum(st,5+start_type):2;
 
    rate = script_hasdata(st,4+start_type)?min(script_getnum(st,4+start_type),10000):10000;
Viewed 582 times, submitted by Guest.