Originally posted by [b]~AnnieRuru~[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=4962
CODE
prontera,156,177,5 script kjdhskjdh 100,{
if ( getcharid(1) == 0 ) end;
if ( set(.@ins, instance_create( "Poring Fun", getcharid(1) ) ) < 0 ) end;
if ( instance_attachmap("2@cata", .@ins) == "" ) {
instance_destroy .@ins;
end;
}
warp "2@cata", 79,55;
instance_init .@ins;
// instance_attach .@ins; // without this command, instance variable failed without showing any error
monster has_instance("2@cata"),79,55,"--ja--",1002,3, instance_npcname("test") +"::Onkill";
set 'count, 3;
end;
}
2@cata,79,55,0 script test -1,{
Onkill:
set 'count, 'count -1;
// dispbottom 'count;
if ( 'count ) end;
sleep 1; // this one has been reported
instance_destroy;
end;
}
because most of the instance script commands made 2 search
1. search for attached script
2. if the script has no instance attached, search for player
example like instance_destroy, instance_announce, has_instance, instance_warpall ... etc
but this instance variable is only attached to scripts
and the most irritating is, when it is not set it doesn't show any error
solution 1: at least put some error to show that instance variable isn't set
solution 2: follow other instance commands, make a 2nd search for player
or maybe put both =/
make a 2nd search for player,
if player doesn't belong to any instance, or no player attach, show error
btw, script_commands.txt also missing explanation for instance variable
PS: official instance script always put instance_attach after created an instance, so doesn't affect the officials
==================================================
EDIT
by post#7, I'm being persuaded to drop the search on attached player
so maybe can fix this easily with just showing an error on the console at failing creating an instance var
This post has been edited by ~AnnieRuru~: Jun 18 2011, 09:18 AM