summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/skill.c9
-rw-r--r--src/map/unit.c7
2 files changed, 9 insertions, 7 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index a78e7820a..678461ae0 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -3098,13 +3098,17 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, int
case CR_ACIDDEMONSTRATION:
case TF_THROWSTONE:
case NPC_SMOKING:
- case NPC_SELFDESTRUCTION:
case HVAN_EXPLOSION: //[orn]
case GS_FLING:
case NJ_ZENYNAGE:
skill_attack(BF_MISC,src,src,bl,skillid,skilllv,tick,flag);
break;
+ case NPC_SELFDESTRUCTION:
+ if (src != bl)
+ skill_attack(BF_MISC,src,src,bl,skillid,skilllv,tick,flag);
+ break;
+
// Celest
case PF_SOULBURN:
if (rand()%100 < (skilllv < 5 ? 30 + skilllv * 10 : 70)) {
@@ -4903,7 +4907,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
int dir = (bl == src)?unit_getdir(src):map_calc_dir(src,bl->x,bl->y); //If cast on self, run forward, else run away.
unit_stop_attack(src);
//Run skillv tiles overriding the can-move check.
- unit_walktoxy(src, bl->x + skilllv * mask[dir][0], bl->y + skilllv * mask[dir][1], 2);
+ if (unit_walktoxy(src, src->x + skilllv * mask[dir][0], src->y + skilllv * mask[dir][1], 2) && md)
+ md->state.skillstate = MSS_WALK; //Otherwise it isn't updated in the ai.
}
break;
diff --git a/src/map/unit.c b/src/map/unit.c
index 9d2356d58..0755ef9c4 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -258,7 +258,7 @@ static int unit_walktoxy_timer(int tid,unsigned int tick,int id,int data)
return 0;
}
-//Easy parameter: &1 -> 1/2 = easy/hard, &2 -> ignore MD_CANMOVE check
+//Easy parameter: &1 -> 1/2 = easy/hard, &2 -> force walking.
int unit_walktoxy( struct block_list *bl, int x, int y, int easy) {
struct unit_data *ud = NULL;
struct status_change *sc = NULL;
@@ -272,12 +272,9 @@ int unit_walktoxy( struct block_list *bl, int x, int y, int easy) {
if( ud == NULL) return 0;
- if(!(easy&2) && !status_get_mode(bl)&MD_CANMOVE)
+ if(!(easy&2) && (!status_get_mode(bl)&MD_CANMOVE || !unit_can_move(bl)))
return 0;
- if (!unit_can_move(bl))
- return 0;
-
ud->state.walk_easy = easy&1;
ud->target = 0;
ud->to_x = x;