summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaruna <haru@dotalux.com>2015-11-18 15:06:19 +0100
committerHaruna <haru@dotalux.com>2015-11-18 15:06:19 +0100
commitc7f6a3daec449964459e70c0d76fadbc9fdf1345 (patch)
treecfcaa84fa798dd62a302af23e16324660798109b
parent591be10aac0951e7dad894999f452e904cda468a (diff)
parent1048d8a52187d6f0cfe3c3f98877c9c4c887f8f0 (diff)
downloadhercules-c7f6a3daec449964459e70c0d76fadbc9fdf1345.tar.gz
hercules-c7f6a3daec449964459e70c0d76fadbc9fdf1345.tar.bz2
hercules-c7f6a3daec449964459e70c0d76fadbc9fdf1345.tar.xz
hercules-c7f6a3daec449964459e70c0d76fadbc9fdf1345.zip
Merge pull request #817 from HerculesWS/atcommand_msg
Fix Crash when message is not defined
-rw-r--r--src/map/atcommand.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index ff88f2c63..de71819de 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -77,7 +77,7 @@ struct atcmd_binding_data* get_atcommandbind_byname(const char* name) {
}
const char* atcommand_msgsd(struct map_session_data *sd, int msg_number) {
- Assert_retr("??", msg_number >= 0 && msg_number < MAX_MSG);
+ Assert_retr("??", msg_number >= 0 && msg_number < MAX_MSG && atcommand->msg_table[0][msg_number] != NULL);
if (!sd || sd->lang_id >= atcommand->max_message_table || !atcommand->msg_table[sd->lang_id][msg_number])
return atcommand->msg_table[0][msg_number];
return atcommand->msg_table[sd->lang_id][msg_number];
@@ -85,7 +85,7 @@ const char* atcommand_msgsd(struct map_session_data *sd, int msg_number) {
const char* atcommand_msgfd(int fd, int msg_number) {
struct map_session_data *sd = sockt->session_is_valid(fd) ? sockt->session[fd]->session_data : NULL;
- Assert_retr("??", msg_number >= 0 && msg_number < MAX_MSG);
+ Assert_retr("??", msg_number >= 0 && msg_number < MAX_MSG && atcommand->msg_table[0][msg_number] != NULL);
if (!sd || sd->lang_id >= atcommand->max_message_table || !atcommand->msg_table[sd->lang_id][msg_number])
return atcommand->msg_table[0][msg_number];
return atcommand->msg_table[sd->lang_id][msg_number];