-Added checks to prevent the nuke disk from leaving z1

-If the disk is deleted while it's inside a nuke, the nuke will lock itself

Conflicts:
	code/game/gamemodes/nuclear/nuclearbomb.dm
	code/game/turfs/space/space.dm
This commit is contained in:
ikarrus
2014-05-11 00:41:40 -06:00
committed by ZomgPonies
parent c139fa22a1
commit b385ed83b5
2 changed files with 44 additions and 16 deletions
+20
View File
@@ -1602,3 +1602,23 @@ proc/check_target_facings(mob/living/initator, mob/living/target)
ext_python("voice.py", "\"[accent]\" \"[voice]\" \"[pitch]\" \"[echo]\" \"[speed]\" \"[text]\" \"[src.ckey]\"")
atom/proc/GetTypeInAllContents(typepath)
var/list/processing_list = list(src)
var/list/processed = list()
var/atom/found = null
while(processing_list.len && found==null)
var/atom/A = processing_list[1]
if(istype(A, typepath))
found = A
processing_list -= A
for(var/atom/a in A)
if(!(a in processed))
processing_list |= a
processed |= A
return found
+24 -16
View File
@@ -94,12 +94,13 @@
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(!isemptylist(disk_search))
if(istype(A, /mob/living))
var/mob/living/MM = A
var/mob/living/MM = null
var/fukkendisk = A.GetTypeInAllContents(/obj/item/weapon/disk/nuclear)
if(fukkendisk)
if(isliving(A))
MM = A
if(MM.client && !MM.stat)
MM << "\red Something you are carrying is preventing you from leaving. Don't play stupid; you know exactly what it is."
MM << "<span class='warning'>Something you are carrying is preventing you from leaving. Don't play stupid; you know exactly what it is.</span>"
if(MM.x <= TRANSITIONEDGE)
MM.inertia_dir = 4
else if(MM.x >= world.maxx -TRANSITIONEDGE)
@@ -109,18 +110,25 @@
else if(MM.y >= world.maxy -TRANSITIONEDGE)
MM.inertia_dir = 2
else
for(var/obj/item/weapon/disk/nuclear/N in disk_search)
del(N)//Make the disk respawn it is on a clientless mob or corpse
qdel(fukkendisk)//Make the disk respawn if it is on a clientless mob or corpse
else
for(var/obj/item/weapon/disk/nuclear/N in disk_search)
del(N)//Make the disk respawn if it is floating on its own
qdel(fukkendisk)//Make the disk respawn if it is floating on its own
return
var/mob/living/MOB = null
//Check if it's a mob pulling an object. Have the object transition with the mob if it's not the nuke disk
var/obj/was_pulling = null
if(isliving(A))
MOB = A
was_pulling = MOB.pulling
MM = A
if(MM.pulling)
//Check for that fucking disk
if(istype(MM.pulling, /obj/item/weapon/disk/nuclear))
qdel(MM.pulling)
else
was_pulling = MM.pulling
fukkendisk = was_pulling.GetTypeInAllContents(/obj/item/weapon/disk/nuclear)
if(fukkendisk)
MM << "<span class='warning'>You think you saw something slip out of [was_pulling], but you couldn't tell where it went...</span>"
qdel(fukkendisk)
var/move_to_z = src.z
var/safety = 1
@@ -154,10 +162,10 @@
A.x = rand(TRANSITIONEDGE + 2, world.maxx - TRANSITIONEDGE - 2)
spawn (0)
if(was_pulling)
was_pulling.loc = MOB.loc
MOB.pulling = was_pulling
was_pulling.pulledby = MOB
if(was_pulling && MM)
was_pulling.loc = MM.loc
MM.pulling = was_pulling
was_pulling.pulledby = MM
if ((A && A.loc))
A.loc.Entered(A)