From a0632afa951a0a81009e4edd23a528eeccca264b Mon Sep 17 00:00:00 2001 From: Fluffy <65877598+FluffyGhoster@users.noreply.github.com> Date: Fri, 25 Oct 2024 19:55:26 +0200 Subject: [PATCH] Fix lazarus injector not working (#20100) Fix lazarus injector not working. Fix corgi attack resolution not returning parent result. Fixes #19861 --- code/modules/mining/mine_items.dm | 58 +++++++++--------- .../living/simple_animal/friendly/corgi.dm | 2 +- .../fluffyghost-fixlazarusinjector.yml | 59 +++++++++++++++++++ 3 files changed, 90 insertions(+), 29 deletions(-) create mode 100644 html/changelogs/fluffyghost-fixlazarusinjector.yml diff --git a/code/modules/mining/mine_items.dm b/code/modules/mining/mine_items.dm index fa96da9b11d..f3d5bf4b95b 100644 --- a/code/modules/mining/mine_items.dm +++ b/code/modules/mining/mine_items.dm @@ -807,36 +807,38 @@ item_state = icon_state update_held_icon() -/obj/item/lazarus_injector/afterattack(atom/target, mob/user, proximity_flag) - if(!loaded) - return - if(isliving(target) && proximity_flag) - if(istype(target, /mob/living/simple_animal)) - var/mob/living/simple_animal/M = target - if(!(M.find_type() & revive_type) || !(M.tameable)) - to_chat(user, SPAN_INFO("\The [src] does not work on this sort of creature.")) - return - if(M.stat == DEAD) - if(emagged) //if emagged, will set anything revived to the user's faction. convert station pets to the traitor side! - M.faction = user.faction - if(malfunctioning) //when EMP'd, will set the mob faction to its initial faction, so any taming will be reverted. - M.faction = initial(M.faction) - M.revive() - M.icon_state = M.icon_living - M.desc = initial(M.desc) - loaded = FALSE - user.visible_message(SPAN_NOTICE("\The [user] revives \the [M] by injecting it with \the [src].")) - feedback_add_details("lazarus_injector", "[M.type]") - playsound(src, 'sound/effects/refill.ogg', 50, TRUE) - update_icon() - return - else - to_chat(user, SPAN_INFO("\The [src] is only effective on the dead.")) - return - else - to_chat(user, SPAN_INFO("\The [src] is only effective on lesser beings.")) +/obj/item/lazarus_injector/attack(mob/living/target_mob, mob/living/user, target_zone) + //If we're not loaded, the target is not a living mob, or we're further from 1 tile away, not our problem + if(!loaded || !isliving(target_mob) || get_dist(target_mob, user) > 1) + return ..() + + if(istype(target_mob, /mob/living/simple_animal)) + var/mob/living/simple_animal/M = target_mob + + if(!(M.find_type() & revive_type) || !(M.tameable)) + to_chat(user, SPAN_INFO("\The [src] does not work on this sort of creature.")) return + if(M.stat == DEAD) + if(emagged) //if emagged, will set anything revived to the user's faction. convert station pets to the traitor side! + M.faction = user.faction + if(malfunctioning) //when EMP'd, will set the mob faction to its initial faction, so any taming will be reverted. + M.faction = initial(M.faction) + M.revive() + M.icon_state = M.icon_living + M.desc = initial(M.desc) + loaded = FALSE + user.visible_message(SPAN_NOTICE("\The [user] revives \the [M] by injecting it with \the [src].")) + feedback_add_details("lazarus_injector", "[M.type]") + playsound(src, 'sound/effects/refill.ogg', 50, TRUE) + update_icon() + + else + to_chat(user, SPAN_INFO("\The [src] is only effective on the dead.")) + + else + to_chat(user, SPAN_INFO("\The [src] is only effective on lesser beings.")) + /obj/item/lazarus_injector/emp_act() . = ..() diff --git a/code/modules/mob/living/simple_animal/friendly/corgi.dm b/code/modules/mob/living/simple_animal/friendly/corgi.dm index 0f902a8b105..09b0a3b69e7 100644 --- a/code/modules/mob/living/simple_animal/friendly/corgi.dm +++ b/code/modules/mob/living/simple_animal/friendly/corgi.dm @@ -85,7 +85,7 @@ INVOKE_ASYNC(src, PROC_REF(do_dance), list(1,2,4,8,4,2,1,2)) else - ..() + return ..() /mob/living/simple_animal/corgi/regenerate_icons() ClearOverlays() diff --git a/html/changelogs/fluffyghost-fixlazarusinjector.yml b/html/changelogs/fluffyghost-fixlazarusinjector.yml new file mode 100644 index 00000000000..8ab52eddea9 --- /dev/null +++ b/html/changelogs/fluffyghost-fixlazarusinjector.yml @@ -0,0 +1,59 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# - (fixes bugs) +# wip +# - (work in progress) +# qol +# - (quality of life) +# soundadd +# - (adds a sound) +# sounddel +# - (removes a sound) +# rscadd +# - (adds a feature) +# rscdel +# - (removes a feature) +# imageadd +# - (adds an image or sprite) +# imagedel +# - (removes an image or sprite) +# spellcheck +# - (fixes spelling or grammar) +# experiment +# - (experimental change) +# balance +# - (balance changes) +# code_imp +# - (misc internal code change) +# refactor +# - (refactors code) +# config +# - (makes a change to the config files) +# admin +# - (makes changes to administrator tools) +# server +# - (miscellaneous changes to server) +################################# + +# Your name. +author: FluffyGhost + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit. +# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog. +changes: + - bugfix: "Fix lazarus injector not working." + - bugfix: "Fix corgi attack resolution not returning parent result."