Issue information

Issue ID
#4698
Status
Fixed
Severity
None
Started
Hercules Elf Bot
Jan 8, 2011 14:01
Last Post
Hercules Elf Bot
Jan 8, 2011 14:01
Confirmation
N/A

Hercules Elf Bot - Jan 8, 2011 14:01

Originally posted by [b]Epoque[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=4698

It seems that when you're running a script command to parse a progress bar and the bar is in a loop, the script fails to re-attach the player. I'm unsure of the specific reasons why, but it seems when you run it the first time, it completely detaches the player. Then, when it runs the second time, it fails to recognise the player as attached to anything. Example of NPC to reproduce:

CODE
prontera,150,150,0   script  test    910,{
        mes "Starting progressbar loop...";
        close2;
        for (set .@i,0; .@i<10; set .@i,.@i+1) {
                setlook 7, .@i;
                dispbottom "This is style number " + .@i + ".";
                progressbar "FFFF00",1; // 1 seconds
        }
        end;
}


This example was created by BrianL. He mentioned something about:

QUOTE (BrianL)
I found that adding 'sleep2' makes it work because 'sleep2' sets the script state to RERUNLINE/RUN and this seems to "reattach" the player to the script (which sets st->oid to npc_id), so when the loop gets to the 2nd 'progressbar', sd->progressbar.npc_id gets set to an integer instead of 0.