Grav Gen fix, zero-g inertial drift fix (throwing works again) (#21074)

Weird ephemeral behavior. Previous debugging of this never got anywhere
because for some reason, the gravgen var/list localareas would not
populate. Changing method suddenly made zero-g work perfectly: momentum
is back, throwing objects to move in the opposite direction works, etc.

Definitely one for test merge since I'm not sure WHY its working
perfectly again in local tests with this change.
This commit is contained in:
Batrachophreno
2025-07-30 10:16:22 +00:00
committed by GitHub
parent be012e2b93
commit 2840eac672
3 changed files with 65 additions and 7 deletions
+4 -5
View File
@@ -381,9 +381,9 @@
set_state(0)
else
if(charging_state == POWER_UP)
charge_count += 2
charge_count += rand(1,5)
else if(charging_state == POWER_DOWN)
charge_count -= 2
charge_count -= rand(1,5)
if(charge_count % 4 == 0 && prob(75)) // Let them know it is charging/discharging.
playsound(src.loc, 'sound/effects/EMPulse.ogg', 100, 1)
@@ -418,8 +418,7 @@
current_overlay = overlay_state
/obj/machinery/gravity_generator/main/proc/pulse_radiation(var/amount = 20)
for(var/mob/living/L in view(7, src))
L.apply_damage(amount, DAMAGE_RADIATION, damage_flags = DAMAGE_FLAG_DISPERSED)
SSradiation.radiate(src, amount)
// Shake everyone on the z level to let them know that gravity was enagaged/disenagaged.
/obj/machinery/gravity_generator/main/proc/shake_everyone()
@@ -463,7 +462,7 @@
linked.gravity_generator = src
/obj/machinery/gravity_generator/main/proc/updateareas()
for(var/area/A in get_sorted_areas())
for(var/area/A in GLOB.the_station_areas)
if(!(get_area_type(A) == AREA_STATION))
continue
localareas += A