Vision flag tweaks (#2779)

Normalizes some vision flag operations & adds SEE_BLACKNESS to all mobs if the compiler supports it.
Shouldn't break 510 clients even if the server is 511 & using SEE_BLACKNESS.
Should fix some visual glitches with wall-mounted objects being visible when the wall they're on isn't visible.
This commit is contained in:
Lohikar
2017-07-01 10:03:02 -05:00
committed by skull132
parent 077196f0d1
commit 7419971a02
11 changed files with 23 additions and 15 deletions

View File

@@ -361,3 +361,10 @@ Will print: "/mob/living/carbon/human/death" (you can optionally embed it in a s
#define USE_FAIL_INCAPACITATED 5
#define USE_FAIL_NOT_IN_USER 6
#define USE_FAIL_IS_SILICON 7
// 510 doesn't have this flag, so this shim will turn it into a no-op if it doesn't exist.
#ifndef SEE_BLACKNESS
#define SEE_BLACKNESS 0
#endif
#define DEFAULT_SIGHT (SEE_SELF|SEE_BLACKNESS)

View File

@@ -95,9 +95,7 @@
return//Returns if no client
if (stat == 2 || (XRAY in src.mutations))
sight |= SEE_TURFS
sight |= SEE_MOBS
sight |= SEE_OBJS
sight |= (SEE_TURFS|SEE_MOBS|SEE_OBJS)
see_in_dark = 8
see_invisible = SEE_INVISIBLE_LEVEL_TWO
else if (stat != 2 && is_ventcrawling == 0)

View File

@@ -67,7 +67,7 @@
var/radiation_mod = 1 // Radiation modifier
var/flash_mod = 1 // Stun from blindness modifier.
var/fall_mod = 1 // Fall damage modifier, further modified by brute damage modifier
var/vision_flags = SEE_SELF // Same flags as glasses.
var/vision_flags = DEFAULT_SIGHT // Same flags as glasses.
var/list/breakcuffs = list() //used in resist.dm to check if they can break hand/leg cuffs
// Death vars.

View File

@@ -201,7 +201,7 @@
flags = NO_BREATHE | NO_SCAN | NO_BLOOD | NO_PAIN | NO_POISON
spawn_flags = IS_RESTRICTED
appearance_flags = HAS_HAIR_COLOR
vision_flags = SEE_SELF | SEE_MOBS
vision_flags = DEFAULT_SIGHT | SEE_MOBS
blood_color = "#1F181F"
flesh_color = "#575757"

View File

@@ -110,6 +110,6 @@
/datum/species/resomi/get_vision_flags(var/mob/living/carbon/human/H)
if(!(H.sdisabilities & DEAF) && !H.ear_deaf)
return SEE_SELF|SEE_MOBS
return DEFAULT_SIGHT|SEE_MOBS
else
return SEE_SELF
return DEFAULT_SIGHT

View File

@@ -51,7 +51,7 @@
breath_type = null
poison_type = null
vision_flags = SEE_SELF|SEE_MOBS
vision_flags = DEFAULT_SIGHT | SEE_MOBS
has_organ = list(
"heart" = /obj/item/organ/heart,

View File

@@ -10,7 +10,7 @@
handle_nutrition()
if(is_ventcrawling == 0) // Stops sight returning to normal if inside a vent
sight = SEE_SELF
sight = initial(sight)
if (!client)
handle_targets()

View File

@@ -157,11 +157,9 @@
src.blind.screen_loc = ui_entire_screen
if (src.blind.invisibility != 0)
src.blind.invisibility = 0
src.sight = src.sight&~SEE_TURFS
src.sight = src.sight&~SEE_MOBS
src.sight = src.sight&~SEE_OBJS
src.see_in_dark = 0
src.see_invisible = SEE_INVISIBLE_LIVING
sight &= ~(SEE_TURFS | SEE_MOBS | SEE_OBJS)
see_in_dark = 0
see_invisible = SEE_INVISIBLE_LIVING
else
update_dead_sight()

View File

@@ -68,7 +68,7 @@
squeak_soft(0)
if(is_ventcrawling == 0)
sight = SEE_SELF // Returns mouse sight to normal when they leave a vent
sight = initial(sight) // Returns mouse sight to normal when they leave a vent
if (squeals < maxSqueals)
var/diff = world.time - last_squealgain

View File

@@ -3,6 +3,7 @@
layer = 4.0
animate_movement = 2
flags = PROXMOVE
sight = DEFAULT_SIGHT
var/datum/mind/mind
var/stat = 0 //Whether a mob is alive or dead. TODO: Move this to living - Nodrak