Player Z-tracking, again

This commit is contained in:
vuonojenmustaturska
2017-12-15 01:35:30 +02:00
committed by CitadelStationBot
parent e5671eece5
commit c27c52cf58
13 changed files with 80 additions and 7 deletions
+3
View File
@@ -140,6 +140,9 @@
/atom/movable/lighting_object/blob_act()
return
/atom/movable/lighting_object/onTransitZ()
return
// Override here to prevent things accidentally moving around overlays.
/atom/movable/lighting_object/forceMove(atom/destination, var/no_tp=FALSE, var/harderforce = FALSE)
if(harderforce)
+3
View File
@@ -81,3 +81,6 @@
WD.add_fingerprint(user)
dump_box_contents()
qdel(src)
/obj/structure/ore_box/onTransitZ()
return
@@ -828,7 +828,7 @@
return pick(/area/hallway, /area/crew_quarters/locker)
/mob/living/carbon/human/interactive/proc/target_filter(target)
var/list/filtered_targets = list(/area, /turf, /obj/machinery/door, /atom/movable/light, /obj/structure/cable, /obj/machinery/atmospherics)
var/list/filtered_targets = list(/area, /turf, /obj/machinery/door, /atom/movable/lighting_object, /obj/structure/cable, /obj/machinery/atmospherics)
var/list/L = target
for(var/atom/A in target) // added a bunch of "junk" that clogs up the general find procs
if(is_type_in_list(A,filtered_targets))
+12
View File
@@ -8,6 +8,18 @@
if((movement_type & FLYING) && !floating) //TODO: Better floating
float(on = TRUE)
if (client || registered_z) // This is a temporary error tracker to make sure we've caught everything
var/turf/T = get_turf(src)
if (client && registered_z != T.z)
#ifdef TESTING
message_admins("[src] [ADMIN_FLW(src)] has somehow ended up in Z-level [T.z] despite being registered in Z-level [registered_z]. If you could ask them how that happened and notify coderbus, it would be appreciated.")
#endif
log_game("Z-TRACKING: [src] has somehow ended up in Z-level [T.z] despite being registered in Z-level [registered_z].")
update_z(T.z)
else if (!client && registered_z)
log_game("Z-TRACKING: [src] of type [src.type] has a Z-registration despite not having a client.")
update_z(null)
if (notransform)
return
if(!loc)
+16 -1
View File
@@ -1039,4 +1039,19 @@
if(.)
if(client)
reset_perspective(destination)
update_canmove() //if the mob was asleep inside a container and then got forceMoved out we need to make them fall.
update_canmove() //if the mob was asleep inside a container and then got forceMoved out we need to make them fall.
/mob/living/proc/update_z(new_z) // 1+ to register, null to unregister
if (registered_z != new_z)
if (registered_z)
SSmobs.clients_by_zlevel[registered_z] -= src
if (client)
if (new_z)
SSmobs.clients_by_zlevel[new_z] += src
registered_z = new_z
else
registered_z = null
/mob/living/onTransitZ(old_z,new_z)
..()
update_z(new_z)
+3 -1
View File
@@ -77,4 +77,6 @@
var/last_words //used for database logging
var/list/obj/effect/proc_holder/abilities = list()
var/list/obj/effect/proc_holder/abilities = list()
var/registered_z
+4
View File
@@ -13,6 +13,10 @@
update_damage_hud()
update_health_hud()
if (loc)
var/turf/T = get_turf(src)
update_z(T.z)
//Vents
if(ventcrawler)
to_chat(src, "<span class='notice'>You can ventcrawl! Use alt+click on vents to quickly travel about the station.</span>")
+8
View File
@@ -1,6 +1,14 @@
<<<<<<< HEAD
/mob/living/Logout()
if(ranged_ability && client)
ranged_ability.remove_mousepointer(client)
..()
=======
/mob/living/Logout()
update_z(null)
if(ranged_ability && client)
ranged_ability.remove_mousepointer(client)
..()
>>>>>>> de51ac3... Player Z-tracking, again (#33216)
if(!key && mind) //key and mind have become separated.
mind.active = 0 //This is to stop say, a mind.transfer_to call on a corpse causing a ghost to re-enter its body.
+8 -3
View File
@@ -89,15 +89,23 @@ All ShuttleMove procs go here
return
loc = newT
return TRUE
// Called on atoms after everything has been moved
/atom/movable/proc/afterShuttleMove(turf/oldT, list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir, rotation)
var/turf/newT = get_turf(src)
if (newT.z != oldT.z)
onTransitZ(oldT.z, newT.z)
if(light)
update_light()
if(rotation)
shuttleRotate(rotation)
update_parallax_contents()
return TRUE
@@ -328,9 +336,6 @@ All ShuttleMove procs go here
/atom/movable/lighting_object/onShuttleMove()
return FALSE
/atom/movable/light/onShuttleMove()
return FALSE
/obj/docking_port/stationary/onShuttleMove(turf/newT, turf/oldT, list/movement_force, move_dir, obj/docking_port/stationary/old_dock, obj/docking_port/mobile/moving_dock)
if(!moving_dock.can_move_docking_ports || old_dock == src)
return FALSE