summaryrefslogtreecommitdiff
path: root/src/map/mob.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/mob.c')
-rw-r--r--src/map/mob.c36
1 files changed, 22 insertions, 14 deletions
diff --git a/src/map/mob.c b/src/map/mob.c
index f19bd292b..ae742b617 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -159,20 +159,28 @@ int mob_parse_dataset(struct spawn_data *data) {
return 0;
//better safe than sorry, current md->npc_event has a size of 50
- if (strlen(data->eventname) >= 50)
+ if ((i=strlen(data->eventname)) >= 50)
return 0;
- if (data->eventname[0] && strlen(data->eventname) <= 2)
- { //Portable monster big/small implementation. [Skotlex]
- i = atoi(data->eventname);
- if (i) {
- if (i&2)
- data->state.size=1;
- else if (i&4)
- data->state.size=2;
- if (i&8)
- data->state.ai=1;
- data->eventname[0] = '\0'; //Clear event as it is not used.
+ if (data->eventname[0])
+ {
+ if(i <= 2)
+ { //Portable monster big/small implementation. [Skotlex]
+ i = atoi(data->eventname);
+ if (i) {
+ if (i&2)
+ data->state.size=1;
+ else if (i&4)
+ data->state.size=2;
+ if (i&8)
+ data->state.ai=1;
+ data->eventname[0] = '\0'; //Clear event as it is not used.
+ }
+ } else {
+ if (data->eventname[i-1] == '"');
+ data->eventname[i-1] = '\0'; //Remove trailing quote.
+ if (data->eventname[0] == '"') //Strip leading quotes
+ memmove(data->eventname, data->eventname+1, i-1);
}
}
if (!data->level)
@@ -2784,7 +2792,7 @@ int mobskill_use(struct mob_data *md, unsigned int tick, int event)
}
md->skillidx = i;
flag = unit_skilluse_pos2(&md->bl, x, y, ms[i].skill_id, ms[i].skill_lv,
- skill_castfix_sc(&md->bl, ms[i].casttime), ms[i].cancel);
+ ms[i].casttime, ms[i].cancel);
if (!flag) md->skillidx = -1; //Skill failed.
return flag;
} else {
@@ -2814,7 +2822,7 @@ int mobskill_use(struct mob_data *md, unsigned int tick, int event)
}
md->skillidx = i;
flag = (bl && unit_skilluse_id2(&md->bl, bl->id, ms[i].skill_id, ms[i].skill_lv,
- skill_castfix_sc(&md->bl,ms[i].casttime), ms[i].cancel));
+ ms[i].casttime, ms[i].cancel));
if (!flag) md->skillidx = -1;
return flag;
} else {