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] 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()