diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm
index 21ed6993e36..0eaabab2d19 100644
--- a/code/game/area/areas.dm
+++ b/code/game/area/areas.dm
@@ -316,7 +316,7 @@ var/list/mob/living/forced_ambiance_list = new
L.lastarea = get_area(L.loc)
var/area/newarea = get_area(L.loc)
var/area/oldarea = L.lastarea
- if((oldarea.has_gravity == 0) && (newarea.has_gravity == 1) && (L.m_intent == "run")) // Being ready when you change areas gives you a chance to avoid falling all together.
+ if((oldarea.has_gravity() == 0) && (newarea.has_gravity() == 1) && (L.m_intent == "run")) // Being ready when you change areas gives you a chance to avoid falling all together.
thunk(L)
L.update_floating( L.Check_Dense_Object() )
@@ -352,11 +352,11 @@ var/list/mob/living/forced_ambiance_list = new
L << sound(sound, repeat = 0, wait = 0, volume = 25, channel = 1)
L.client.played = world.time
-/area/proc/gravitychange(var/gravitystate = 0, var/area/A)
- A.has_gravity = gravitystate
+/area/proc/gravitychange(var/gravitystate = 0)
+ has_gravity = gravitystate
- for(var/mob/M in A)
- if(has_gravity)
+ for(var/mob/M in src)
+ if(has_gravity())
thunk(M)
M.update_floating( M.Check_Dense_Object() )
@@ -395,13 +395,8 @@ var/list/mob/living/forced_ambiance_list = new
if(!T)
T = get_turf(AT)
var/area/A = get_area(T)
- if(istype(T, /turf/space)) //because space
- return 0
- else if(A && A.has_gravity)
+ if(A && A.has_gravity())
return 1
- else
- if(T && length(SSmachinery.gravity_generators))
- return 1
return 0
//A useful proc for events.
diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm
index 52286d4f485..38e4559d3f0 100644
--- a/code/game/atoms_movable.dm
+++ b/code/game/atoms_movable.dm
@@ -123,7 +123,7 @@
- while(src && target &&((((src.x < target.x && dx == EAST) || (src.x > target.x && dx == WEST)) && dist_travelled < range) || (a && a.has_gravity == 0) || istype(src.loc, /turf/space)) && src.throwing && istype(src.loc, /turf))
+ while(src && target &&((((src.x < target.x && dx == EAST) || (src.x > target.x && dx == WEST)) && dist_travelled < range) || (a && a.has_gravity() == 0) || istype(src.loc, /turf/space)) && src.throwing && istype(src.loc, /turf))
// only stop when we've gone the whole distance (or max throw range) and are on a non-space tile, or hit something, or hit the end of the map, or someone picks it up
if(error < 0)
var/atom/step = get_step(src, dy)
@@ -152,7 +152,7 @@
a = get_area(src.loc)
else
var/error = dist_y/2 - dist_x
- while(src && target &&((((src.y < target.y && dy == NORTH) || (src.y > target.y && dy == SOUTH)) && dist_travelled < range) || (a && a.has_gravity == 0) || istype(src.loc, /turf/space)) && src.throwing && istype(src.loc, /turf))
+ while(src && target &&((((src.y < target.y && dy == NORTH) || (src.y > target.y && dy == SOUTH)) && dist_travelled < range) || (a && a.has_gravity() == 0) || istype(src.loc, /turf/space)) && src.throwing && istype(src.loc, /turf))
// only stop when we've gone the whole distance (or max throw range) and are on a non-space tile, or hit something, or hit the end of the map, or someone picks it up
if(error < 0)
var/atom/step = get_step(src, dx)
diff --git a/code/game/objects/items/weapons/extinguisher.dm b/code/game/objects/items/weapons/extinguisher.dm
index 6e288a58dca..3eaa2d7b349 100644
--- a/code/game/objects/items/weapons/extinguisher.dm
+++ b/code/game/objects/items/weapons/extinguisher.dm
@@ -127,7 +127,7 @@
W.set_color()
W.set_up(my_target)
- if((istype(usr.loc, /turf/space)) || (usr.lastarea.has_gravity == 0))
+ if((istype(usr.loc, /turf/space)) || (usr.lastarea.has_gravity() == 0))
user.inertia_dir = get_dir(target, user)
step(user, user.inertia_dir)
else
diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm
index a741df868a3..8ea21884ad9 100644
--- a/code/game/turfs/turf.dm
+++ b/code/game/turfs/turf.dm
@@ -192,7 +192,7 @@ var/const/enterloopsanity = 100
var/mob/M = A
if(!M.lastarea)
M.lastarea = get_area(M.loc)
- if(M.lastarea.has_gravity == 0)
+ if(M.lastarea.has_gravity() == 0)
inertial_drift(M)
// Footstep SFX logic moved to human_movement.dm - Move().
@@ -394,7 +394,7 @@ var/const/enterloopsanity = 100
/turf/MouseDrop_T(atom/movable/O as mob|obj, mob/user as mob)
var/turf/T = get_turf(user)
var/area/A = T.loc
- if((istype(A) && !(A.has_gravity)) || (istype(T,/turf/space)))
+ if((istype(A) && !(A.has_gravity())) || (istype(T,/turf/space)))
return
if(istype(O, /obj/screen))
return
diff --git a/code/modules/holodeck/HolodeckControl.dm b/code/modules/holodeck/HolodeckControl.dm
index df0cb6e99d0..a1aafdecedf 100644
--- a/code/modules/holodeck/HolodeckControl.dm
+++ b/code/modules/holodeck/HolodeckControl.dm
@@ -237,7 +237,7 @@
loadProgram(current_map.holodeck_programs["turnoff"], 0)
if(!linkedholodeck.has_gravity)
- linkedholodeck.gravitychange(1,linkedholodeck)
+ linkedholodeck.gravitychange(TRUE)
active = 0
use_power = 1
@@ -333,17 +333,17 @@
active = 1
use_power = 1
- if(A.has_gravity)
- A.gravitychange(0,A)
+ if(A.has_gravity())
+ A.gravitychange(FALSE)
else
- A.gravitychange(1,A)
+ A.gravitychange(TRUE)
/obj/machinery/computer/HolodeckControl/proc/emergencyShutdown()
//Turn it back to the regular non-holographic room
loadProgram(current_map.holodeck_programs["turnoff"], 0)
if(!linkedholodeck.has_gravity)
- linkedholodeck.gravitychange(1,linkedholodeck)
+ linkedholodeck.gravitychange(TRUE)
active = 0
use_power = 1
diff --git a/code/modules/mob/animations.dm b/code/modules/mob/animations.dm
index d53b76fcee5..4d94bb361e3 100644
--- a/code/modules/mob/animations.dm
+++ b/code/modules/mob/animations.dm
@@ -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())
diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm
index ae9f559b71f..938537518bd 100644
--- a/code/modules/mob/inventory.dm
+++ b/code/modules/mob/inventory.dm
@@ -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)
diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm
index 12d3d19135f..f6224a3e768 100644
--- a/code/modules/mob/living/living.dm
+++ b/code/modules/mob/living/living.dm
@@ -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
diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm
index 9f0bf34ca1f..bfad408894e 100644
--- a/code/modules/mob/mob_movement.dm
+++ b/code/modules/mob/mob_movement.dm
@@ -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))
diff --git a/code/modules/multiz/movement.dm b/code/modules/multiz/movement.dm
index 443cf546817..0860167bb3e 100644
--- a/code/modules/multiz/movement.dm
+++ b/code/modules/multiz/movement.dm
@@ -62,7 +62,7 @@
// If we want to move up,but the current area has gravity. Invoke CanAvoidGravity()
// to check if this move is possible.
- if(direction == UP && area.has_gravity && !CanAvoidGravity())
+ if(direction == UP && area.has_gravity() && !CanAvoidGravity())
to_chat(src, "Gravity stops you from moving upward.")
return FALSE
@@ -314,7 +314,7 @@
/atom/movable/proc/fall_impact(levels_fallen, stopped_early = FALSE)
// No gravity, stop falling into spess!
var/area/area = get_area(src)
- if (istype(loc, /turf/space) || (area && !area.has_gravity))
+ if (istype(loc, /turf/space) || (area && !area.has_gravity()))
return FALSE
visible_message("\The [src] falls and lands on \the [loc]!", "You hear a thud!")
@@ -325,7 +325,7 @@
/mob/living/fall_impact(levels_fallen, stopped_early = FALSE)
// No gravity, stop falling into spess!
var/area/area = get_area(src)
- if (istype(loc, /turf/space) || (area && !area.has_gravity))
+ if (istype(loc, /turf/space) || (area && !area.has_gravity()))
return FALSE
visible_message("\The [src] falls and lands on \the [loc]!",
@@ -354,7 +354,7 @@
/mob/living/carbon/human/fall_impact(levels_fallen, stopped_early = FALSE)
// No gravity, stop falling into spess!
var/area/area = get_area(src)
- if (istype(loc, /turf/space) || (area && !area.has_gravity))
+ if (istype(loc, /turf/space) || (area && !area.has_gravity()))
return FALSE
var/obj/item/weapon/rig/rig = get_rig()
@@ -503,7 +503,7 @@
/atom/movable/proc/fall_collateral(levels_fallen, stopped_early = FALSE)
// No gravity, stop falling into spess!
var/area/area = get_area(src)
- if (istype(loc, /turf/space) || (area && !area.has_gravity))
+ if (istype(loc, /turf/space) || (area && !area.has_gravity()))
return null
var/list/fall_specs = fall_get_specs(levels_fallen)
diff --git a/code/modules/power/gravitygenerator.dm b/code/modules/power/gravitygenerator.dm
index 6cadc234592..660964566d7 100644
--- a/code/modules/power/gravitygenerator.dm
+++ b/code/modules/power/gravitygenerator.dm
@@ -341,13 +341,13 @@
var/alert = 0
var/area/area = get_area(src)
if(new_state) // If we turned on
- if(gravity_in_level() == 0)
+ if(!area.has_gravity())
alert = 1
gravity_is_on = 1
investigate_log("was brought online and is now producing gravity for this level.", "gravity")
message_admins("The gravity generator was brought online. ([area.name])")
else
- if(gravity_in_level() == 1)
+ if(area.has_gravity())
alert = 1
gravity_is_on = 0
investigate_log("was brought offline and there is now no gravity for this level.", "gravity")
@@ -423,14 +423,6 @@
shake_camera(M, 5, 1)
M.playsound_local(our_turf, 'sound/effects/alert.ogg', 100, 1, 0.5)
-/obj/machinery/gravity_generator/main/proc/gravity_in_level()
- var/turf/T = get_turf(src)
- if(!T)
- return 0
- if(SSmachinery.gravity_generators)
- return length(SSmachinery.gravity_generators)
- return 0
-
/obj/machinery/gravity_generator/main/proc/update_list()
var/turf/T = get_turf(src.loc)
if(T)
@@ -439,18 +431,11 @@
if(on)
for(var/area/A in localareas)
- A.has_gravity = 1
- if(round_start)
- A.gravitychange(A.has_gravity,A,1)
- else
- A.gravitychange(A.has_gravity,A)
- if(round_start == 1)
- round_start = 0
+ A.gravitychange(TRUE)
SSmachinery.gravity_generators += src
else
for(var/area/A in localareas)
- A.has_gravity = 0
- A.gravitychange(A.has_gravity,A)
+ A.gravitychange(FALSE)
SSmachinery.gravity_generators -= src
/obj/machinery/gravity_generator/main/Initialize()
diff --git a/code/modules/projectiles/projectile/energy.dm b/code/modules/projectiles/projectile/energy.dm
index 939cab05cc6..54c48c89557 100644
--- a/code/modules/projectiles/projectile/energy.dm
+++ b/code/modules/projectiles/projectile/energy.dm
@@ -175,9 +175,8 @@
/obj/item/projectile/energy/gravitydisabler/on_impact(atom/target)
. = ..()
var/area/A = get_area(target)
- if(A && A.has_gravity == 1)
- A.has_gravity = 0
- A.gravitychange(A.has_gravity,A)
+ if(A && A.has_gravity())
+ A.gravitychange(FALSE)
addtimer(CALLBACK(src, .proc/turnongravity), 150)
if(istype(target, /obj/machinery/gravity_generator/main))
@@ -185,8 +184,7 @@
T.eshutoff()
/obj/item/projectile/energy/gravitydisabler/proc/turnongravity(var/area/A)
- A.has_gravity = 1
- A.gravitychange(A.has_gravity,A)
+ A.gravitychange(TRUE)
/obj/item/projectile/energy/bee
name = "bees"