Merge remote-tracking branch 'upstream/dev-freeze' into dev

Conflicts:
	code/modules/mob/living/silicon/robot/robot_modules.dm
This commit is contained in:
PsiOmegaDelta
2015-10-07 08:14:30 +02:00
12 changed files with 63 additions and 31 deletions

View File

@@ -17,3 +17,18 @@
if(A.simulated)
return 0
return 1
// Picks a turf without a mob from the given list of turfs, if one exists.
// If no such turf exists, picks any random turf from the given list of turfs.
/proc/pick_mobless_turf_if_exists(var/list/start_turfs)
if(!start_turfs.len)
return null
var/list/available_turfs = list()
for(var/start_turf in start_turfs)
var/mob/M = locate() in start_turf
if(!M)
available_turfs += start_turf
if(!available_turfs.len)
available_turfs = start_turfs
return pick(available_turfs)