From ef33ba1fca17febfe0fb465d78b55c8157cef9cb Mon Sep 17 00:00:00 2001 From: Aleos Date: Mon, 19 Oct 2020 15:24:47 -0400 Subject: [PATCH] Fixes Stellar Mark causing a map crash (#5438) * Fixes #5429. * Follow up to 6ba869e. * Fixes a potential crash from Stellar Mark. Thanks to @ecdarreola! --- src/map/skill.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/map/skill.cpp b/src/map/skill.cpp index bf3a51283e..57c1b8663d 100755 --- a/src/map/skill.cpp +++ b/src/map/skill.cpp @@ -6266,9 +6266,6 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint return 1; } - // Attack the target and return the damage result for the upcoming check. - int64 fk_damage = skill_attack(BF_WEAPON, src, src, bl, skill_id, skill_lv, tick, flag); - if (sd) { // Tagging the target. int i; @@ -6285,7 +6282,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint // Tag the target only if damage was done. If it deals no damage, it counts as a miss and won't tag. // Note: Not sure if it works like this in official but you can't mark on something you can't // hit, right? For now well just use this logic until we can get a confirm on if it does this or not. [Rytech] - if (tmd->status.hp > 0) { // Add the ID of the tagged target to the player's tag list and start the status on the target. + if (skill_attack(BF_WEAPON, src, src, bl, skill_id, skill_lv, tick, flag) > 0) { // Add the ID of the tagged target to the player's tag list and start the status on the target. sd->stellar_mark[i] = bl->id; // Val4 flags if the status was applied by a player or a monster. @@ -6296,7 +6293,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint sc_start4(src, bl, SC_FLASHKICK, 100, src->id, i, skill_lv, 1, skill_get_time(skill_id, skill_lv)); } } else if (md) { // Monsters can't track with this skill. Just give the status. - if (fk_damage > 0) + if (skill_attack(BF_WEAPON, src, src, bl, skill_id, skill_lv, tick, flag) > 0) sc_start4(src, bl, SC_FLASHKICK, 100, 0, 0, skill_lv, 2, skill_get_time(skill_id, skill_lv)); } }