summaryrefslogtreecommitdiff
path: root/src/map/script.h
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2014-02-24 10:21:27 +0100
committerHaru <haru@dotalux.com>2014-03-05 22:35:02 +0100
commitd25cc9b7dbc103cf1454db37159ffffeedaac149 (patch)
tree0e4af566382b946797aa9de21df70b9bdf9d88fa /src/map/script.h
parent78bf8d26567a2054bd9ff5268f9f73cb07d82b98 (diff)
downloadhercules-d25cc9b7dbc103cf1454db37159ffffeedaac149.tar.gz
hercules-d25cc9b7dbc103cf1454db37159ffffeedaac149.tar.bz2
hercules-d25cc9b7dbc103cf1454db37159ffffeedaac149.tar.xz
hercules-d25cc9b7dbc103cf1454db37159ffffeedaac149.zip
Ref redesign, part 2
- Reorganized regs var/array DBMaps into a specific reg_db structure Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/script.h')
-rw-r--r--src/map/script.h30
1 files changed, 18 insertions, 12 deletions
diff --git a/src/map/script.h b/src/map/script.h
index c0160fd49..0121f39d8 100644
--- a/src/map/script.h
+++ b/src/map/script.h
@@ -332,12 +332,20 @@ struct Script_Config {
const char* ontouch2_name;
};
+/**
+ * Generic reg database abstraction to be used with various types of regs/script variables.
+ */
+struct reg_db {
+ struct DBMap *vars;
+ struct DBMap *arrays;
+};
+
struct script_retinfo {
- struct DBMap* var_function;// scope variables
- struct script_code* script;// script code
- int pos;// script location
- int nargs;// argument count
- int defsp;// default stack pointer
+ struct reg_db scope; ///< scope variables
+ struct script_code* script; ///< script code
+ int pos; ///< script location
+ int nargs; ///< argument count
+ int defsp; ///< default stack pointer
};
struct script_data {
@@ -355,17 +363,15 @@ struct script_data {
struct script_code {
int script_size;
unsigned char *script_buf;
- struct DBMap *script_vars;
- struct DBMap *script_arrays_db;
+ struct reg_db local; ///< Local (npc) vars
};
struct script_stack {
- int sp;// number of entries in the stack
- int sp_max;// capacity of the stack
+ int sp; ///< number of entries in the stack
+ int sp_max; ///< capacity of the stack
int defsp;
- struct script_data *stack_data;// stack
- struct DBMap *var_function;// scope variables
- struct DBMap *array_function_db;
+ struct script_data *stack_data; ///< stack
+ struct reg_db scope; ///< scope variables
};
/* [Ind/Hercules] */