diff options
author | FlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-04-28 09:57:29 +0000 |
---|---|---|
committer | FlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-04-28 09:57:29 +0000 |
commit | f2aa0cc3c716b5c8320777cc1049f22e63f626f2 (patch) | |
tree | e02e68957aac150491c7bf37335e84af528023f8 /src/map/script.h | |
parent | f823790981543fbae9f22845558970137f8b0cc1 (diff) | |
download | hercules-f2aa0cc3c716b5c8320777cc1049f22e63f626f2.tar.gz hercules-f2aa0cc3c716b5c8320777cc1049f22e63f626f2.tar.bz2 hercules-f2aa0cc3c716b5c8320777cc1049f22e63f626f2.tar.xz hercules-f2aa0cc3c716b5c8320777cc1049f22e63f626f2.zip |
* Internal changes to the script engine:
- modulus division detects division by 0.
dividing by zero stops the script and gives an error
- underflow/overflow messages differentiated (warnings)
- when a script function doesn't return a value, a C_NOP value is pushed
instead (avoids stack corruption)
- op_add merged with op_2+op_2num/op2_str
- better type checking in the operators, int/string is never assumed.
The script ends when an invalid type is found.
- other minor code cleanups
Changes made in consequence of:
Ref: http://www.eathena.ws/board/index.php?s=&showtopic=149237&view=findpost&p=823195
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10379 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/script.h')
-rw-r--r-- | src/map/script.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/map/script.h b/src/map/script.h index d6542700d..4152999d6 100644 --- a/src/map/script.h +++ b/src/map/script.h @@ -43,12 +43,14 @@ struct script_code { struct linkdb_node* script_vars; }; +struct script_stack { + int sp,sp_max,defsp; + struct script_data *stack_data; + struct linkdb_node **var_function; // 関数依存変数 +}; + struct script_state { - struct script_stack { - int sp,sp_max,defsp; - struct script_data *stack_data; - struct linkdb_node **var_function; // 関数依存変数 - } *stack; + struct script_stack* stack; int start,end; int pos,state; int rid,oid; |