summaryrefslogtreecommitdiff
path: root/src/map/script.h
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-06-30 12:29:54 -0300
committershennetsind <ind@henn.et>2013-06-30 12:29:54 -0300
commit3e54d00ad3e1f6fd56aace6f227c66a5b67eb3ea (patch)
tree19af3dd738e37b5236552e6f97c4a83d5305e2c8 /src/map/script.h
parent7c479ad6027ccbce605ebb49c5e8900037772dd5 (diff)
downloadhercules-3e54d00ad3e1f6fd56aace6f227c66a5b67eb3ea.tar.gz
hercules-3e54d00ad3e1f6fd56aace6f227c66a5b67eb3ea.tar.bz2
hercules-3e54d00ad3e1f6fd56aace6f227c66a5b67eb3ea.tar.xz
hercules-3e54d00ad3e1f6fd56aace6f227c66a5b67eb3ea.zip
Fixed script timer problem
Special Thanks to Igniz for bringing it to my attention, ALSO: over 10% script parsing speed boost!<3. Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/script.h')
-rw-r--r--src/map/script.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/map/script.h b/src/map/script.h
index a77e957c0..902125681 100644
--- a/src/map/script.h
+++ b/src/map/script.h
@@ -191,14 +191,13 @@ int set_var(struct map_session_data *sd, char *name, void *val);
int run_script_timer(int tid, unsigned int tick, int id, intptr_t data);
void run_script_main(struct script_state *st);
-void script_stop_instances(int id);
+void script_stop_instances(struct script_code *code);
struct linkdb_node* script_erase_sleepdb(struct linkdb_node *n);
void script_free_code(struct script_code* code);
void script_free_vars(struct DBMap *storage);
struct script_state* script_alloc_state(struct script_code* rootscript, int pos, int rid, int oid);
void script_free_state(struct script_state* st);
-struct DBMap* script_get_label_db(void);
struct DBMap* script_get_userfunc_db(void);
void script_run_autobonus(const char *autobonus,int id, int pos);
@@ -231,6 +230,10 @@ struct str_data_struct {
int next;
};
+struct script_label_entry {
+ int key,pos;
+};
+
///////////////////////////////////////////////////////////////////////////////
//## TODO possible enhancements: [FlavioJS]
// - 'callfunc' supporting labels in the current npc "::LabelName"
@@ -359,6 +362,10 @@ struct script_interface {
int word_size;
/* */
unsigned short current_item_id;
+ /* */
+ struct script_label_entry *labels;
+ int label_count;
+ int labels_size;
/* */
void (*init) (void);
void (*final) (void);
@@ -378,6 +385,7 @@ struct script_interface {
void (*set_constant) (const char* name, int value, bool isparameter);
void (*set_constant2) (const char *name, int value, bool isparameter);
bool (*get_constant) (const char* name, int* value);
+ void (*label_add)(int key, int pos);
/* */
struct hQueue *(*queue) (int idx);
bool (*queue_add) (int idx, int var);