Merge pull request #5343 from ReddeyfishVor/slimeChanges

prevent slimes from spawning on top of people
This commit is contained in:
Anewbe
2018-06-11 13:10:24 -05:00
committed by GitHub
3 changed files with 14 additions and 13 deletions

View File

@@ -12,4 +12,16 @@
var/area/A = locate(areapath) // Check if it actually exists
if(istype(A) && A.z in using_map.player_levels)
grand_list_of_areas += A
return grand_list_of_areas
return grand_list_of_areas
/** Checks if any living humans are in a given area! */
/proc/is_area_occupied(var/area/myarea)
// Testing suggests looping over human_mob_list is quicker than looping over area contents
for(var/mob/living/carbon/human/H in human_mob_list)
if(H.stat >= DEAD) //Conditions for exclusion here, like if disconnected people start blocking it.
continue
var/area/A = get_area(H)
if(A == myarea) //The loc of a turf is the area it is in.
return 1
return 0