mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-30 15:37:36 +01:00
Minor Mountable Frame Code Refactor (#18738)
* bugfix turned into a refactor * fixes exploit with producing infinite metal * Update code/__DEFINES/construction.dm Co-authored-by: Charlie <69320440+hal9000PR@users.noreply.github.com> Co-authored-by: Charlie <69320440+hal9000PR@users.noreply.github.com>
This commit is contained in:
@@ -3,26 +3,11 @@
|
||||
desc = "Used to build newscasters, just secure to the wall."
|
||||
icon_state = "newscaster"
|
||||
item_state = "syringe_kit"
|
||||
|
||||
materials = list(MAT_METAL=14000, MAT_GLASS=8000)
|
||||
mount_reqs = list("simfloor", "nospace")
|
||||
|
||||
/obj/item/mounted/frame/newscaster_frame/try_build(turf/on_wall, mob/user)
|
||||
if(..())
|
||||
var/turf/loc = get_turf(usr)
|
||||
var/area/A = loc.loc
|
||||
if(!istype(loc, /turf/simulated/floor))
|
||||
to_chat(usr, "<span class='alert'>Newscaster cannot be placed on this spot.</span>")
|
||||
return
|
||||
if(A.requires_power == 0 || A.name == "Space")
|
||||
to_chat(usr, "<span class='alert'>Newscaster cannot be placed in this area.</span>")
|
||||
return
|
||||
|
||||
for(var/obj/machinery/newscaster/T in loc)
|
||||
to_chat(usr, "<span class='alert'>There is another newscaster here.</span>")
|
||||
return
|
||||
|
||||
return 1
|
||||
return
|
||||
mount_requirements = MOUNTED_FRAME_SIMFLOOR | MOUNTED_FRAME_NOSPACE
|
||||
metal_sheets_refunded = 7
|
||||
glass_sheets_refunded = 4
|
||||
|
||||
/obj/item/mounted/frame/newscaster_frame/do_build(turf/on_wall, mob/user)
|
||||
var/obj/machinery/newscaster/N = new /obj/machinery/newscaster(get_turf(src), get_dir(on_wall, user), 1)
|
||||
|
||||
Reference in New Issue
Block a user