summaryrefslogtreecommitdiff
path: root/src/map/skill.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-12-28 00:24:24 +0100
committerHaru <haru@dotalux.com>2016-01-06 15:14:50 +0100
commit205558527913c42956bf5bbe2afbceac3dad1935 (patch)
tree137f1f8bf50c8b41c839cfe9d30a7e0fd7158469 /src/map/skill.c
parentf878d5e2156dc88fb73d27473acfe01d72427bbd (diff)
downloadhercules-205558527913c42956bf5bbe2afbceac3dad1935.tar.gz
hercules-205558527913c42956bf5bbe2afbceac3dad1935.tar.bz2
hercules-205558527913c42956bf5bbe2afbceac3dad1935.tar.xz
hercules-205558527913c42956bf5bbe2afbceac3dad1935.zip
Replaced some map->id2sd calls with the proper map->id2XX function
- Also added new map->id2XX convenience functions for the other bl types. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/skill.c')
-rw-r--r--src/map/skill.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index 1656ddeb0..1de4baff6 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -18097,11 +18097,14 @@ int skill_blockpc_start_(struct map_session_data *sd, uint16 skill_id, int tick)
return 0;
}
-int skill_blockhomun_end(int tid, int64 tick, int id, intptr_t data) { // [orn]
- struct homun_data *hd = (struct homun_data *)map->id2bl(id);
+// [orn]
+int skill_blockhomun_end(int tid, int64 tick, int id, intptr_t data)
+{
+ struct homun_data *hd = map->id2hd(id);
if (data <= 0 || data >= MAX_SKILL)
return 0;
- if (hd) hd->blockskill[data] = 0;
+ if (hd != NULL)
+ hd->blockskill[data] = 0;
return 1;
}
@@ -18121,11 +18124,14 @@ int skill_blockhomun_start(struct homun_data *hd, uint16 skill_id, int tick) { /
return timer->add(timer->gettick() + tick, skill->blockhomun_end, hd->bl.id, idx);
}
-int skill_blockmerc_end(int tid, int64 tick, int id, intptr_t data) {// [orn]
- struct mercenary_data *md = (struct mercenary_data *)map->id2bl(id);
- if( data <= 0 || data >= MAX_SKILL )
+// [orn]
+int skill_blockmerc_end(int tid, int64 tick, int id, intptr_t data)
+{
+ struct mercenary_data *md = map->id2mc(id);
+ if (data <= 0 || data >= MAX_SKILL)
return 0;
- if( md ) md->blockskill[data] = 0;
+ if (md != NULL)
+ md->blockskill[data] = 0;
return 1;
}