Merge pull request #12823 from Citadel-Station-13/gravity_update

gravity now immediately updates on entering/exiting areas with different gravity and space meaning no more slow for 4 seconds while in a hardsuit and then fast with jetpack
This commit is contained in:
Lin
2020-07-20 18:21:55 -05:00
committed by GitHub
2 changed files with 19 additions and 5 deletions

View File

@@ -516,7 +516,7 @@ GLOBAL_LIST_EMPTY(teleportlocs)
used_environ += amount
/area/Entered(atom/movable/M)
/area/Entered(atom/movable/M, atom/OldLoc)
set waitfor = FALSE
SEND_SIGNAL(src, COMSIG_AREA_ENTERED, M)
SEND_SIGNAL(M, COMSIG_ENTER_AREA, src) //The atom that enters the area
@@ -524,6 +524,11 @@ GLOBAL_LIST_EMPTY(teleportlocs)
return
var/mob/living/L = M
var/turf/oldTurf = get_turf(OldLoc)
var/area/A = oldTurf?.loc
if(A && (A.has_gravity != has_gravity))
L.update_gravity(L.mob_has_gravity())
if(!L.ckey)
return

View File

@@ -133,10 +133,13 @@
else
to_chat(user, "<span class='warning'>The plating is going to need some support! Place metal rods first.</span>")
/turf/open/space/Entered(atom/movable/A)
..()
if ((!(A) || src != A.loc))
return
/turf/open/space/Entered(atom/movable/A, atom/OldLoc)
. = ..()
var/turf/old = get_turf(OldLoc)
if(!isspaceturf(old) && ismob(A))
var/mob/M = A
M.update_gravity(M.mob_has_gravity())
if(destination_z && destination_x && destination_y && !(A.pulledby || !A.can_be_z_moved))
var/tx = destination_x
@@ -170,6 +173,12 @@
stoplag()//Let a diagonal move finish, if necessary
A.newtonian_move(A.inertia_dir)
/turf/open/space/Exited(atom/movable/AM, atom/OldLoc)
. = ..()
var/turf/old = get_turf(OldLoc)
if(!isspaceturf(old) && ismob(AM))
var/mob/M = AM
M.update_gravity(M.mob_has_gravity())
/turf/open/space/MakeSlippery(wet_setting, min_wet_time, wet_time_to_add, max_wet_time, permanent)
return