Issue information

Issue ID
#4965
Status
Confirmed
Severity
Medium
Started
Hercules Elf Bot
Jun 14, 2011 7:47
Last Post
Hercules Elf Bot
Jun 14, 2011 7:47
Confirmation
N/A

Hercules Elf Bot - Jun 14, 2011 7:47

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

let's say I want to make an instance script that's re-allow party members to go in back into instance

CODE
prontera,156,177,5    script    kjdhskjdh    100,{
    if ( getcharid(1) == 0 ) end;
    dispbottom has_instance("2@cata");
    if ( instance_id(1) && has_instance("2@cata") != "" ) { // party has instanced attached
        warp "2@cata", 79,55;
        instance_announce instance_id(1), strcharinfo(0) +" has join in", 0;
        end;
    }
    if ( set(.@ins, instance_create( "Poring Fun", getcharid(1) ) ) < 0 ) end;
    if ( instance_attachmap("2@cata", .@ins) == "" ) {
        instance_destroy .@ins;
        end;
    }
    instance_set_timeout 60, 0;
    instance_init .@ins;
    warp "2@cata", 79,55;
    end;
}
2@cata,79,55,0    script    kjsdfksjf    -1,0,0,{ // here's some npc
OnTouch:
    sleep2 1;
    dispbottom strcharinfo(3);
}
Note: the script has been edited

how to reproduce
1. create an instance
2. @reloadscript // some noob admin will use this command
3. go back in

you'll end up go inside 2@cata instead of 0012@cata

this bug only gone after 60 seconds the instance started (instance_set_timeout)

the only way to work around this problem is by using has_instance command
change
CODE
warp "2@cata", 79,55;
into
CODE
warp has_instance("2@cata"), 79,55;


this should be affecting official scripts too
has_instance will search for player

this is rare to happen in a live server though
because its not often anyone use @reloadscript on a live server
but its annoying when we need to test script in a test server found a workaround solution now, thx to Saithis

This post has been edited by ~AnnieRuru~: Jun 20 2011, 05:42 AM