From 5f857bae116433a2a0fd38b8c3539352c5453f7a Mon Sep 17 00:00:00 2001 From: ultramage Date: Sat, 22 Dec 2007 09:00:57 +0000 Subject: Fixed mob AI code iterating over non-mob objects without checking, when monster_ai flag 0x20 is set (caused by r11943) Cleaned up macros that wrap unit_stop_attack() (bugreport:357) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11957 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/atcommand.c | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'src/map/atcommand.c') diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 9cd024a32..816484cdd 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -6033,10 +6033,10 @@ int atcommand_partyoption(const int fd, struct map_session_data* sd, const char* if(!message || !*message || sscanf(message, "%15s %15s", w1, w2) < 2) { - clif_displaymessage(fd, "Command usage: @changeoption "); + clif_displaymessage(fd, "Command usage: @partyoption "); return -1; } - + option = (config_switch(w1)?1:0)|(config_switch(w2)?2:0); //Change item share type. @@ -6390,12 +6390,6 @@ int atcommand_pettalk(const int fd, struct map_session_data* sd, const char* com { char mes[100],temp[100]; struct pet_data *pd; - const char* emo[] = { "/!", "/?", "/ho", "/lv", "/swt", "/ic", "/an", "/ag", "/$", "/...", - "/scissors", "/rock", "/paper", "/korea", "/lv2", "/thx", "/wah", "/sry", "/heh", "/swt2", - "/hmm", "/no1", "/??", "/omg", "/O", "/X", "/hlp", "/go", "/sob", "/gg", - "/kis", "/kis2", "/pif", "/ok", "-?-", "-?-", "/bzz", "/rice", "/awsm", "/meh", - "/shy", "/pat", "/mp", "/slur", "/com", "/yawn", "/grat", "/hp", "/philippines", "/usa", - "/indonesia", "/brazil", "/fsh", "/spin", "/sigh", "/dum", "/crwd", "/desp", "/dice", NULL }; nullpo_retr(-1, sd); @@ -6415,13 +6409,22 @@ int atcommand_pettalk(const int fd, struct map_session_data* sd, const char* com return -1; } - if (message[0] == '/') { + if (message[0] == '/') + {// pet emotion processing + const char* emo[] = { + "/!", "/?", "/ho", "/lv", "/swt", "/ic", "/an", "/ag", "/$", "/...", + "/scissors", "/rock", "/paper", "/korea", "/lv2", "/thx", "/wah", "/sry", "/heh", "/swt2", + "/hmm", "/no1", "/??", "/omg", "/O", "/X", "/hlp", "/go", "/sob", "/gg", + "/kis", "/kis2", "/pif", "/ok", "-?-", "-?-", "/bzz", "/rice", "/awsm", "/meh", + "/shy", "/pat", "/mp", "/slur", "/com", "/yawn", "/grat", "/hp", "/philippines", "/usa", + "/indonesia", "/brazil", "/fsh", "/spin", "/sigh", "/dum", "/crwd", "/desp", "/dice" + }; int i; - for (i = 0; emo[i] != NULL; i++) { - if (!stricmp(message, emo[i])) { - clif_emotion(&pd->bl, i); - return 0; - } + ARR_FIND( 0, ARRAYLENGTH(emo), i, stricmp(message, emo[i]) == 0 ); + if( i < ARRAYLENGTH(emo) ) + { + clif_emotion(&pd->bl, i); + return 0; } } -- cgit v1.2.3-70-g09d2