Files
Bubberstation/code/game/objects/items/apc_frame.dm
SyncIt21 218ce4840c APC assigns itself the correct name based on its area (#73054)
## About The Pull Request
APC was assigned a name before it was assigned an area causing null
names.

Another bug i noticed was that newly built apcs were also not assigned
names. Thats fixed now too

Fixes #73052

## Changelog
🆑
fix: apc not assigning itself a name based on its area
fix: newly built apc's not getting assigned area names
/🆑
2023-01-30 19:50:03 -07:00

28 lines
934 B
Plaintext

// APC HULL
/obj/item/wallframe/apc
name = "\improper APC frame"
desc = "Used for repairing or building APCs."
icon_state = "apc"
result_path = /obj/machinery/power/apc/auto_name
/obj/item/wallframe/apc/try_build(turf/on_wall, user)
if(!..())
return
var/turf/T = get_turf(on_wall) //the user is not where it needs to be.
var/area/A = get_area(user)
if(A.apc)
to_chat(user, span_warning("This area already has an APC!"))
return //only one APC per area
if(!A.requires_power)
to_chat(user, span_warning("You cannot place [src] in this area!"))
return //can't place apcs in areas with no power requirement
for(var/obj/machinery/power/terminal/E in T)
if(E.master)
to_chat(user, span_warning("There is another network terminal here!"))
return
else
new /obj/item/stack/cable_coil(T, 10)
to_chat(user, span_notice("You cut the cables and disassemble the unused power terminal."))
qdel(E)
return TRUE