Skip to content

Commit

Permalink
Respect return values of legacy attack in chain negotiation (#27724)
Browse files Browse the repository at this point in the history
  • Loading branch information
warriorstar-orion authored Jan 6, 2025
1 parent 568a509 commit c195c48
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion code/_onclick/item_attack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@

. = __attack_core(target, user)

if(!target.new_attack_chain)
if(!target.new_attack_chain && .)
return target.attacked_by__legacy__attackchain(src, user, /* def_zone */ null)

/obj/item/proc/__after_attack_core(mob/user, atom/target, params, proximity_flag = 1)
Expand Down
7 changes: 7 additions & 0 deletions code/tests/attack_chain/test_attack_chain_cult_dagger.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,10 @@

cultist.click_on(target)
TEST_ASSERT_EQUAL(target.puppet.health, target.puppet.getMaxHealth(), "cultist attacking cultist with dagger caused damage")

// Test some new -> old attack chain shenanigans
target.puppet.mind.remove_antag_datum(/datum/antagonist/cultist)

ADD_TRAIT(cultist.puppet, TRAIT_PACIFISM, "test")
cultist.click_on(target)
TEST_ASSERT_EQUAL(target.puppet.health, target.puppet.getMaxHealth(), "non-cultist attacked by pacifist")

0 comments on commit c195c48

Please sign in to comment.