From 2c6d8fdc747d1699af513d5fe7336a7f33dc716b Mon Sep 17 00:00:00 2001 From: shennetsind Date: Wed, 27 Nov 2013 10:47:11 -0200 Subject: Plugins can now make use of msg_txt() Signed-off-by: shennetsind --- src/map/atcommand.c | 4 ++-- src/map/atcommand.h | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/map/atcommand.c b/src/map/atcommand.c index b45807cf8..01711f21b 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -72,8 +72,7 @@ struct atcmd_binding_data* get_atcommandbind_byname(const char* name) { //----------------------------------------------------------- // Return the message string of the specified number by [Yor] //----------------------------------------------------------- -const char* msg_txt(int msg_number) -{ +const char* atcommand_msg(int msg_number) { if (msg_number >= 0 && msg_number < MAX_MSG && atcommand->msg_table[msg_number] != NULL && atcommand->msg_table[msg_number][0] != '\0') return atcommand->msg_table[msg_number]; @@ -10235,4 +10234,5 @@ void atcommand_defaults(void) { atcommand->doload = atcommand_doload; atcommand->base_commands = atcommand_basecommands; atcommand->add = atcommand_add; + atcommand->msg = atcommand_msg; } diff --git a/src/map/atcommand.h b/src/map/atcommand.h index d01f00d8e..ab48b2ca6 100644 --- a/src/map/atcommand.h +++ b/src/map/atcommand.h @@ -21,7 +21,7 @@ struct block_list; **/ #define ATCOMMAND_LENGTH 50 #define MAX_MSG 1500 - +#define msg_txt(idx) atcommand->msg(idx) /** * Enumerations **/ @@ -111,13 +111,11 @@ struct atcommand_interface { void (*doload) (void); void (*base_commands) (void); bool (*add) (char *name, AtCommandFunc func, bool replace); + const char* (*msg) (int msg_number); }; struct atcommand_interface *atcommand; -/* will remain outside for a while, we have plans for this little fellow */ -const char* msg_txt(int msg_number); - void atcommand_defaults(void); /* stay here */ -- cgit v1.2.3-60-g2f50