Skip to content

Commit

Permalink
bugfix: HUD Updates In Mind Transfer (#3786)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gottfrei authored Oct 29, 2023
1 parent b202cc2 commit cae3792
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
21 changes: 20 additions & 1 deletion code/datums/hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,30 @@ GLOBAL_LIST_INIT(huds, list( \
for(var/datum/mindslaves/serv in (SSticker.mode.vampires | SSticker.mode.goon_vampires | SSticker.mode.traitors))
serv_huds += serv.thrallhud


for(var/datum/atom_hud/hud in (GLOB.all_huds|serv_huds))//|gang_huds))
if(src in hud.hudusers)
hud.add_hud_to(src)

for(var/obj/item/check in contents)
if(istype(check, /obj/item/clothing/glasses/hud))
var/obj/item/clothing/glasses/hud/glasses = check
if(glasses.HUDType && get_slot_by_item(glasses) == slot_glasses)
var/datum/atom_hud/my_hud = GLOB.huds[glasses.HUDType]
my_hud.add_hud_to(src)

if(istype(check, /obj/item/clothing/head))
var/obj/item/clothing/head/helmet = check
if(helmet.HUDType && get_slot_by_item(helmet) == slot_head)
var/datum/atom_hud/my_hud = GLOB.huds[helmet.HUDType]
my_hud.add_hud_to(src)

if(istype(check, /obj/item/organ/internal/cyberimp/eyes/hud))
var/obj/item/organ/internal/cyberimp/eyes/hud/implant = check
if(implant.HUD_type && !implant.is_equipped(TRUE, TRUE))
var/datum/atom_hud/my_hud = GLOB.huds[implant.HUD_type]
my_hud.add_hud_to(src)


/mob/new_player/reload_huds()
return

Expand Down
7 changes: 7 additions & 0 deletions code/datums/mind.dm
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,13 @@
if(active)
new_character.key = key //now transfer the key to link the client to our new body

// essential mob updates
new_character.update_blind_effects()
new_character.update_blurry_effects()
new_character.update_sight()
new_character.hud_used?.reload_fullscreen()
new_character.reload_huds()

SEND_SIGNAL(src, COMSIG_MIND_TRANSER_TO, new_character)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,6 @@ GLOBAL_LIST_INIT(vampire_dissect_organs, list(
user.forceMove(vampire_animal)
user.mind.transfer_to(vampire_animal)
vampire.draw_HUD()
vampire_animal.update_sight()

var/matrix/animation_matrix = new(vampire_animal.transform)
vampire_animal.transform = matrix().Scale(0)
Expand Down

0 comments on commit cae3792

Please sign in to comment.