Merge pull request #11501 from Markolie/lighting

Fix X-Ray on death for simple mobs
This commit is contained in:
Fox McCloud
2019-05-09 16:53:49 -04:00
committed by GitHub
6 changed files with 56 additions and 19 deletions
@@ -277,6 +277,7 @@ Des: Removes all infected images from the alien.
grant_death_vision()
return
see_invisible = initial(see_invisible)
sight = SEE_MOBS
if(nightvision)
see_in_dark = 8
+2
View File
@@ -1139,6 +1139,8 @@ so that different stomachs can handle things in different ways VB*/
grant_death_vision()
return
see_invisible = initial(see_invisible)
see_in_dark = initial(see_in_dark)
sight = initial(sight)
lighting_alpha = initial(lighting_alpha)
-10
View File
@@ -1038,13 +1038,3 @@
update_transform()
if("lighting_alpha")
sync_lighting_plane_alpha()
/mob/living/update_sight()
if(!client)
return
if(stat == DEAD)
grant_death_vision()
return
. = ..()
+1 -1
View File
@@ -1303,8 +1303,8 @@ var/list/ai_verbs_default = list(
see_invisible = initial(see_invisible)
see_in_dark = initial(see_in_dark)
lighting_alpha = initial(lighting_alpha)
sight = initial(sight)
lighting_alpha = initial(lighting_alpha)
if(aiRestorePowerRoutine)
sight = sight &~ SEE_TURFS
@@ -609,4 +609,33 @@
..()
if(AIStatus == AI_Z_OFF)
SSidlenpcpool.idle_mobs_by_zlevel[old_z] -= src
toggle_ai(initial(AIStatus))
toggle_ai(initial(AIStatus))
// Simple animals will not be given night vision upon death, as that would result in issues when they are revived.
/mob/living/simple_animal/grant_death_vision()
sight |= SEE_TURFS
sight |= SEE_MOBS
sight |= SEE_OBJS
see_in_dark = 8
see_invisible = SEE_INVISIBLE_OBSERVER
sync_lighting_plane_alpha()
/mob/living/simple_animal/update_sight()
if(!client)
return
if(stat == DEAD)
grant_death_vision()
return
see_invisible = initial(see_invisible)
see_in_dark = initial(see_in_dark)
sight = initial(sight)
if(client.eye != src)
var/atom/A = client.eye
if(A.update_remote_sight(src)) //returns 1 if we override all other sight updates.
return
SEND_SIGNAL(src, COMSIG_MOB_UPDATE_SIGHT)
sync_lighting_plane_alpha()