Fixes Stellar Mark causing a map crash (#5438)

* Fixes #5429.
* Follow up to 6ba869e.
* Fixes a potential crash from Stellar Mark.
Thanks to @ecdarreola!
This commit is contained in:
Aleos 2020-10-19 15:24:47 -04:00 committed by GitHub
parent f8dc145cd2
commit ef33ba1fca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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));
}
}