summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/map/npc.c2
-rw-r--r--src/map/skill.c13
2 files changed, 5 insertions, 10 deletions
diff --git a/src/map/npc.c b/src/map/npc.c
index 0924e6c1f..ec6f143d1 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -2984,7 +2984,7 @@ int do_final_npc(void)
if ((bl = map_id2bl(i))){
if (bl->type == BL_NPC)
npc_unload((struct npc_data *)bl);
- else if (bl->type&(BL_MOB|BL_PET))//# why BL_PET? [FlavioJS] //# Because this is invoked after saving/wiping all players, which would include all pets. This bit of code will take care of any pets without a master that are still lingering in the map. [Skotlex]
+ else if (bl->type&(BL_MOB|BL_PET|BL_HOM))
unit_free(bl, 0);
}
}
diff --git a/src/map/skill.c b/src/map/skill.c
index 8f003aa6b..f43b318bd 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -875,8 +875,7 @@ int skillnotok (int skillid, struct map_session_data *sd)
return 0;
break;
case AL_TELEPORT:
- //Flywing/ButterflyWing are checked elsewhere
- if(map[m].flag.noteleport && sd->skillitem != skillid) {
+ if(map[m].flag.noteleport) {
clif_skill_teleportmessage(sd,0);
return 1;
}
@@ -5566,7 +5565,6 @@ int skill_castend_id (int tid, unsigned int tick, int id, int data)
else
target = map_id2bl(ud->skilltarget);
-
// Use a do so that you can break out of it when the skill fails.
do {
if(!target || target->prev==NULL) break;
@@ -5588,6 +5586,7 @@ int skill_castend_id (int tid, unsigned int tick, int id, int data)
ud->skillx = target->x;
ud->skilly = target->y;
}
+ ud->skilltimer=tid;
return skill_castend_pos(tid,tick,id,data);
}
@@ -5693,9 +5692,6 @@ int skill_castend_id (int tid, unsigned int tick, int id, int data)
else
skill_castend_damage_id(src,target,ud->skillid,ud->skilllv,tick,0);
- if (sd && sd->skillitem == ud->skillid) //Clear item skill data.
- sd->skillitem = sd->skillitemlv = 0;
-
sc = status_get_sc(src);
if(sc && sc->count && sc->data[SC_MAGICPOWER].timer != -1 && ud->skillid != HW_MAGICPOWER && ud->skillid != WZ_WATERBALL)
status_change_end(src,SC_MAGICPOWER,-1);
@@ -5857,9 +5853,6 @@ int skill_castend_pos (int tid, unsigned int tick, int id, int data)
unit_set_walkdelay(src, tick, battle_config.default_skill_delay+skill_get_walkdelay(ud->skillid, ud->skilllv), 1);
skill_castend_pos2(src,ud->skillx,ud->skilly,ud->skillid,ud->skilllv,tick,0);
- if (sd && sd->skillitem == ud->skillid) //Clear item skill data.
- sd->skillitem = sd->skillitemlv = 0;
-
if (ud->skilltimer == -1) {
if (md) md->skillidx = -1;
else ud->skillid = 0; //Non mobs can't clear this one as it is used for skill condition 'afterskill'
@@ -7922,6 +7915,8 @@ int skill_check_condition (struct map_session_data *sd, int skill, int lv, int t
else
pc_delitem(sd,i,1,0);
}
+ if (type&1) //Casting finished
+ sd->skillitem = sd->skillitemlv = 0;
return 1;
}
// for the guild skills [celest]