EwenQuim / renpy-graphviz

Draws a flowchart graph of any Visual Novel from Renpy .rpy files !
https://ewenquim.github.io/renpy-graphviz/
GNU Affero General Public License v3.0
132 stars 4 forks source link

Local labels are incorrectly detected in call statement when mixed with other call/jump statements) #75

Open hsandt opened 3 months ago

hsandt commented 3 months ago

Take this simple flow:


label scene1:
    # menu is just to give a concrete example
    # but even without it, you can reproduce the bug
    menu:
        "A":
            jump .a
        "B":
            jump .b
    return

label .a:
    return

label .b:
    return

It generates the following graph (passing -hide-screens to simplify): renpy-graphviz

Now replace the second jump with a call:

    menu:
        "A":
            jump .a
        "B":
            call .b
    return

renpy-graphviz

The path to .b is now missing.

Now use call on first statement only:

    menu:
        "A":
            call .a
        "B":
            jump .b
    return

renpy-graphviz

This time, the path to .a is missing.

Finally, use call everywhere:

    menu:
        "A":
            call .a
        "B":
            call .b
    return

renpy-graphviz

and nothing appears.