diff options
author | Dastgir <dastgirpojee@rocketmail.com> | 2015-10-24 09:46:56 +0530 |
---|---|---|
committer | Dastgir <dastgirpojee@rocketmail.com> | 2015-10-26 09:44:49 +0530 |
commit | 1048d8a52187d6f0cfe3c3f98877c9c4c887f8f0 (patch) | |
tree | e837763a5334cd19b0924d1969a280a038cc128b /src/map/atcommand.c | |
parent | 92d9b4919517d3b7121bd1ebaa4fb75fc6761a7c (diff) | |
download | hercules-1048d8a52187d6f0cfe3c3f98877c9c4c887f8f0.tar.gz hercules-1048d8a52187d6f0cfe3c3f98877c9c4c887f8f0.tar.bz2 hercules-1048d8a52187d6f0cfe3c3f98877c9c4c887f8f0.tar.xz hercules-1048d8a52187d6f0cfe3c3f98877c9c4c887f8f0.zip |
Fix Crash when message is not defined
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r-- | src/map/atcommand.c | 4 |
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]; |