summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-12-22 09:00:57 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-12-22 09:00:57 +0000
commit5f857bae116433a2a0fd38b8c3539352c5453f7a (patch)
tree52e60dcc8ba4ee1a7ddd2475eed6b63c977709b4 /src/map/atcommand.c
parentb5bbb9cc74ef82312be3f45b78634e238e4941c8 (diff)
downloadhercules-5f857bae116433a2a0fd38b8c3539352c5453f7a.tar.gz
hercules-5f857bae116433a2a0fd38b8c3539352c5453f7a.tar.bz2
hercules-5f857bae116433a2a0fd38b8c3539352c5453f7a.tar.xz
hercules-5f857bae116433a2a0fd38b8c3539352c5453f7a.zip
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
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c31
1 files changed, 17 insertions, 14 deletions
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 <pickup share: yes/no> <item distribution: yes/no>");
+ clif_displaymessage(fd, "Command usage: @partyoption <pickup share: yes/no> <item distribution: yes/no>");
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;
}
}