From 15ca95df972a679163465320c57d993ea7c40820 Mon Sep 17 00:00:00 2001 From: trololiver112 <59520813+trololiver112@users.noreply.github.com> Date: Mon, 15 Jun 2020 16:19:46 +0200 Subject: [PATCH 1/5] Fixes shadowling darksight not toggling nightvision --- code/game/gamemodes/shadowling/shadowling_abilities.dm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/game/gamemodes/shadowling/shadowling_abilities.dm b/code/game/gamemodes/shadowling/shadowling_abilities.dm index 2cafb1bc219..276b03defdf 100644 --- a/code/game/gamemodes/shadowling/shadowling_abilities.dm +++ b/code/game/gamemodes/shadowling/shadowling_abilities.dm @@ -186,9 +186,12 @@ if(!H.vision_type) to_chat(H, "You shift the nerves in your eyes, allowing you to see in the dark.") H.vision_type = new vision_path + H.update_sight() + else to_chat(H, "You return your vision to normal.") H.vision_type = null + H.update_sight() /obj/effect/proc_holder/spell/targeted/shadow_vision/thrall desc = "Thrall Darksight" From 6cdce262e990c3d0b00d02f22e4fd2e661d7a3cc Mon Sep 17 00:00:00 2001 From: trololiver112 <59520813+trololiver112@users.noreply.github.com> Date: Mon, 15 Jun 2020 16:20:52 +0200 Subject: [PATCH 2/5] removed spacing issue BEFORE FARIE COMMENTED IT THIS TIME --- code/game/gamemodes/shadowling/shadowling_abilities.dm | 1 - 1 file changed, 1 deletion(-) diff --git a/code/game/gamemodes/shadowling/shadowling_abilities.dm b/code/game/gamemodes/shadowling/shadowling_abilities.dm index 276b03defdf..98812c8cb53 100644 --- a/code/game/gamemodes/shadowling/shadowling_abilities.dm +++ b/code/game/gamemodes/shadowling/shadowling_abilities.dm @@ -187,7 +187,6 @@ to_chat(H, "You shift the nerves in your eyes, allowing you to see in the dark.") H.vision_type = new vision_path H.update_sight() - else to_chat(H, "You return your vision to normal.") H.vision_type = null From a843221617fb969906d55d50851c70ae6fde0fc2 Mon Sep 17 00:00:00 2001 From: trololiver112 <59520813+trololiver112@users.noreply.github.com> Date: Mon, 15 Jun 2020 19:25:23 +0200 Subject: [PATCH 3/5] Procced --- code/game/gamemodes/shadowling/shadowling_abilities.dm | 7 ++----- code/modules/mob/living/carbon/human/species/shadow.dm | 4 ++-- code/modules/mob/mob.dm | 4 ++++ 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/code/game/gamemodes/shadowling/shadowling_abilities.dm b/code/game/gamemodes/shadowling/shadowling_abilities.dm index 98812c8cb53..e763d3ec6e9 100644 --- a/code/game/gamemodes/shadowling/shadowling_abilities.dm +++ b/code/game/gamemodes/shadowling/shadowling_abilities.dm @@ -175,7 +175,6 @@ range = -1 include_user = 1 clothes_req = 0 - var/datum/vision_override/vision_path = /datum/vision_override/nightvision action_icon_state = "darksight" /obj/effect/proc_holder/spell/targeted/shadow_vision/cast(list/targets, mob/user = usr) @@ -185,12 +184,10 @@ var/mob/living/carbon/human/H = target if(!H.vision_type) to_chat(H, "You shift the nerves in your eyes, allowing you to see in the dark.") - H.vision_type = new vision_path - H.update_sight() + H.set_sight(new /datum/vision_override/nightvision) else to_chat(H, "You return your vision to normal.") - H.vision_type = null - H.update_sight() + H.set_sight() /obj/effect/proc_holder/spell/targeted/shadow_vision/thrall desc = "Thrall Darksight" diff --git a/code/modules/mob/living/carbon/human/species/shadow.dm b/code/modules/mob/living/carbon/human/species/shadow.dm index 63f062b8bc8..2a850f56494 100644 --- a/code/modules/mob/living/carbon/human/species/shadow.dm +++ b/code/modules/mob/living/carbon/human/species/shadow.dm @@ -39,10 +39,10 @@ /datum/action/innate/shadow/darkvision/Activate() var/mob/living/carbon/human/H = owner if(!H.vision_type) - H.vision_type = new /datum/vision_override/nightvision + H.set_sight(new /datum/vision_override/nightvision) to_chat(H, "You adjust your vision to pierce the darkness.") else - H.vision_type = null + H.set_sight() to_chat(H, "You adjust your vision to recognize the shadows.") /datum/species/shadow/on_species_gain(mob/living/carbon/human/H) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 235996e571f..b2d24818d43 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1356,6 +1356,10 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \ SEND_SIGNAL(src, COMSIG_MOB_UPDATE_SIGHT) sync_lighting_plane_alpha() +/mob/proc/set_sight(datum/vision_override/O) + vision_type = O + update_sight() + /mob/proc/sync_lighting_plane_alpha() if(hud_used) var/obj/screen/plane_master/lighting/L = hud_used.plane_masters["[LIGHTING_PLANE]"] From e770103b72879516a0cd16f01163169f7cdbb509 Mon Sep 17 00:00:00 2001 From: trololiver112 <59520813+trololiver112@users.noreply.github.com> Date: Mon, 15 Jun 2020 22:17:22 +0200 Subject: [PATCH 4/5] commented --- code/game/gamemodes/changeling/powers/augmented_eyesight.dm | 4 ++-- code/game/gamemodes/shadowling/shadowling_abilities.dm | 2 +- code/modules/mob/living/carbon/human/species/shadow.dm | 2 +- code/modules/mob/mob.dm | 2 ++ code/modules/surgery/other.dm | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/code/game/gamemodes/changeling/powers/augmented_eyesight.dm b/code/game/gamemodes/changeling/powers/augmented_eyesight.dm index 34a2d67b58b..bd06954a505 100644 --- a/code/game/gamemodes/changeling/powers/augmented_eyesight.dm +++ b/code/game/gamemodes/changeling/powers/augmented_eyesight.dm @@ -76,11 +76,11 @@ var/mob/living/carbon/human/H = owner H.weakeyes = 1 if(!H.vision_type) - H.vision_type = new /datum/vision_override/nightvision + H.set_sight(new /datum/vision_override/nightvision) /obj/item/organ/internal/cyberimp/eyes/thermals/ling/remove(mob/living/carbon/M, special = 0) if(ishuman(owner)) var/mob/living/carbon/human/H = owner H.weakeyes = 0 - H.vision_type = null + H.set_sight(null) ..() diff --git a/code/game/gamemodes/shadowling/shadowling_abilities.dm b/code/game/gamemodes/shadowling/shadowling_abilities.dm index e763d3ec6e9..e210fb61fda 100644 --- a/code/game/gamemodes/shadowling/shadowling_abilities.dm +++ b/code/game/gamemodes/shadowling/shadowling_abilities.dm @@ -187,7 +187,7 @@ H.set_sight(new /datum/vision_override/nightvision) else to_chat(H, "You return your vision to normal.") - H.set_sight() + H.set_sight(null) /obj/effect/proc_holder/spell/targeted/shadow_vision/thrall desc = "Thrall Darksight" diff --git a/code/modules/mob/living/carbon/human/species/shadow.dm b/code/modules/mob/living/carbon/human/species/shadow.dm index 2a850f56494..25d3c853368 100644 --- a/code/modules/mob/living/carbon/human/species/shadow.dm +++ b/code/modules/mob/living/carbon/human/species/shadow.dm @@ -42,7 +42,7 @@ H.set_sight(new /datum/vision_override/nightvision) to_chat(H, "You adjust your vision to pierce the darkness.") else - H.set_sight() + H.set_sight(null) to_chat(H, "You adjust your vision to recognize the shadows.") /datum/species/shadow/on_species_gain(mob/living/carbon/human/H) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index b2d24818d43..370c1fae76e 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1357,6 +1357,8 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \ sync_lighting_plane_alpha() /mob/proc/set_sight(datum/vision_override/O) + if(vision_type) + qdel(vision_type) //qdel the old vision_type unless it is null. vision_type = O update_sight() diff --git a/code/modules/surgery/other.dm b/code/modules/surgery/other.dm index b2bd8e6acd8..59274fb0c19 100644 --- a/code/modules/surgery/other.dm +++ b/code/modules/surgery/other.dm @@ -327,7 +327,7 @@ user.visible_message("[user] shines light onto the tumor in [target]'s [E]!", "You cleanse the contamination from [target]'s brain!") if(target.vision_type) //Turns off their darksight if it's still active. to_chat(target, "Your eyes are suddenly wrought with immense pain as your darksight is forcibly dismissed!") - target.vision_type = null + target.set_sight(null) SSticker.mode.remove_thrall(target.mind, 0) target.visible_message("A strange black mass falls from [target]'s [E]!") var/obj/item/organ/thing = new /obj/item/organ/internal/shadowtumor(get_turf(target)) From e2ae488147c369e4313f29e464fa188613dd8f68 Mon Sep 17 00:00:00 2001 From: trololiver112 <59520813+trololiver112@users.noreply.github.com> Date: Wed, 17 Jun 2020 23:52:20 +0200 Subject: [PATCH 5/5] suggested changes --- code/game/gamemodes/changeling/powers/augmented_eyesight.dm | 2 +- code/game/gamemodes/shadowling/shadowling_abilities.dm | 2 +- code/modules/mob/living/carbon/human/species/shadow.dm | 2 +- code/modules/mob/mob.dm | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/code/game/gamemodes/changeling/powers/augmented_eyesight.dm b/code/game/gamemodes/changeling/powers/augmented_eyesight.dm index bd06954a505..d6062a02c5d 100644 --- a/code/game/gamemodes/changeling/powers/augmented_eyesight.dm +++ b/code/game/gamemodes/changeling/powers/augmented_eyesight.dm @@ -76,7 +76,7 @@ var/mob/living/carbon/human/H = owner H.weakeyes = 1 if(!H.vision_type) - H.set_sight(new /datum/vision_override/nightvision) + H.set_sight(/datum/vision_override/nightvision) /obj/item/organ/internal/cyberimp/eyes/thermals/ling/remove(mob/living/carbon/M, special = 0) if(ishuman(owner)) diff --git a/code/game/gamemodes/shadowling/shadowling_abilities.dm b/code/game/gamemodes/shadowling/shadowling_abilities.dm index e210fb61fda..27267d2ec02 100644 --- a/code/game/gamemodes/shadowling/shadowling_abilities.dm +++ b/code/game/gamemodes/shadowling/shadowling_abilities.dm @@ -184,7 +184,7 @@ var/mob/living/carbon/human/H = target if(!H.vision_type) to_chat(H, "You shift the nerves in your eyes, allowing you to see in the dark.") - H.set_sight(new /datum/vision_override/nightvision) + H.set_sight(/datum/vision_override/nightvision) else to_chat(H, "You return your vision to normal.") H.set_sight(null) diff --git a/code/modules/mob/living/carbon/human/species/shadow.dm b/code/modules/mob/living/carbon/human/species/shadow.dm index 25d3c853368..be2a7f44229 100644 --- a/code/modules/mob/living/carbon/human/species/shadow.dm +++ b/code/modules/mob/living/carbon/human/species/shadow.dm @@ -39,7 +39,7 @@ /datum/action/innate/shadow/darkvision/Activate() var/mob/living/carbon/human/H = owner if(!H.vision_type) - H.set_sight(new /datum/vision_override/nightvision) + H.set_sight(/datum/vision_override/nightvision) to_chat(H, "You adjust your vision to pierce the darkness.") else H.set_sight(null) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 370c1fae76e..90d574ba764 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1357,9 +1357,9 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \ sync_lighting_plane_alpha() /mob/proc/set_sight(datum/vision_override/O) - if(vision_type) - qdel(vision_type) //qdel the old vision_type unless it is null. - vision_type = O + QDEL_NULL(vision_type) + if(O) //in case of null + vision_type = new O update_sight() /mob/proc/sync_lighting_plane_alpha()