mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-15 20:52:41 +00:00
Merge pull request #5343 from ReddeyfishVor/slimeChanges
prevent slimes from spawning on top of people
This commit is contained in:
@@ -12,4 +12,16 @@
|
|||||||
var/area/A = locate(areapath) // Check if it actually exists
|
var/area/A = locate(areapath) // Check if it actually exists
|
||||||
if(istype(A) && A.z in using_map.player_levels)
|
if(istype(A) && A.z in using_map.player_levels)
|
||||||
grand_list_of_areas += A
|
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
|
||||||
|
|
||||||
@@ -51,17 +51,6 @@
|
|||||||
kill()
|
kill()
|
||||||
return
|
return
|
||||||
|
|
||||||
/** Checks if any living humans are in a given area! */
|
|
||||||
/datum/event/atmos_leak/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
|
|
||||||
|
|
||||||
/datum/event/atmos_leak/announce()
|
/datum/event/atmos_leak/announce()
|
||||||
command_announcement.Announce("Warning, hazardous [gas_data.name[gas_type]] gas leak detected in \the [target_area], evacuate the area and contain the damage!", "Hazard Alert")
|
command_announcement.Announce("Warning, hazardous [gas_data.name[gas_type]] gas leak detected in \the [target_area], evacuate the area and contain the damage!", "Hazard Alert")
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
/datum/event/escaped_slimes/start()
|
/datum/event/escaped_slimes/start()
|
||||||
var/list/vents = list()
|
var/list/vents = list()
|
||||||
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in machines)
|
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in machines)
|
||||||
if(temp_vent.network && temp_vent.loc.z in using_map.station_levels) //borrowed from spiders event, but it works. Distribute the slimes only in rooms with vents
|
if(temp_vent.network && temp_vent.loc.z in using_map.station_levels && !is_area_occupied(temp_vent.loc.loc)) //borrowed from spiders event, but it works. Distribute the slimes only in rooms with vents
|
||||||
vents += temp_vent
|
vents += temp_vent
|
||||||
|
|
||||||
while((spawncount > 0) && vents.len)
|
while((spawncount > 0) && vents.len)
|
||||||
|
|||||||
Reference in New Issue
Block a user