Issue information

Issue ID
#2806
Status
Fixed
Severity
None
Started
Hercules Elf Bot
Feb 26, 2009 21:22
Last Post
Hercules Elf Bot
Feb 26, 2009 21:22
Confirmation
N/A

Hercules Elf Bot - Feb 26, 2009 21:22

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

When a Script contains a goto label that is the same as a buildin command, an error is thrown and the command fails....

Sample Script...
CODE
prontera,150,184,5    script     Healdude#d1-1::Healdude    81,{

mes "...";
Heal:
mes "...";
close;
}


Now an item, a dagger with a GIG card that takes 5 sp when de-equipped... (which calls the buildin heal function) would fail with the following error.

[Error]: run_func: 'heal' (type 8) is not function and command!
[Debug]: Source (NPC): FAKE_NPC (invisible/not on a map)

on this piece of code (The type in this case would be C_NAME)
CODE
if(str_data[func].type!=C_FUNC)
    {    ShowError("run_func: '"CL_WHITE"%s"CL_RESET"' (type %d) is not function and command!\n", str_buf+str_data[func].str, str_data[func].type);
//        st->stack->sp=0;
        st->state=END;
        script_reportsrc(st);
        return 1;
    }


I'm not sure if this is similar to the java feature of overriding commands, but goto labels should not override functions. An load time error check may be appropriate the can point at least to the real script before half your items fail to work because of a script label.

This post has been edited by CuriousKitten: Mar 6 2009, 09:06 AM