From c1d0fe6f6b3bfbbeceaa532f6763c873294e51f4 Mon Sep 17 00:00:00 2001 From: Arkatos1 <43862960+Arkatos1@users.noreply.github.com> Date: Tue, 7 Jan 2020 12:03:22 +0100 Subject: [PATCH] Headrev HUD fix (#48611) * Automatic TGUI Rebuild [ci skip] * Headrev HUD fix * Revert "Automatic TGUI Rebuild [ci skip]" This reverts commit 5b949eb972214592336399612e10eb812c762960. * Proper order and cleanup * Clean solution * Second bugfix --- .../antagonists/revolution/revolution.dm | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/code/modules/antagonists/revolution/revolution.dm b/code/modules/antagonists/revolution/revolution.dm index acf4c8d1dff..4758e6d0d4e 100644 --- a/code/modules/antagonists/revolution/revolution.dm +++ b/code/modules/antagonists/revolution/revolution.dm @@ -155,6 +155,14 @@ var/give_flash = FALSE var/give_hud = TRUE +/datum/antagonist/rev/head/on_removal() + if(give_hud) + var/mob/living/carbon/C = owner.current + var/obj/item/organ/cyberimp/eyes/hud/security/syndicate/S = C.getorganslot(ORGAN_SLOT_HUD) + if(S) + S.Remove(C) + return ..() + /datum/antagonist/rev/head/antag_listing_name() return ..() + "(Leader)" @@ -227,27 +235,27 @@ . = ..() /datum/antagonist/rev/head/equip_rev() - var/mob/living/carbon/H = owner.current - if(!ishuman(H) && !ismonkey(H)) + var/mob/living/carbon/C = owner.current + if(!ishuman(C) && !ismonkey(C)) return if(give_flash) - var/obj/item/assembly/flash/T = new(H) + var/obj/item/assembly/flash/T = new(C) var/list/slots = list ( "backpack" = ITEM_SLOT_BACKPACK, "left pocket" = ITEM_SLOT_LPOCKET, "right pocket" = ITEM_SLOT_RPOCKET ) - var/where = H.equip_in_one_of_slots(T, slots) + var/where = C.equip_in_one_of_slots(T, slots) if (!where) - to_chat(H, "The Syndicate were unfortunately unable to get you a flash.") + to_chat(C, "The Syndicate were unfortunately unable to get you a flash.") else - to_chat(H, "The flash in your [where] will help you to persuade the crew to join your cause.") + to_chat(C, "The flash in your [where] will help you to persuade the crew to join your cause.") if(give_hud) - var/obj/item/organ/cyberimp/eyes/hud/security/syndicate/S = new(H) - S.Insert(H, special = FALSE, drop_if_replaced = FALSE) - to_chat(H, "Your eyes have been implanted with a cybernetic security HUD which will help you keep track of who is mindshield-implanted, and therefore unable to be recruited.") + var/obj/item/organ/cyberimp/eyes/hud/security/syndicate/S = new() + S.Insert(C) + to_chat(C, "Your eyes have been implanted with a cybernetic security HUD which will help you keep track of who is mindshield-implanted, and therefore unable to be recruited.") /datum/team/revolution name = "Revolution"