From c934f78758e20244ef669b764e54659bfcd81b9e Mon Sep 17 00:00:00 2001 From: FlavioJS Date: Fri, 15 Jun 2007 21:26:17 +0000 Subject: * Fixed script command sc_end not supporting the extra argument as stated in script_commands.txt. * Script command getarg supports an extra argument with a default value that is returned if the requested argument doesn't exist. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10773 54d463be-8e91-2dee-dedb-b68131a5f0ec --- doc/script_commands.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/script_commands.txt b/doc/script_commands.txt index 15fad965a..9c9b75fb0 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -1402,7 +1402,7 @@ script. --------------------------------------- -*getarg() +*getarg({,}) This function is used when you use the 'callsub' or 'callfunc' commands. In the call you can specify variables that will make that call different from another @@ -1446,6 +1446,13 @@ You can pass multiple arguments in a function call: getarg(0) would be 5, getarg(1) would be 4 and getarg(2) would be 3. +Getarg has an optional argument since trunk r10773. +If the target argument exists, it is returned. +Otherwise, if is present it is returned instead, +if not the script terminates immediately. + +in the previous example getarg(2,-1) would be 3 and getarg(3,-1) would be -1 + --------------------------------------- *return {}; -- cgit v1.2.3-60-g2f50