summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-05-24 02:05:58 +0200
committerHaru <haru@dotalux.com>2015-05-24 02:08:38 +0200
commitdf24cb3220fcbb8c43d258656de10a92f53018a0 (patch)
treebe2271d8a357a3bcc51431b61b9ccc8d1d710585 /src/map
parentdbaff8bdff2552c94d83e71249ae9e2117f62a72 (diff)
downloadhercules-df24cb3220fcbb8c43d258656de10a92f53018a0.tar.gz
hercules-df24cb3220fcbb8c43d258656de10a92f53018a0.tar.bz2
hercules-df24cb3220fcbb8c43d258656de10a92f53018a0.tar.xz
hercules-df24cb3220fcbb8c43d258656de10a92f53018a0.zip
Corrected distance check on homunculus skills
- Distance check on offensive skills was being done against the homunculus' master instead of the actual target, because of a variable accidentally overwritten in 8faef4ff. - Please don't reuse variables for unrelated things. You don't have to pay extra if you use one more variable, I promise. - Special thanks to MordekaiserGod. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map')
-rw-r--r--src/map/unit.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/map/unit.c b/src/map/unit.c
index b44d58d9a..6a30c7e79 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -1354,18 +1354,21 @@ int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id, ui
}
}
- if (sd || src->type == BL_HOM){
- if (!sd && (target = battle->get_master(src)))
- sd = map->id2sd(target->id);
- if (sd){
- /* temporarily disabled, awaiting for kenpachi to detail this so we can make it work properly */
+ if (src->type == BL_HOM) {
+ // In case of homunuculus, set the sd to the homunculus' master, as needed below
+ struct block_list *master = battle->get_master(src);
+ if (master)
+ sd = map->id2sd(master->id);
+ }
+
+ if (sd) {
+ /* temporarily disabled, awaiting for kenpachi to detail this so we can make it work properly */
#if 0
- if (sd->skillitem != skill_id && !skill->check_condition_castbegin(sd, skill_id, skill_lv))
+ if (sd->skillitem != skill_id && !skill->check_condition_castbegin(sd, skill_id, skill_lv))
#else
- if (!skill->check_condition_castbegin(sd, skill_id, skill_lv))
+ if (!skill->check_condition_castbegin(sd, skill_id, skill_lv))
#endif
- return 0;
- }
+ return 0;
}
if( src->type == BL_MOB )