Fixes virtualhearers sight flags (#11544)

Adds a wrapper proc for changing sight flags

When sight flags are changed, it checks if the sight flags have actually been changed and then if so modifies the virtualhearer's sight flags.
This commit is contained in:
clusterfack
2016-08-23 09:32:16 -05:00
committed by GitHub
parent 72196b19c9
commit e1fc7f692f
24 changed files with 60 additions and 98 deletions

View File

@@ -26,9 +26,7 @@
cameranet.visibility(src)
if(ai.client && ai.client.eye != src) // Set the eye to us and give the AI the sight & visibility flags it needs.
ai.client.eye = src
ai.sight |= SEE_TURFS
ai.sight |= SEE_MOBS
ai.sight |= SEE_OBJS
ai.change_sight(adding = SEE_TURFS|SEE_MOBS|SEE_OBJS)
ai.see_in_dark = 8
ai.see_invisible = SEE_INVISIBLE_LEVEL_TWO
@@ -39,13 +37,13 @@
/mob/camera/aiEye/Move()
return 0
/mob/camera/aiEye/on_see(var/message, var/blind_message, var/drugged_message, var/blind_drugged_message, atom/A) //proc for eye seeing visible messages from atom A, only possible with the high_res camera module
if(!high_res)
return
if(ai && cameranet.checkCameraVis(A)) //check it's actually in view of a camera
ai.show_message( message, 1, blind_message, 2)
//An AI eyeobj mob cant hear unless it updates high_res with a Malf Module
/mob/camera/aiEye/Hear(var/datum/speech/speech, var/rendered_speech="")
if(!high_res)
@@ -159,7 +157,7 @@
if(client && client.eye) // Reset these things so the AI can't view through walls and stuff.
client.eye = src
sight &= ~(SEE_TURFS | SEE_MOBS | SEE_OBJS)
change_sight(removing = SEE_TURFS | SEE_MOBS | SEE_OBJS)
see_in_dark = 0
see_invisible = SEE_INVISIBLE_LIVING