From 11066cdb33dca4010a20d9da64c6861eddb8b982 Mon Sep 17 00:00:00 2001 From: Geeves Date: Sat, 16 May 2020 18:42:40 +0200 Subject: [PATCH] pAI Flashlight Fix (#8884) --- code/modules/mob/holder.dm | 16 ++++++---------- code/modules/mob/living/silicon/pai/pai.dm | 11 +++++++++++ html/changelogs/geeves-pAI_flashlight_fix.yml | 6 ++++++ 3 files changed, 23 insertions(+), 10 deletions(-) create mode 100644 html/changelogs/geeves-pAI_flashlight_fix.yml diff --git a/code/modules/mob/holder.dm b/code/modules/mob/holder.dm index 462674089dc..f7468a8244f 100644 --- a/code/modules/mob/holder.dm +++ b/code/modules/mob/holder.dm @@ -202,25 +202,16 @@ var/list/holder_mob_icon_cache = list() src.verbs += /mob/living/proc/get_holder_location//This has to be before we move the mob into the holder - spawn(2) var/obj/item/holder/H = new holder_type(loc) - src.forceMove(H) - - H.contained = src - - if (src.stat == DEAD) H.held_death()//We've scooped up an animal that's already dead. use the proper dead icons else H.isalive = 1//We note that the mob is alive when picked up. If it dies later, we can know that its death happened while held, and play its deathmessage for it - - - var/success = 0 if (src == user) success = grabber.put_in_any_hand_if_possible(H, 0,1,1) @@ -238,14 +229,18 @@ var/list/holder_mob_icon_cache = list() to_chat(src, "[grabber] scoops you up.") H.sync(src) - else to_chat(user, "Failed, try again!") //If the scooping up failed something must have gone wrong H.release_mob() + post_scoop() + return success +// Override to add stuff that should happen when scooping +/mob/living/proc/post_scoop() + return /mob/living/proc/get_holder_location() set category = "Abilities" @@ -601,6 +596,7 @@ var/list/holder_mob_icon_cache = list() /obj/item/holder/pai/rabbit icon_state = "rabbit_rest" item_state = "rabbit" + /obj/item/holder/pai/custom var/customsprite = 1 diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index d4ec0c8783d..402004c694d 100644 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -139,6 +139,17 @@ else set_light(0) +/mob/living/silicon/pai/set_light(l_range, l_power, l_color, uv, angle, no_update) + ..() + if(istype(loc, /obj/item/holder/pai)) + var/obj/item/holder/pai/P = loc + P.set_light(l_range, l_power, l_color, uv, angle, no_update) + +/mob/living/silicon/pai/post_scoop() + if(istype(loc, /obj/item/holder/pai)) + var/obj/item/holder/pai/P = loc + P.set_light(light_range, light_power, light_color, uv_intensity, light_wedge) + /mob/living/silicon/pai/Initialize(mapload) var/obj/item/device/paicard/paicard = loc if (!istype(paicard)) diff --git a/html/changelogs/geeves-pAI_flashlight_fix.yml b/html/changelogs/geeves-pAI_flashlight_fix.yml new file mode 100644 index 00000000000..8f46b800064 --- /dev/null +++ b/html/changelogs/geeves-pAI_flashlight_fix.yml @@ -0,0 +1,6 @@ +author: Geeves + +delete-after: True + +changes: + - bugfix: "Held and worn uncollapsed pAI flashlights now work." \ No newline at end of file