Replaces nuke disk search_contents_for with a global nuke disk registry

This commit is contained in:
mwerezak
2015-05-22 01:15:04 -04:00
parent 3c67c46442
commit 4ba4bd8dd3
4 changed files with 43 additions and 22 deletions
+17 -13
View File
@@ -796,17 +796,21 @@ default behaviour is:
return
/mob/living/touch_map_edge()
var/list/disk_search = search_contents_for(/obj/item/weapon/disk/nuclear)
if(!isemptylist(disk_search) && client && stat != DEAD)
if(x <= TRANSITIONEDGE)
inertia_dir = 4
else if(x >= world.maxx -TRANSITIONEDGE)
inertia_dir = 8
else if(y <= TRANSITIONEDGE)
inertia_dir = 1
else if(y >= world.maxy -TRANSITIONEDGE)
inertia_dir = 2
src << "<span class='warning>Something you are carrying is preventing you from leaving.</span>"
return
//check for nuke disks
if(client && stat != DEAD) //if they are clientless and dead don't bother, the parent will treat them as any other container
if(ticker && istype(ticker.mode, /datum/game_mode/nuclear)) //only really care if the game mode is nuclear
var/datum/game_mode/nuclear/G = ticker.mode
if(G.check_mob(src))
if(x <= TRANSITIONEDGE)
inertia_dir = 4
else if(x >= world.maxx -TRANSITIONEDGE)
inertia_dir = 8
else if(y <= TRANSITIONEDGE)
inertia_dir = 1
else if(y >= world.maxy -TRANSITIONEDGE)
inertia_dir = 2
src << "<span class='warning>Something you are carrying is preventing you from leaving.</span>"
return
..() //Should make the disk respawn it is on a clientless mob or corpse
..()