Refactors gravity checking (#4591)

Removes a lot of duplicated or redundant code from areas when checking gravity.
This commit is contained in:
Ron
2018-04-12 20:31:05 +03:00
committed by Erki
parent 2b4e2a7b75
commit d1c1d84bde
12 changed files with 33 additions and 55 deletions
+1 -1
View File
@@ -90,7 +90,7 @@ note dizziness decrements automatically in the mob's Life() proc.
var/turf/turf = get_turf(src)
if(!istype(turf,/turf/space))
var/area/A = turf.loc
if(istype(A) && A.has_gravity)
if(istype(A) && A.has_gravity())
make_floating(0)
return
else if (Check_Shoegrip())
+1 -1
View File
@@ -327,7 +327,7 @@ var/list/slot_equipment_priority = list( \
if(!src.lastarea)
src.lastarea = get_area(src.loc)
if((istype(src.loc, /turf/space)) || (src.lastarea.has_gravity == 0))
if((istype(src.loc, /turf/space)) || (src.lastarea.has_gravity() == 0))
src.inertia_dir = get_dir(target, src)
step(src, inertia_dir)
+1 -1
View File
@@ -576,7 +576,7 @@ default behaviour is:
if(!istype(M.loc, /turf/space))
var/area/A = get_area(M)
if(A.has_gravity)
if(A.has_gravity())
//this is the gay blood on floor shit -- Added back -- Skie
if (M.lying && (prob(M.getBruteLoss() / 6)))
var/turf/location = M.loc
+2 -2
View File
@@ -436,7 +436,7 @@
if(!lastarea)
lastarea = get_area(loc)
if(!lastarea.has_gravity)
if(!lastarea.has_gravity())
return 0
return 1
@@ -451,7 +451,7 @@
return 1
else
var/area/A = T.loc
if(A.has_gravity || shoegrip)
if(A.has_gravity() || shoegrip)
return 1
for(var/obj/O in orange(1, src))