Issue information

Issue ID
#3142
Status
Fixed
Severity
None
Started
Hercules Elf Bot
May 29, 2009 9:48
Last Post
Hercules Elf Bot
Mar 23, 2012 10:22
Confirmation
N/A

Hercules Elf Bot - May 29, 2009 9:48

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

Hi, I believe there is an infinite loop within the Banish Winter Quest.

After I brought Baba Yaga the items,

I'm supposed to cook up a concoction by following the instructions on the book.

I tried to follow the instructions, but it seems that I can never finish making the concoction.

I looked at the script and I believe there is an infinite loop which is why I cannot complete brewing.

CODE
        while(1) {
            mes "-Something is still being boiled in the pot.";
            mes "What am I going to do?-";
            next;
            switch(select("Put the materials in it.:Pour water in it.:Stir it up.:It is over!")) {
            case 1:
                switch(select("Powder Of Wing Of Bat:Liquid Of Spawn:Grasshopper's Leg:Starsand Of Witch:Fine Grit")) {
                case 1:
                    if (.@bat > 0) {
                        mes "-I put the Powder Of Wing Of Bat in the pot.";
                        mes "Its smell slightly changes.-";
                        specialeffect EF_POISONHIT;
                        set .@nankai,.@nankai+1;
                    }else{
                        mes "-I put the Powder Of Wing Of Bat in the pot.";
                        mes "It's color slightly changes.-";
                        specialeffect EF_SMOKE;
                        set .@bat,.@bat+1;
                        set .@maho,.@maho+1;
                        set .@nankai,.@nankai+1;
                    }
                    next;
                    break;
                case 2:
                    if (.@mush > 0) {
                        mes "-I put the Liquid Of Spawn in the pot.";
                        mes "Its smell slightly changes.-";
                        specialeffect EF_POISONHIT;
                        set .@nankai,.@nankai+1;
                    }else{
                        mes "-I put the Liquid Of Spawn in the pot.";
                        mes "It's color slightly changes.-";
                        specialeffect EF_SMOKE;
                        set .@mush,.@mush+1;
                        set .@maho,.@maho+1;
                        set .@nankai,.@nankai+1;
                    }
                    next;
                    break;
                case 3:
                    if (.@locker > 0) {
                        mes "-I put the Grasshopper's Leg in the pot.";
                        mes "Its smell slightly changes.-";
                        specialeffect EF_POISONHIT;
                        set .@nankai,.@nankai+1;
                    }else{
                        mes "-I put the Grasshopper's Leg in the pot.";
                        mes "It's color slightly changes.-";
                        specialeffect EF_SMOKE;
                        set .@locker,.@locker+1;
                        set .@maho,.@maho+1;
                        set .@nankai,.@nankai+1;
                    }
                    next;
                    break;
                case 4:
                    specialeffect EF_POISONHIT;
                    set .@nankai,.@nankai+1;
                    mes "-I put the Starsand Of Witch in the pot.";
                    mes "Its smell slightly changes.-";
                    next;
                    break;
                case 5:
                    specialeffect EF_POISONHIT;
                    set .@nankai,.@nankai+1;
                    mes "-I put the Fine Grit in the pot.";
                    mes "Its smell slightly changes.-";
                    next;
                    break;
                }
                break;
            case 2:
                specialeffect EF_POISONHIT;
                set .@nankai,.@nankai+1;
                mes "-I pour water in the pot a little.";
                mes "The liquid has become thin.";
                mes "No other remarkable changes";
                mes "have happened.-";
                next;
                break;
            case 3:
                specialeffect EF_POISONHIT;
                set .@nankai,.@nankai+1;
                mes "-I stir it up";
                mes "with a stick several times.";
                mes "No other remarkable changes";
                mes "have happened.-";
                next;
                break;
            case 4:
                specialeffect EF_POISONATTACK;
                mes "["+strcharinfo(0)+"]";
                mes "I will tell Baba Yaga that";
                mes "the work has been done.";
                set mos_nowinter,17;
                close;
            }
        if (.@nankai == 3) {
            }
        }
        specialeffect EF_BUBBLE;
        mes "-The liquid has been changed";
        mes "and is now bubbling.";
        mes "It seems to have shrunk,";
        mes "but not by much.-";
        next;
        mes "-Anyway, the first step is done";
        mes "let's go on the next stage.-";
        next;

As you can see, the loop will never finish. since while(1) is an infinite loop and there is no part of the script which jumps out of the loop without closing the script. break will revert back to menu (still within the loop), while close will close the whole script. How about "while (.@nankai < 3) {blahblah}"? I'm not sure about official servers though.

I believe there are more infinite loops in the #bowl script but its too long to paste here.

Correct me if I'm wrong. I don't know too much about C.

Edit: [codebox ] doesn't work in Bug Tracker for some reason =[

This post has been edited by BrianL: Oct 18 2009, 08:19 PM

Hercules Elf Bot - Mar 11, 2012 22:03

Originally posted by [b]Kenpachi[/b]
Fixed in [rev=15678].