[MIRROR] Survival capsules no longer get deleted when deployed at the edge of the map (#3783)

* Survival capsules no longer get deleted when deployed at the edge of the map (#57215)

* Survival capsules no longer get deleted when deployed at the edge of the map

Co-authored-by: Dex <60656530+Ewwmewgewd@users.noreply.github.com>
This commit is contained in:
SkyratBot
2021-03-03 02:02:42 +00:00
committed by GitHub
co-authored by Dex
parent 1d6f9c4e64
commit dbe7035f74
3 changed files with 14 additions and 5 deletions
@@ -49,22 +49,21 @@
switch(status)
if(SHELTER_DEPLOY_BAD_AREA)
src.loc.visible_message("<span class='warning'>\The [src] will not function in this area.</span>")
if(SHELTER_DEPLOY_BAD_TURFS, SHELTER_DEPLOY_ANCHORED_OBJECTS)
if(SHELTER_DEPLOY_BAD_TURFS, SHELTER_DEPLOY_ANCHORED_OBJECTS, SHELTER_DEPLOY_OUTSIDE_MAP)
var/width = template.width
var/height = template.height
src.loc.visible_message("<span class='warning'>\The [src] doesn't have room to deploy! You need to clear a [width]x[height] area!</span>")
if(status != SHELTER_DEPLOY_ALLOWED)
used = FALSE
return
playsound(src, 'sound/effects/phasein.ogg', 100, TRUE)
template.load(deploy_location, centered = TRUE)
var/turf/T = deploy_location
if(!is_mining_level(T.z)) //only report capsules away from the mining/lavaland level
message_admins("[ADMIN_LOOKUPFLW(usr)] activated a bluespace capsule away from the mining level! [ADMIN_VERBOSEJMP(T)]")
log_admin("[key_name(usr)] activated a bluespace capsule away from the mining level at [AREACOORD(T)]")
template.load(deploy_location, centered = TRUE)
playsound(src, 'sound/effects/phasein.ogg', 100, TRUE)
new /obj/effect/particle_effect/smoke(get_turf(src))
qdel(src)
+9
View File
@@ -28,6 +28,15 @@
for(var/obj/O in T)
if((O.density && O.anchored) || is_type_in_typecache(O, banned_objects))
return SHELTER_DEPLOY_ANCHORED_OBJECTS
// Check if the shelter sticks out of map borders
var/shelter_origin_x = deploy_location.x - round(width/2)
if(shelter_origin_x <= 1 || shelter_origin_x+width > world.maxx)
return SHELTER_DEPLOY_OUTSIDE_MAP
var/shelter_origin_y = deploy_location.y - round(height/2)
if(shelter_origin_y <= 1 || shelter_origin_y+height > world.maxy)
return SHELTER_DEPLOY_OUTSIDE_MAP
return SHELTER_DEPLOY_ALLOWED
/datum/map_template/shelter/alpha