summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/atcommand.c4
-rw-r--r--src/map/clif.c4
-rw-r--r--src/map/clif.h2
-rw-r--r--src/map/npc.c14
-rw-r--r--src/map/status.c14
5 files changed, 27 insertions, 11 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index dbb9c1aed..702a7550d 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -8540,14 +8540,14 @@ static AtCommandInfo* get_atcommandinfo_byname(const char* name)
int i;
if( *name == atcommand_symbol ) name++; // for backwards compatibility
ARR_FIND( 0, ARRAYLENGTH(atcommand_info), i, strcmpi(atcommand_info[i].command, name) == 0 );
- return ( i != ARRAYLENGTH(atcommand_info) ) ? &atcommand_info[i] : NULL;
+ return ( i < ARRAYLENGTH(atcommand_info) ) ? &atcommand_info[i] : NULL;
}
static AtCommandInfo* get_atcommandinfo_byfunc(const AtCommandFunc func)
{
int i;
ARR_FIND( 0, ARRAYLENGTH(atcommand_info), i, atcommand_info[i].func == func );
- return ( i != ARRAYLENGTH(atcommand_info) ) ? &atcommand_info[i] : NULL;
+ return ( i < ARRAYLENGTH(atcommand_info) ) ? &atcommand_info[i] : NULL;
}
diff --git a/src/map/clif.c b/src/map/clif.c
index e3cb75054..c815fd7b3 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -6009,7 +6009,7 @@ int clif_mvp_item(struct map_session_data *sd,int nameid)
/*==========================================
* MVPŒoŒ±’lŠ“¾
*------------------------------------------*/
-int clif_mvp_exp(struct map_session_data *sd,unsigned long exp)
+int clif_mvp_exp(struct map_session_data *sd, unsigned int exp)
{
int fd;
@@ -6018,7 +6018,7 @@ int clif_mvp_exp(struct map_session_data *sd,unsigned long exp)
fd=sd->fd;
WFIFOHEAD(fd,packet_len(0x10b));
WFIFOW(fd,0)=0x10b;
- WFIFOL(fd,2)=exp;
+ WFIFOL(fd,2)=cap_value(exp,0,INT_MAX);
WFIFOSET(fd,packet_len(0x10b));
return 0;
}
diff --git a/src/map/clif.h b/src/map/clif.h
index 51dc0c417..d8714554d 100644
--- a/src/map/clif.h
+++ b/src/map/clif.h
@@ -262,7 +262,7 @@ int clif_item_skill(struct map_session_data *sd,int skillid,int skilllv);
int clif_mvp_effect(struct map_session_data *sd);
int clif_mvp_item(struct map_session_data *sd,int nameid);
-int clif_mvp_exp(struct map_session_data *sd,unsigned long exp);
+int clif_mvp_exp(struct map_session_data *sd, unsigned int exp);
void clif_changed_dir(struct block_list *bl, int area);
// vending
diff --git a/src/map/npc.c b/src/map/npc.c
index a62f5679a..fa4f510d6 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -1631,10 +1631,7 @@ static const char* npc_parse_shop(char* w1, char* w2, char* w3, char* w4, const
char *p;
int x, y, dir, m, i;
struct npc_data *nd;
-
- enum npc_subtype type = SHOP;
- if( !strcasecmp(w2,"cashshop") )
- type = CASHSHOP;
+ enum npc_subtype type;
if( strcmp(w1,"-") == 0 )
{// 'floating' shop?
@@ -1642,7 +1639,7 @@ static const char* npc_parse_shop(char* w1, char* w2, char* w3, char* w4, const
m = -1;
}
else
- {
+ {// w1=<map name>,<x>,<y>,<facing>
char mapname[32];
if( sscanf(w1, "%31[^,],%d,%d,%d", mapname, &x, &y, &dir) != 4
|| strchr(w4, ',') == NULL )
@@ -1654,6 +1651,11 @@ static const char* npc_parse_shop(char* w1, char* w2, char* w3, char* w4, const
m = map_mapname2mapid(mapname);
}
+ if( !strcasecmp(w2,"cashshop") )
+ type = CASHSHOP;
+ else
+ type = SHOP;
+
p = strchr(w4,',');
for( i = 0; i < ARRAYLENGTH(items) && p; ++i )
{
@@ -2720,7 +2722,7 @@ void npc_parsesrcfile(const char* filepath)
}
else if( strcmpi(w2,"mapflag") == 0 && count >= 3 )
{
- p = npc_parse_mapflag(w1, w2, w3, w4, p, buffer, filepath);
+ p = npc_parse_mapflag(w1, w2, trim(w3), trim(w4), p, buffer, filepath);
}
else
{
diff --git a/src/map/status.c b/src/map/status.c
index 11198f28f..453c0b40e 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -6060,6 +6060,11 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
sc->opt3 |= 0x10000;
opt_flag = 0;
break;
+// TODO: unknown option (looks like the aura of biolab mobs)
+// case ???:
+// sc->opt3 |= 0x20000;
+// opt_flag = 0;
+// break;
//OPTION
case SC_HIDING:
sc->option |= OPTION_HIDE;
@@ -6637,6 +6642,10 @@ int status_change_end(struct block_list* bl, enum sc_type type, int tid)
sc->opt3 &= ~0x2000;
opt_flag = 0;
break;
+ case SC_BUNSINJYUTSU:
+ sc->opt3 &= ~0x4000;
+ opt_flag = 0;
+ break;
case SC_SPIRIT:
sc->opt3 &= ~0x8000;
opt_flag = 0;
@@ -6645,6 +6654,11 @@ int status_change_end(struct block_list* bl, enum sc_type type, int tid)
sc->opt3 &= ~0x10000;
opt_flag = 0;
break;
+// TODO:
+// case ???:
+// sc->opt3 &= ~0x20000;
+// opt_flag = 0;
+// break;
default:
opt_flag = 0;
}