From c55ae551d73328413c35a37fd470f2dd748252ee Mon Sep 17 00:00:00 2001 From: Arokha Sieyes Date: Sat, 14 May 2016 17:50:12 -0400 Subject: [PATCH] Fixes Loyalty Implants Why would you define a proc on /mob/living/carbon/human for implanting something then ask to be passed your own src? Also why would you try to pass /job/datums as something to implant? Silly. --- code/datums/mind.dm | 2 +- code/game/antagonist/outsider/deathsquad.dm | 2 +- code/game/jobs/job/captain.dm | 2 +- code/game/jobs/job/civilian.dm | 2 +- code/game/jobs/job/security.dm | 2 +- code/modules/mob/living/carbon/human/human.dm | 14 +++++++------- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/code/datums/mind.dm b/code/datums/mind.dm index fb5a2e754c9..824b52a2fe3 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -344,7 +344,7 @@ log_admin("[key_name_admin(usr)] has de-loyalty implanted [current].") if("add") H << "You somehow have become the recepient of a loyalty transplant, and it just activated!" - H.implant_loyalty(H, override = TRUE) + H.implant_loyalty(override = TRUE) log_admin("[key_name_admin(usr)] has loyalty implanted [current].") else else if (href_list["silicon"]) diff --git a/code/game/antagonist/outsider/deathsquad.dm b/code/game/antagonist/outsider/deathsquad.dm index 4cc8afff6ce..3a61152ab2b 100644 --- a/code/game/antagonist/outsider/deathsquad.dm +++ b/code/game/antagonist/outsider/deathsquad.dm @@ -49,7 +49,7 @@ var/datum/antagonist/deathsquad/deathsquad player.equip_to_slot_or_del(new /obj/item/weapon/gun/energy/pulse_rifle(player), slot_r_hand) player.equip_to_slot_or_del(new /obj/item/weapon/rig/ert/assetprotection(player), slot_back) player.equip_to_slot_or_del(new /obj/item/weapon/melee/energy/sword(player), slot_s_store) - player.implant_loyalty(player) + player.implant_loyalty() var/obj/item/weapon/card/id/id = create_id("Asset Protection", player) if(id) diff --git a/code/game/jobs/job/captain.dm b/code/game/jobs/job/captain.dm index d3a9246238e..015441f32f0 100644 --- a/code/game/jobs/job/captain.dm +++ b/code/game/jobs/job/captain.dm @@ -44,7 +44,7 @@ var/datum/announcement/minor/captain_announcement = new(do_newscast = 1) H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/ids(H.back), slot_in_backpack) - H.implant_loyalty(src) + H.implant_loyalty() return 1 diff --git a/code/game/jobs/job/civilian.dm b/code/game/jobs/job/civilian.dm index 64dc22615ee..f4c3ca9e1bc 100644 --- a/code/game/jobs/job/civilian.dm +++ b/code/game/jobs/job/civilian.dm @@ -263,7 +263,7 @@ H.equip_to_slot_or_del(new /obj/item/device/pda/lawyer(H), slot_belt) H.equip_to_slot_or_del(new /obj/item/weapon/storage/briefcase(H), slot_l_hand) - H.implant_loyalty(H) + H.implant_loyalty() return 1 diff --git a/code/game/jobs/job/security.dm b/code/game/jobs/job/security.dm index 31884169f6c..dfb3659e0d6 100644 --- a/code/game/jobs/job/security.dm +++ b/code/game/jobs/job/security.dm @@ -41,7 +41,7 @@ H.equip_to_slot_or_del(new /obj/item/weapon/handcuffs(H), slot_l_store) else H.equip_to_slot_or_del(new /obj/item/weapon/handcuffs(H), slot_in_backpack) - H.implant_loyalty(H) + H.implant_loyalty() return 1 diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 56482186b44..47853089cf0 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -150,21 +150,21 @@ update |= temp.take_damage(b_loss * 0.05, f_loss * 0.05, used_weapon = weapon_message) if(update) UpdateDamageIcon() -/mob/living/carbon/human/proc/implant_loyalty(mob/living/carbon/human/M, override = FALSE) // Won't override by default. +/mob/living/carbon/human/proc/implant_loyalty(override = FALSE) // Won't override by default. if(!config.use_loyalty_implants && !override) return // Nuh-uh. - var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(M) - L.imp_in = M + var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(src) + L.imp_in = src L.implanted = 1 - var/obj/item/organ/external/affected = M.organs_by_name[BP_HEAD] + var/obj/item/organ/external/affected = src.organs_by_name[BP_HEAD] affected.implants += L L.part = affected L.implanted(src) -/mob/living/carbon/human/proc/is_loyalty_implanted(mob/living/carbon/human/M) - for(var/L in M.contents) +/mob/living/carbon/human/proc/is_loyalty_implanted() + for(var/L in src.contents) if(istype(L, /obj/item/weapon/implant/loyalty)) - for(var/obj/item/organ/external/O in M.organs) + for(var/obj/item/organ/external/O in src.organs) if(L in O.implants) return 1 return 0