mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 03:27:05 +01:00
(Hopefully) Fixes the runtime where a hallucination tries to pick from an empty list (#24276)
* This was an RNG PITA to test * Also does energy sword
This commit is contained in:
@@ -344,11 +344,7 @@
|
||||
/obj/effect/hallucination/stunprodding/Initialize(mapload, mob/living/carbon/target)
|
||||
. = ..()
|
||||
|
||||
var/list/turfs = list()
|
||||
for(var/turf/T in range(world.view, target))
|
||||
turfs += T
|
||||
|
||||
var/turf/T = pick(turfs)
|
||||
var/turf/T = pick(RANGE_TURFS(15, target))
|
||||
target.playsound_local(T, 'sound/weapons/egloves.ogg', 25, TRUE)
|
||||
target.playsound_local(T, get_sfx("bodyfall"), 25, TRUE)
|
||||
target.playsound_local(T, "sparks", 50, TRUE)
|
||||
@@ -370,12 +366,8 @@
|
||||
/obj/effect/hallucination/energy_sword/Initialize(mapload, mob/living/carbon/target)
|
||||
. = ..()
|
||||
|
||||
var/list/turfs = list()
|
||||
for(var/turf/T in range(world.view, target))
|
||||
turfs += T
|
||||
|
||||
var/turf/T = pick(turfs)
|
||||
loc = T
|
||||
var/turf/T = pick(RANGE_TURFS(15, target))
|
||||
forceMove(T)
|
||||
target.playsound_local(T, 'sound/weapons/saberon.ogg', 20, TRUE)
|
||||
|
||||
var/scream_sound = pick('sound/goonstation/voice/female_scream.ogg', 'sound/goonstation/voice/male_scream.ogg')
|
||||
@@ -406,12 +398,8 @@
|
||||
/obj/effect/hallucination/gunfire/Initialize(mapload, mob/living/carbon/target)
|
||||
. = ..()
|
||||
|
||||
var/list/turfs = list()
|
||||
for(var/turf/T in range(world.view, target))
|
||||
turfs += T
|
||||
|
||||
var/turf/T = pick(turfs)
|
||||
loc = T
|
||||
var/turf/T = pick(RANGE_TURFS(15, target))
|
||||
forceMove(T)
|
||||
|
||||
var/gun_sound = pick('sound/weapons/gunshots/gunshot_pistol.ogg', 'sound/weapons/gunshots/gunshot_strong.ogg')
|
||||
var/scream_sound = pick('sound/goonstation/voice/female_scream.ogg', 'sound/goonstation/voice/male_scream.ogg')
|
||||
|
||||
@@ -52,9 +52,12 @@ GLOBAL_LIST_INIT(hallucinations, list(
|
||||
/// Lazy list of images created as part of the hallucination. Cleared on destruction.
|
||||
var/list/image/images = null
|
||||
|
||||
/obj/effect/hallucination/Initialize(mapload, mob/living/carbon/target)
|
||||
/obj/effect/hallucination/Initialize(mapload, mob/living/carbon/hallucination_target)
|
||||
. = ..()
|
||||
src.target = target
|
||||
if(QDELETED(hallucination_target))
|
||||
qdel(src)
|
||||
return
|
||||
target = hallucination_target
|
||||
if(hallucination_icon && hallucination_icon_state)
|
||||
var/image/I = image(hallucination_icon, hallucination_override ? src : get_turf(src), hallucination_icon_state)
|
||||
I.override = hallucination_override
|
||||
|
||||
Reference in New Issue
Block a user