resolve_attackby bugfix (#19441)

This commit is contained in:
Cameron Lennox
2026-04-28 01:46:10 -04:00
committed by GitHub
parent 1015c9080a
commit 69808a5b5b
2 changed files with 7 additions and 6 deletions
+4 -3
View File
@@ -137,7 +137,8 @@
if(!currently_restrained && ((!isturf(A) && A == loc) || (sdepth <= MAX_STORAGE_REACH)))
if(W)
var/resolved = W.resolve_attackby(A, src, click_parameters = params)
if(!resolved && A && W)
//If we got a 'SUCCESS' it means resolve_attackby did something. Don't do afterattack in that case.
if((resolved != ITEM_INTERACT_SUCCESS) && A && W)
W.afterattack(A, src, 1, params) // 1 indicates adjacency
else
if(ismob(A)) // No instant mob attacking
@@ -150,7 +151,7 @@
if(!currently_restrained && isbelly(loc) && (loc == A.loc))
if(W)
var/resolved = W.resolve_attackby(A,src)
if(!resolved && A && W)
if((resolved != ITEM_INTERACT_SUCCESS) && A && W)
W.afterattack(A, src, 1, params) // 1: clicking something Adjacent
else
if(ismob(A)) // No instant mob attacking
@@ -176,7 +177,7 @@
if(W && !restrained())
// Return 1 in attackby() to prevent afterattack() effects (when safely moving items for example)
var/resolved = W.resolve_attackby(A,src, click_parameters = params)
if(!resolved && A && W)
if((resolved != ITEM_INTERACT_SUCCESS) && A && W)
W.afterattack(A, src, 1, params) // 1: clicking something Adjacent
else
if(ismob(A)) // No instant mob attacking
+3 -3
View File
@@ -91,7 +91,7 @@
upgrade_to = /obj/item/stack/medical/bruise_pack
/obj/item/stack/medical/crude_pack/attack(mob/living/M, mob/living/user, target_zone, attack_modifier)
if(..())
if(..() == ITEM_INTERACT_FAILURE)
return ITEM_INTERACT_FAILURE
if (ishuman(M))
@@ -160,7 +160,7 @@
upgrade_to = /obj/item/stack/medical/advanced/bruise_pack
/obj/item/stack/medical/bruise_pack/attack(mob/living/M, mob/living/user, target_zone, attack_modifier)
if(..())
if(..() == ITEM_INTERACT_FAILURE)
return ITEM_INTERACT_FAILURE
if (ishuman(M))
@@ -234,7 +234,7 @@
pickup_sound = 'sound/items/pickup/herb.ogg'
/obj/item/stack/medical/ointment/attack(mob/living/M, mob/living/user, target_zone, attack_modifier)
if(..())
if(..() == ITEM_INTERACT_FAILURE)
return ITEM_INTERACT_FAILURE
if (ishuman(M))