summaryrefslogtreecommitdiff
path: root/src/map/atcommand.h
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-07-23 19:26:50 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-07-23 19:26:50 +0000
commit98e833dc83ad9f0642bdbf6b90b239704292f15f (patch)
tree73194653b1a88d67d8608d9caaac7f5119a56c6d /src/map/atcommand.h
parent81bfbbfb9c0f5af32e55f66ccea2d444eb76cabc (diff)
downloadhercules-98e833dc83ad9f0642bdbf6b90b239704292f15f.tar.gz
hercules-98e833dc83ad9f0642bdbf6b90b239704292f15f.tar.bz2
hercules-98e833dc83ad9f0642bdbf6b90b239704292f15f.tar.xz
hercules-98e833dc83ad9f0642bdbf6b90b239704292f15f.zip
Follow up r16471 improved overall feature performance by making the bind list a pointer array, this also allows the system to have a unlimited amount of atcommand bind instances. also fixed a memory leak that'd be caused when npc_do_atcmd_event fails (e.g. when target npc is manually reloaded)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16485 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/atcommand.h')
-rw-r--r--src/map/atcommand.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/map/atcommand.h b/src/map/atcommand.h
index 9bc844664..8affa4c26 100644
--- a/src/map/atcommand.h
+++ b/src/map/atcommand.h
@@ -34,17 +34,18 @@ const char* msg_txt(int msg_number);
int msg_config_read(const char* cfgName);
void do_final_msg(void);
-#define MAX_ATCMD_BINDINGS 100
+extern int atcmd_binding_count;
// @commands (script based)
-typedef struct Atcmd_Binding {
+struct atcmd_binding_data {
char command[50];
char npc_event[50];
int level;
int level2;
-} Atcmd_Binding;
+};
-struct Atcmd_Binding atcmd_binding[MAX_ATCMD_BINDINGS];
-struct Atcmd_Binding* get_atcommandbind_byname(const char* name);
+struct atcmd_binding_data** atcmd_binding;
+
+struct atcmd_binding_data* get_atcommandbind_byname(const char* name);
#endif /* _ATCOMMAND_H_ */