Skip to content

blob_act and null sound plays on windows, grilles

Rob Nelson requested to merge pull/14051/sound-window-blob-act-fix into Bleeding-Edge

Created by: gbasood

Wow how did I not notice this last time I looked at this

[10:51:09] Runtime in sound.dm,30: code/game/sound.dm:30:Assertion Failed: !isnull(turf_source)
  proc name: playsound (/proc/playsound)
  src: null
  call stack:
  playsound(null, 'sound/effects/grillehit.ogg', 80, 1, null, null, 1, 0)
  the grille (/obj/structure/grille): healthcheck(1)
  the grille (/obj/structure/grille): blob act()
  the blob (/obj/effect/blob/normal): expand(the plating (347,225,1) (/turf/simulated/floor/plating/airless), 1)
  the blob (/obj/effect/blob/normal): Pulse(30, 4)
  the blob (/obj/effect/blob/normal): Pulse(29, 8)
obj/structure/blob_act(var/destroy = 0)
    ..()
    if(destroy || (prob(50))) // before I changed it the prob check meant that health checks happened AFTER possible and probably qdeltion
        qdel(src)

/obj/structure/window/blob_act()
    ..()
    health -= rand(30, 50)
    healthcheck()

/obj/structure/grille/blob_act()
	..()
	health -= rand(initial(health)*0.8, initial(health)*3) //Grille will always be blasted, but chances of leaving things over
	healthcheck(hitsound = 1)

For both of these, healthcheck() is what qdel's the window as well as playing sounds so the parent call would qdel then it would qdel itself again while playing a sound in nullspace

Merge request reports