mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 02:16:05 +00:00
From say code import, we get to learn one proc.
This commit is contained in:
@@ -130,19 +130,39 @@
|
|||||||
|
|
||||||
//This is the new version of recursive_mob_check, used for say().
|
//This is the new version of recursive_mob_check, used for say().
|
||||||
//The other proc was left intact because morgue trays use it.
|
//The other proc was left intact because morgue trays use it.
|
||||||
/proc/recursive_hear_check(var/atom/O)
|
/proc/recursive_hear_check(atom/O)
|
||||||
var/list/processing_list = list(O)
|
var/list/processing_list = list(O)
|
||||||
var/list/processed_list = list()
|
var/list/processed_list = list()
|
||||||
var/list/found_atoms = list()
|
var/list/found_atoms = list()
|
||||||
|
|
||||||
while(processing_list.len)
|
while (processing_list.len)
|
||||||
var/atom/A = processing_list[1]
|
var/atom/A = processing_list[1]
|
||||||
|
|
||||||
if(A.flags & HEAR)
|
if (A.flags & HEAR)
|
||||||
found_atoms |= A
|
found_atoms |= A
|
||||||
|
|
||||||
for(var/atom/B in A)
|
for (var/atom/B in A)
|
||||||
if(!processed_list[B])
|
if (!processed_list[B])
|
||||||
|
processing_list |= B
|
||||||
|
|
||||||
|
processing_list.Cut(1, 2)
|
||||||
|
processed_list[A] = A
|
||||||
|
|
||||||
|
return found_atoms
|
||||||
|
|
||||||
|
/proc/recursive_type_check(atom/O, type = /atom)
|
||||||
|
var/list/processing_list = list(O)
|
||||||
|
var/list/processed_list = new/list()
|
||||||
|
var/list/found_atoms = new/list()
|
||||||
|
|
||||||
|
while (processing_list.len)
|
||||||
|
var/atom/A = processing_list[1]
|
||||||
|
|
||||||
|
if (istype(A, type))
|
||||||
|
found_atoms |= A
|
||||||
|
|
||||||
|
for (var/atom/B in A)
|
||||||
|
if (!processed_list[B])
|
||||||
processing_list |= B
|
processing_list |= B
|
||||||
|
|
||||||
processing_list.Cut(1, 2)
|
processing_list.Cut(1, 2)
|
||||||
|
|||||||
@@ -328,9 +328,16 @@ var/bomb_set
|
|||||||
return
|
return
|
||||||
return
|
return
|
||||||
|
|
||||||
/obj/item/weapon/disk/nuclear/Destroy()
|
/obj/item/weapon/disk/nuclear/Del()
|
||||||
if(blobstart.len > 0)
|
if(blobstart.len > 0)
|
||||||
var/obj/D = new /obj/item/weapon/disk/nuclear(pick(blobstart))
|
var/picked_location = pick(blobstart)
|
||||||
message_admins("[src] has been destroyed. Spawning [D] at ([D.x], [D.y], [D.z]).")
|
|
||||||
log_game("[src] has been destroyed. Spawning [D] at ([D.x], [D.y], [D.z]).")
|
var/log_message = "[type] has been destroyed. Creating one at [formatJumpTo(picked_location)]"
|
||||||
|
|
||||||
|
message_admins(log_message)
|
||||||
|
|
||||||
|
log_game(log_message)
|
||||||
|
|
||||||
|
new /obj/item/weapon/disk/nuclear(picked_location)
|
||||||
|
|
||||||
..()
|
..()
|
||||||
|
|||||||
@@ -310,9 +310,9 @@
|
|||||||
return
|
return
|
||||||
|
|
||||||
else
|
else
|
||||||
var/inside = src.search_contents_for(/atom)
|
var/inside = recursive_type_check(src, /atom/movable) - src
|
||||||
if(is_type_in_list(/obj/item/weapon/disk/nuclear, inside))
|
|
||||||
usr << "You get the feeling that you shouldn't cremate one of the items in the cremator."
|
if (locate(/obj/item/weapon/disk/nuclear) in inside)
|
||||||
return
|
return
|
||||||
|
|
||||||
for (var/mob/M in viewers(src))
|
for (var/mob/M in viewers(src))
|
||||||
@@ -321,7 +321,7 @@
|
|||||||
cremating = 1
|
cremating = 1
|
||||||
locked = 1
|
locked = 1
|
||||||
|
|
||||||
for(var/mob/living/M in inside)
|
for (var/mob/living/M in inside)
|
||||||
if (M.stat!=2)
|
if (M.stat!=2)
|
||||||
M.emote("scream",,, 1)
|
M.emote("scream",,, 1)
|
||||||
//Logging for this causes runtimes resulting in the cremator locking up. Commenting it out until that's figured out.
|
//Logging for this causes runtimes resulting in the cremator locking up. Commenting it out until that's figured out.
|
||||||
@@ -332,8 +332,10 @@
|
|||||||
M.ghostize()
|
M.ghostize()
|
||||||
del(M)
|
del(M)
|
||||||
|
|
||||||
for(var/obj/O in inside) //obj instead of obj/item so that bodybags and ashes get destroyed. We dont want tons and tons of ash piling up
|
for (var/obj/O in inside) //obj instead of obj/item so that bodybags and ashes get destroyed. We dont want tons and tons of ash piling up
|
||||||
del(O)
|
qdel(O)
|
||||||
|
|
||||||
|
inside = null
|
||||||
|
|
||||||
new /obj/effect/decal/cleanable/ash(src)
|
new /obj/effect/decal/cleanable/ash(src)
|
||||||
sleep(30)
|
sleep(30)
|
||||||
@@ -393,12 +395,10 @@
|
|||||||
return
|
return
|
||||||
|
|
||||||
/obj/machinery/crema_switch/attack_hand(mob/user as mob)
|
/obj/machinery/crema_switch/attack_hand(mob/user as mob)
|
||||||
if(src.allowed(usr))
|
if (allowed(user))
|
||||||
for (var/obj/structure/crematorium/C in world)
|
for (var/obj/structure/crematorium/C in world)
|
||||||
if (C.id == id)
|
if (C.id == id)
|
||||||
if (!C.cremating)
|
|
||||||
C.cremate(user)
|
C.cremate(user)
|
||||||
else
|
else
|
||||||
usr << "\red Access denied."
|
user << "<SPAN CLASS='alert'>Access denied.</SPAN>"
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
@@ -52,16 +52,14 @@
|
|||||||
qdel(A)
|
qdel(A)
|
||||||
return
|
return
|
||||||
|
|
||||||
if(istype(A, /obj/item/weapon/disk/nuclear)) // Don't let nuke disks travel Z levels ... And moving this shit down here so it only fires when they're actually trying to change z-level.
|
var/disks_list = recursive_type_check(A, /obj/item/weapon/disk/nuclear)
|
||||||
del(A) //The disk's Destroy() proc ensures a new one is created
|
|
||||||
return
|
|
||||||
|
|
||||||
var/list/disk_search = A.search_contents_for(/obj/item/weapon/disk/nuclear)
|
|
||||||
if(istype(A, /obj/structure/stool/bed/chair/vehicle))
|
if(istype(A, /obj/structure/stool/bed/chair/vehicle))
|
||||||
var/obj/structure/stool/bed/chair/vehicle/B = A
|
var/obj/structure/stool/bed/chair/vehicle/B = A
|
||||||
if(B.buckled_mob)
|
if(B.buckled_mob)
|
||||||
disk_search = B.buckled_mob.search_contents_for(/obj/item/weapon/disk/nuclear)
|
disks_list = recursive_type_check(B.buckled_mob, /obj/item/weapon/disk/nuclear)
|
||||||
if(!isemptylist(disk_search))
|
|
||||||
|
if (length(disks_list))
|
||||||
if(istype(A, /mob/living))
|
if(istype(A, /mob/living))
|
||||||
var/mob/living/MM = A
|
var/mob/living/MM = A
|
||||||
if(MM.client && !MM.stat)
|
if(MM.client && !MM.stat)
|
||||||
@@ -75,11 +73,12 @@
|
|||||||
else if(MM.y >= world.maxy -TRANSITIONEDGE)
|
else if(MM.y >= world.maxy -TRANSITIONEDGE)
|
||||||
MM.inertia_dir = 2
|
MM.inertia_dir = 2
|
||||||
else
|
else
|
||||||
for(var/obj/item/weapon/disk/nuclear/N in disk_search)
|
for (var/obj/item/weapon/disk/nuclear/N in disks_list)
|
||||||
del(N)//Make the disk respawn it is on a clientless mob or corpse
|
qdel(N) // make the disk respawn if it is floating on its own.
|
||||||
else
|
else
|
||||||
for(var/obj/item/weapon/disk/nuclear/N in disk_search)
|
for (var/obj/item/weapon/disk/nuclear/N in disks_list)
|
||||||
del(N)//Make the disk respawn if it is floating on its own
|
qdel(N) // make the disk respawn if it is floating on its own.
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
//Check if it's a mob pulling an object
|
//Check if it's a mob pulling an object
|
||||||
|
|||||||
Reference in New Issue
Block a user