mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-23 04:51:32 +01:00
Remove potential edgecases from gravity/slip code (#9194)
The old code relies on lastarea being up to date. This doesn't really make sense, and can lead to edge cases; we should just be checking the turf the mob is on.
This commit is contained in:
@@ -467,12 +467,16 @@
|
||||
//If there's no gravity then there's no up or down so naturally you can't stand on anything.
|
||||
//For the same reason lattices in space don't count - those are things you grip, presumably.
|
||||
/mob/proc/check_solid_ground()
|
||||
if(istype(loc, /turf/space))
|
||||
var/turf/T = get_turf(src)
|
||||
|
||||
if (!T) // nullspace so sure, have gravity.
|
||||
return 1
|
||||
else if (istype(T, /turf/space))
|
||||
return 0
|
||||
|
||||
if(!lastarea)
|
||||
lastarea = get_area(loc)
|
||||
if(!lastarea.has_gravity())
|
||||
var/area/A = T.loc
|
||||
|
||||
if (!A.has_gravity())
|
||||
return 0
|
||||
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user