summaryrefslogtreecommitdiff
path: root/src/map/script.h
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2016-01-01 02:42:44 +0100
committerHaru <haru@dotalux.com>2016-06-25 17:29:39 +0200
commita16cfeda0e57207cc655fb94415ee78b0c8520e6 (patch)
tree946634c677175da0e62b88407d3564e7d8a27fe7 /src/map/script.h
parentfd55dac620cf645222538b6cd1b37e0a3df6ad1e (diff)
downloadhercules-a16cfeda0e57207cc655fb94415ee78b0c8520e6.tar.gz
hercules-a16cfeda0e57207cc655fb94415ee78b0c8520e6.tar.bz2
hercules-a16cfeda0e57207cc655fb94415ee78b0c8520e6.tar.xz
hercules-a16cfeda0e57207cc655fb94415ee78b0c8520e6.zip
Replaced script->buf with a VECTOR
- Fixes various signed/unsigned comparisons. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/script.h')
-rw-r--r--src/map/script.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/map/script.h b/src/map/script.h
index 8650cab9c..77d734e52 100644
--- a/src/map/script.h
+++ b/src/map/script.h
@@ -517,16 +517,22 @@ struct script_array {
unsigned int *members;/* member list */
};
+
/**
* A script string buffer, used to hold strings used by the script engine.
*/
VECTOR_STRUCT_DECL(script_string_buf, char);
+struct string_translation_entry {
+ uint8 lang_id;
+ char string[];
+};
+
struct string_translation {
int string_id;
uint8 translations;
- unsigned int len;
- char *buf;
+ int len;
+ uint8 *buf; // Array of struct string_translation_entry
};
/**
@@ -576,8 +582,7 @@ struct script_interface {
/* */
/// temporary buffer for passing around compiled bytecode
/// @see add_scriptb, set_label, parse_script
- unsigned char* buf;
- int pos, size;
+ VECTOR_DECL(unsigned char) buf;
/* */
struct script_syntax_data syntax;
/* */