viewing paste Unknown #6945 | 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 26
static inline int32 getarraysize(struct script_state* st, int32 id, int32 idx, int isstring, struct DBMap** ref) {
    int32 ret = idx;
    
    if( isstring )
    {
        for( ; idx < SCRIPT_MAX_ARRAYSIZE; ++idx )
        {
            char* str = (char*)script->get_val2(st, reference_uid(id, idx), ref);
            if( str && *str )
                ret = idx + 1;
            script_removetop(st, -1, 0);
        }
    }
    else
    {
        for( ; idx < SCRIPT_MAX_ARRAYSIZE; ++idx )
        {
            int32 num = (int32)__64BPTRSIZE(script->get_val2(st, reference_uid(id, idx), ref));
            if( num )
                ret = idx + 1;
            script_removetop(st, -1, 0);
        }
    }
    return ret;
}
 
Viewed 673 times, submitted by Guest.