summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2020-06-28 01:51:20 +0200
committerGitHub <noreply@github.com>2020-06-28 01:51:20 +0200
commitb80cf84addaa96ba7b374bcc4141e6653c126c59 (patch)
tree33871820f533126ffad8f995af1e0d727286cb78
parentebeabea9f0b586321e36758f6f53a026f0ac7da3 (diff)
parentc2d9356edfcc8985a6eaf36319e9cc770ffc2739 (diff)
downloadhercules-b80cf84addaa96ba7b374bcc4141e6653c126c59.tar.gz
hercules-b80cf84addaa96ba7b374bcc4141e6653c126c59.tar.bz2
hercules-b80cf84addaa96ba7b374bcc4141e6653c126c59.tar.xz
hercules-b80cf84addaa96ba7b374bcc4141e6653c126c59.zip
Merge pull request #2712 from Kenpachi2k13/npc_del_skill_units
Fix condition for deleting skill units when unloading NPC
-rw-r--r--src/map/skill.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index 24fbe7892..78429cc34 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -17766,13 +17766,20 @@ static int skill_get_new_group_id(void)
static struct skill_unit_group *skill_initunitgroup(struct block_list *src, int count, uint16 skill_id, uint16 skill_lv, int unit_id, int limit, int interval)
{
- struct unit_data* ud = unit->bl2ud( src );
struct skill_unit_group* group;
int i;
if(!(skill_id && skill_lv)) return 0;
nullpo_retr(NULL, src);
+
+ struct unit_data *ud;
+
+ if (src->type == BL_NPC)
+ ud = unit->bl2ud2(src);
+ else
+ ud = unit->bl2ud(src);
+
nullpo_retr(NULL, ud);
// find a free spot to store the new unit group