Let non-damage skills bypass player_invincible_time - #3430
Conversation
Replace the two-skill allowlist with a general NK_NO_DAMAGE check so buffs, debuffs, songs, and dispel apply immediately to newly spawned or teleported targets, matching official behavior, while equip-strip skills stay blocked as before.
|
@MrKeiKun For example, if you log in while there is a monster nearby, the monster will attack you immediately instead of waiting for |
try now @kyeme interestingly, |
unit_data::skill_id reflects the last skill a unit *cast* and is never reset afterwards, so battle_check_target() could misread a mob's stale no-damage skill_id as the current action and let a plain attack bypass a target's invincibility. unit->attack() now flags the call as a normal attack via the new BCT_NORMAL_ATTACK bit so the check no longer trusts leftover skill state for it.
06280d6 to
8e91d52
Compare
|
@MrKeiKun Tested the fix, and it's working correctly now. Thank you. |
Pull Request Prelude
Changes Proposed
battle_check_target()blocked all skill targeting against a player underplayer_invincible_time(post-spawn/teleport grace period), except for a hardcoded two-skill allowlist (PR_SANCTUARY,PR_MAGNIFICAT) added in 2015 as an admittedly incomplete fix for bugreport:8397.On official servers, invincibility only protects against damage and other hostile/offensive effects — non-damage skills such as
SA_DISPELL, songs (BA_POEMBRAGI,DC_SERVICEFORYOU), and other buffs/debuffs should apply immediately regardless of the target's invincible state.This replaces the two-skill allowlist with a general check against
skill->get_nk(skill_id) & NK_NO_DAMAGE, so any non-damage skill bypasses the invincibility gate by default instead of needing to be special-cased individually. Equip-strip skills (RG_STRIPWEAPON/STRIPSHIELD/STRIPARMOR/STRIPHELM,ST_FULLSTRIP,SC_STRIPACCESSARY,GC_WEAPONCRUSH) are kept blocked despite beingNK_NO_DAMAGE, since they're still an offensive debuff. Plain melee attacks (skill_id == 0) are unaffected and remain blocked.Issues addressed: #966
Thanks @kyeme and @Playtester