mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 02:09:41 +00:00
[MIRROR] Up ports the dynamic light system (#10149)
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
fe69ddd909
commit
7e2fd538ac
@@ -225,7 +225,7 @@
|
||||
|
||||
// If we moved, call Moved() on ourselves
|
||||
if(.)
|
||||
Moved(oldloc, direct, FALSE, movetime ? movetime : MOVE_GLIDE_CALC(glide_size, moving_diagonally) ) //CHOMPEDIT - proper diagonal movement
|
||||
Moved(oldloc, direct, FALSE, movetime ? movetime : MOVE_GLIDE_CALC(glide_size, moving_diagonally) )
|
||||
|
||||
// Update timers/cooldown stuff
|
||||
move_speed = world.time - l_move_time
|
||||
|
||||
@@ -49,15 +49,13 @@
|
||||
var/old_outdoors = outdoors
|
||||
var/old_dangerous_objects = dangerous_objects
|
||||
var/old_dynamic_lumcount = dynamic_lumcount
|
||||
var/oldtype = src.type //CHOMPEdit
|
||||
var/old_density = src.density //CHOMPEdit
|
||||
var/was_open = istype(src,/turf/simulated/open) //CHOMPEdit
|
||||
//CHOMPEdit Begin
|
||||
var/oldtype = src.type
|
||||
var/old_density = src.density
|
||||
var/was_open = istype(src,/turf/simulated/open)
|
||||
var/datum/sunlight_handler/old_shandler
|
||||
var/turf/simulated/simself = src
|
||||
if(istype(simself) && simself.shandler)
|
||||
old_shandler = simself.shandler
|
||||
//CHOMPEdit End
|
||||
|
||||
var/turf/Ab = GetAbove(src)
|
||||
if(Ab)
|
||||
@@ -85,7 +83,6 @@
|
||||
if(old_fire)
|
||||
W.fire = old_fire
|
||||
W.RemoveLattice()
|
||||
//CHOMPEdit Begin
|
||||
W.lighting_corners_initialised = old_lighting_corners_initialized
|
||||
var/turf/simulated/W_sim = W
|
||||
if(istype(W_sim) && old_shandler)
|
||||
@@ -94,7 +91,6 @@
|
||||
else if(istype(W_sim) && (SSplanets && SSplanets.z_to_planet.len >= z && SSplanets.z_to_planet[z]) && has_dynamic_lighting())
|
||||
W_sim.shandler = new(src)
|
||||
W_sim.shandler.manualInit()
|
||||
//CHOMPEdit End
|
||||
if(old_fire)
|
||||
old_fire.RemoveFire()
|
||||
|
||||
@@ -137,7 +133,6 @@
|
||||
for(var/turf/space/space_tile in RANGE_TURFS(1, src))
|
||||
space_tile.update_starlight()
|
||||
|
||||
//CHOMPEdit begin
|
||||
var/turf/simulated/sim_self = src
|
||||
if(lighting_object && istype(sim_self) && sim_self.shandler) //sanity check, but this should never be null for either of the switch cases (lighting_object will be null during initializations sometimes)
|
||||
switch(lighting_object.sunlight_only)
|
||||
@@ -161,13 +156,11 @@
|
||||
cur_turf.propogate_sunlight_changes(oldtype, old_density, W, above = TRUE)
|
||||
while(istype(cur_turf,/turf/simulated/open) && HasBelow(cur_turf.z))
|
||||
|
||||
//CHOMPEdit End
|
||||
if(old_shandler) old_shandler.holder_change() //CHOMPEdit
|
||||
if(old_shandler) old_shandler.holder_change()
|
||||
if(preserve_outdoors)
|
||||
outdoors = old_outdoors
|
||||
|
||||
|
||||
//CHOMPEdit begin
|
||||
/turf/proc/propogate_sunlight_changes(oldtype, old_density, new_turf, var/above = FALSE)
|
||||
//SEND_SIGNAL(src, COMSIG_TURF_UPDATE, oldtype, old_density, W)
|
||||
//Sends signals in a cross pattern to all tiles that may have their sunlight var affected including this tile.
|
||||
@@ -196,4 +189,3 @@
|
||||
T.shandler.turf_update(old_density, new_turf, above)
|
||||
steps += 1
|
||||
cur_turf = get_step(cur_turf,dir)
|
||||
//CHOMPEdit end
|
||||
|
||||
Reference in New Issue
Block a user