Player Z-tracking, again
This commit is contained in:
committed by
CitadelStationBot
parent
e5671eece5
commit
c27c52cf58
@@ -254,6 +254,12 @@
|
||||
loc = destination
|
||||
|
||||
if(!same_loc)
|
||||
var/turf/oldturf = get_turf(oldloc)
|
||||
var/turf/destturf = get_turf(destination)
|
||||
var/old_z = (oldturf ? oldturf.z : null)
|
||||
var/dest_z = (destturf ? destturf.z : null)
|
||||
if (old_z != dest_z)
|
||||
onTransitZ(old_z, dest_z)
|
||||
destination.Entered(src, oldloc)
|
||||
if(destarea && old_area != destarea)
|
||||
destarea.Entered(src, oldloc)
|
||||
@@ -276,6 +282,11 @@
|
||||
old_area.Exited(src, null)
|
||||
loc = null
|
||||
|
||||
/atom/movable/proc/onTransitZ(old_z,new_z)
|
||||
for (var/item in src) // Notify contents of Z-transition. This can be overridden IF we know the items contents do not care.
|
||||
var/atom/movable/AM = item
|
||||
AM.onTransitZ(old_z,new_z)
|
||||
|
||||
//Called whenever an object moves and by mobs when they attempt to move themselves through space
|
||||
//And when an object or action applies a force on src, see newtonian_move() below
|
||||
//Return 0 to have src start/keep drifting in a no-grav area and 1 to stop/not start drifting
|
||||
|
||||
@@ -1190,6 +1190,9 @@ IF YOU MODIFY THE PRODUCTS LIST OF A MACHINE, MAKE SURE TO UPDATE ITS RESUPPLY C
|
||||
refill_canister = /obj/item/vending_refill/games
|
||||
|
||||
|
||||
/obj/machinery/vending/onTransitZ()
|
||||
return
|
||||
|
||||
#undef STANDARD_CHARGE
|
||||
#undef CONTRABAND_CHARGE
|
||||
#undef COIN_CHARGE
|
||||
@@ -130,9 +130,12 @@
|
||||
return
|
||||
|
||||
if(destination_z)
|
||||
var/old_z = A.z
|
||||
A.x = destination_x
|
||||
A.y = destination_y
|
||||
A.z = destination_z
|
||||
if (old_z != destination_z)
|
||||
A.onTransitZ(old_z, destination_z)
|
||||
|
||||
if(isliving(A))
|
||||
var/mob/living/L = A
|
||||
|
||||
Reference in New Issue
Block a user