Various lighting fixes. (#94)
* Various lighting fixes. * Removes debug things. * I forgot to hit crtl+s
This commit is contained in:
committed by
TalkingCactus
parent
8724be8fca
commit
8b762a5317
@@ -18,12 +18,12 @@
|
||||
dynamic_lighting = new_dynamic_lighting
|
||||
|
||||
if (IS_DYNAMIC_LIGHTING(src))
|
||||
for (var/turf/T in (area_contents()))
|
||||
for (var/turf/T in area_contents(src))
|
||||
if (IS_DYNAMIC_LIGHTING(T))
|
||||
T.lighting_build_overlay()
|
||||
|
||||
else
|
||||
for (var/turf/T in (area_contents()))
|
||||
for (var/turf/T in area_contents(src))
|
||||
if (T.lighting_overlay)
|
||||
T.lighting_clear_overlay()
|
||||
|
||||
|
||||
@@ -97,8 +97,6 @@
|
||||
T.reconsider_lights()
|
||||
|
||||
|
||||
// This code makes the light be queued for update when it is moved.
|
||||
// Entered() should handle it, however Exited() can do it if it is being moved to nullspace (as there would be no Entered() call in that situation).
|
||||
/atom/movable/Moved(atom/OldLoc, Dir) //Implemented here because forceMove() doesn't call Move()
|
||||
. = ..()
|
||||
for (var/datum/light_source/L in src.light_sources) // Cycle through the light sources on this atom and tell them to update.
|
||||
|
||||
@@ -33,20 +33,21 @@
|
||||
update_overlay()
|
||||
|
||||
/atom/movable/lighting_overlay/Destroy(var/force)
|
||||
global.all_lighting_overlays -= src
|
||||
global.lighting_update_overlays -= src
|
||||
global.lighting_update_overlays_old -= src
|
||||
|
||||
var/turf/T = loc
|
||||
if (istype(T))
|
||||
T.lighting_overlay = null
|
||||
T.luminosity = 1
|
||||
|
||||
if (force)
|
||||
global.all_lighting_overlays -= src
|
||||
global.lighting_update_overlays -= src
|
||||
global.lighting_update_overlays_old -= src
|
||||
|
||||
var/turf/T = loc
|
||||
if (istype(T))
|
||||
T.lighting_overlay = null
|
||||
T.luminosity = 1
|
||||
|
||||
..()
|
||||
return QDEL_HINT_PUTINPOOL
|
||||
|
||||
else
|
||||
// Fuck you!
|
||||
return QDEL_HINT_LETMELIVE
|
||||
|
||||
/atom/movable/lighting_overlay/proc/update_overlay()
|
||||
@@ -110,3 +111,7 @@
|
||||
color = LIGHTING_BASE_MATRIX
|
||||
|
||||
..("color")
|
||||
|
||||
// Nope nope nope!
|
||||
/atom/movable/lighting_overlay/onShuttleMove(turf/T1, rotation)
|
||||
return FALSE
|
||||
|
||||
@@ -64,9 +64,11 @@
|
||||
if (source_atom)
|
||||
if (source_atom.light == src)
|
||||
source_atom.light = null
|
||||
source_atom.light_sources -= src
|
||||
|
||||
if (top_atom)
|
||||
if (source_atom.light_sources)
|
||||
source_atom.light_sources -= src
|
||||
|
||||
if (top_atom && top_atom.light_sources)
|
||||
top_atom.light_sources -= src
|
||||
|
||||
// Fuck supporting force.
|
||||
|
||||
@@ -29,7 +29,9 @@
|
||||
if(!has_left_hand())
|
||||
return 0
|
||||
if(!l_hand)
|
||||
W.loc = src //TODO: move to equipped?
|
||||
var/atom/old_loc = W.loc
|
||||
W.loc = src //TODO: move to equipped?
|
||||
W.Moved(old_loc, 0) // MSO told me to do this!
|
||||
l_hand = W
|
||||
W.layer = ABOVE_HUD_LAYER //TODO: move to equipped?
|
||||
W.equipped(src,slot_l_hand)
|
||||
@@ -49,7 +51,9 @@
|
||||
if(!has_right_hand())
|
||||
return 0
|
||||
if(!r_hand)
|
||||
var/atom/old_loc = W.loc
|
||||
W.loc = src
|
||||
W.Moved(old_loc, 0) // MSO told me to do this!
|
||||
r_hand = W
|
||||
W.layer = ABOVE_HUD_LAYER
|
||||
W.equipped(src,slot_r_hand)
|
||||
@@ -95,7 +99,9 @@
|
||||
else if(put_in_inactive_hand(W))
|
||||
return 1
|
||||
else
|
||||
var/atom/old_loc = W.loc
|
||||
W.loc = get_turf(src)
|
||||
W.Moved(old_loc, 0) // MSO told me to do this!
|
||||
W.layer = initial(W.layer)
|
||||
W.dropped(src)
|
||||
return 0
|
||||
@@ -157,6 +163,7 @@
|
||||
if(client)
|
||||
client.screen -= I
|
||||
I.loc = loc
|
||||
I.Moved(src, 0) // MSO told me to do this!
|
||||
I.dropped(src)
|
||||
if(I)
|
||||
I.layer = initial(I.layer)
|
||||
@@ -274,4 +281,4 @@
|
||||
return slot_back
|
||||
|
||||
/mob/proc/getBeltSlot()
|
||||
return slot_belt
|
||||
return slot_belt
|
||||
|
||||
@@ -442,7 +442,9 @@
|
||||
if(!A0)
|
||||
A0 = new area_type(null)
|
||||
for(var/turf/T0 in L0)
|
||||
var/area/old = T0.loc
|
||||
A0.contents += T0
|
||||
T0.change_area(old, A0)
|
||||
|
||||
|
||||
remove_ripples()
|
||||
@@ -459,7 +461,9 @@
|
||||
continue
|
||||
if(T0.type != T0.baseturf) //So if there is a hole in the shuttle we don't drag along the space/asteroid/etc to wherever we are going next
|
||||
T0.copyTurf(T1)
|
||||
var/area/old = T1.loc
|
||||
areaInstance.contents += T1
|
||||
T1.change_area(old, areaInstance)
|
||||
|
||||
//copy over air
|
||||
if(istype(T1, /turf/open))
|
||||
@@ -473,15 +477,12 @@
|
||||
if(rotation)
|
||||
T1.shuttleRotate(rotation)
|
||||
|
||||
//lighting stuff
|
||||
T1.reconsider_lights()
|
||||
SSair.remove_from_active(T1)
|
||||
T1.CalculateAdjacentTurfs()
|
||||
SSair.add_to_active(T1,1)
|
||||
|
||||
T0.ChangeTurf(turf_type)
|
||||
|
||||
T0.reconsider_lights()
|
||||
SSair.remove_from_active(T0)
|
||||
T0.CalculateAdjacentTurfs()
|
||||
SSair.add_to_active(T0,1)
|
||||
|
||||
Reference in New Issue
Block a user