From 63a75ab2f267cd8b38eec0d86fa348cf99dcdf2a Mon Sep 17 00:00:00 2001 From: ultramage Date: Sat, 20 Jan 2007 14:33:31 +0000 Subject: * Fixed the server not reacting properly to atcommands/charcommands when using langtype 10/11 (the |XY codepage indicator wasn't being trimmed) * Fixed some joker's code trying to dereference a null pointer in atcommand_param git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9679 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/charcommand.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/map/charcommand.c') diff --git a/src/map/charcommand.c b/src/map/charcommand.c index 6f588090c..2c6942c4e 100644 --- a/src/map/charcommand.c +++ b/src/map/charcommand.c @@ -194,6 +194,9 @@ is_charcommand(const int fd, struct map_session_data* sd, const char* message) { if (!*str) return CharCommand_None; + if(str[0] == '|' && strlen(str) >= 4 && str[3] == charcommand_symbol) + str += 3; // skip 10/11-langtype's codepage indicator, if detected + return is_charcommand_sub(fd,sd,str,pc_isGM(sd)); } @@ -213,10 +216,7 @@ CharCommandType charcommand(struct map_session_data* sd, const int level, const return CharCommand_None; } - if(p[0] == '|') - p += 3; - - if (*p == charcommand_symbol) { // check first char, try to skip |00 (or something else) [Lance] + if (*p == charcommand_symbol) { // check first char char command[101]; int i = 0; memset(info, 0, sizeof(CharCommandInfo)); -- cgit v1.2.3-60-g2f50