Skip to content

Break command doesn't work correctly in FOROBJS statements #1534

@DavideRei

Description

@DavideRei

I don't know if it's supposed to work only in FOR ENDFOR statments (where it seems to work fine) but with FOROBJS or FORCHARS or FORITEMS sometimes doesn't jump to the correct script line.

Example

[FUNCTION f_test_break]

FOROBJS 10

    if (<dlocal.found> == 1)
        serv.log break
        break
    endif

    serv.log cycle <dlocal._for> <uid> <name>

    if (<f_check_enemy <src>,<uid>> == 1)

        local.found= 1

        if (<dlocal.found> == 1)

            serv.log found one

        endif

    endif

ENDFOR

serv.log outside break
[FUNCTION f_check_enemy]
ref1=<ARGV[0]>
ref2=<ARGV[1]>

if (!<ref2.isplayer>)
    return 1
else
    return 0
endif
Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions