Issue information

Issue ID
#1099
Status
Fixed
Severity
None
Started
Hercules Elf Bot
Mar 3, 2008 3:28
Last Post
Hercules Elf Bot
Mar 3, 2008 3:28
Confirmation
N/A

Hercules Elf Bot - Mar 3, 2008 3:28

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

Hello, I've discovered some bugs in new waiting rooms. Waiting room can be blocked in some cases. Maybe you can better understand with this example:

Hunter Job Quest:


Player clicks on the Waiting room and this happens:
CODE
OnStartArena:
    killmonsterall "job_hunte";
    warpwaitingpc "job_hunte", 90, 67;
    donpcevent "Manager#hnt::OnEnable";
    donpcevent "Switch#hnt::OnDisable";
    disablewaitingroomevent;


It's fine, nothing wrong. After that, he gets killed by monsters and being warped to save point "job_hunte",176,22;. Timer is ticking and time is running, but player is in room with waiting room npc. Message " xxx minutes remaining" appears, so he enters the waiting room and waits till time runs out. When it actually runs out, this happens:
donpcevent "Manager#hnt::OnReset";
CODE
OnReset:
    stopnpctimer;

OnDisable:
    killmonsterall "job_hunte";
    disablenpc "Manager#hnt";
    end;


Script continues:
donpcevent "Waiting Room#hnt::OnStart";
CODE
OnStart:
    enablewaitingroomevent;
    end;


enablewaitingroomevent checks the trigger and sees that player's inside. So it triggers event:
CODE
OnStartArena:
    killmonsterall "job_hunte";
    warpwaitingpc "job_hunte", 90, 67;
    donpcevent "Manager#hnt::OnEnable";


OnEnable event runs:
CODE
OnEnable:
    enablenpc "Manager#hnt";
    set .MyMobs,6;
    // Target Mosnters
    ...monster spawn...
    initnpctimer;
    ...monter spawn...
    end;


.. then triggered OnStartArena event will do the rest of commands:
CODE
    donpcevent "Switch#hnt::OnDisable";
    disablewaitingroomevent;
    end;


..and goes back to line 1158 where is stopnpctimer;. So from here, timer is stopped and waiting room event is disabled. No message "you have 3 mins to kill 'blabla' monsters.." is shown. When players gets killed again, he may enter to the waiting room, but nothing happens. Waiting room is blocked - event is disabled and timer isn't ticking, so there will be no reset in three minutes.


This was one example, but there's more. Generally, waiting room gets blocked when timer runs out or wrong monster being killed or any other enablewaitingroomevent command being executed WHILE someone is in that waiting room at the moment.

I'm afraid that only simple fix is to remove trigger check from enablewaitingroomevent command (chat.c on line 341), because fixing scripts will be harder and will need a lot of testing.

Regards, guys (IMG:style_emoticons/default/smile.gif)