mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-26 13:37:58 +01:00
Merge pull request #1341 from Krausus/APCGetAndFrameFixes
Fixes get_apc and a mountable frame issue
This commit is contained in:
@@ -9,7 +9,6 @@
|
||||
if(..())
|
||||
var/turf/turf_loc = get_turf(user)
|
||||
var/area/area_loc = turf_loc.loc
|
||||
if(istype(area_loc,/area/mine)) return
|
||||
if (area_loc.get_apc())
|
||||
user << "<span class='rose'>This area already has an APC.</span>"
|
||||
return //only one APC per area
|
||||
|
||||
@@ -19,7 +19,9 @@
|
||||
if (src.mount_reqs.Find("simfloor") && !istype(turf_loc, /turf/simulated/floor))
|
||||
user << "<span class='rose'>[src] cannot be placed on this spot.</span>"
|
||||
return
|
||||
if (src.mount_reqs.Find("nospace") && (areaMaster.requires_power == 0 || istype(areaMaster,/area/space)))
|
||||
user << "<span class='rose'>[src] cannot be placed in this area.</span>"
|
||||
return
|
||||
return 1
|
||||
if (src.mount_reqs.Find("nospace"))
|
||||
var/area/my_area = turf_loc.loc
|
||||
if(!istype(my_area) || (my_area.requires_power == 0 || istype(my_area,/area/space)))
|
||||
user << "<span class='rose'>[src] cannot be placed in this area.</span>"
|
||||
return
|
||||
return 1
|
||||
|
||||
@@ -404,8 +404,11 @@
|
||||
return null
|
||||
|
||||
/area/proc/get_apc()
|
||||
var/obj/machinery/power/apc/FINDME = locate() in src
|
||||
if (FINDME)
|
||||
// This was a simple locate() in src, but an unresolved BYOND bug causes trying to locate() in an
|
||||
// area to take an inconceivably long time, especially for large areas.
|
||||
// See: http://www.byond.com/forum/?post=1860571
|
||||
var/obj/machinery/power/apc/FINDME
|
||||
for(FINDME in src)
|
||||
return FINDME
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user