Fix wall frames dropping steel and bugging on failure to place.

Previously, if you tried to place a frame on a wall and it failed (due to something already being there etc)  you would no longer be asked what type to use next time you try, and it will runtime.
Fixes this by performing the safety checks *before* asking you want you want to build.  Since the checks don't depend on what type you want to build anyway its fine.
This commit is contained in:
Leshana
2018-04-11 21:21:04 -04:00
parent 33357bdd3e
commit ebebdbc37b

View File

@@ -54,17 +54,6 @@
/obj/item/frame/proc/try_build(turf/on_wall, mob/user as mob)
update_type_list()
var/datum/frame/frame_types/frame_type
if(!build_machine_type)
var/datum/frame/frame_types/response = input(user, "What kind of frame would you like to make?", "Frame type request", null) in frame_types_wall
if(!response || response.name == "Cancel")
return
frame_type = response
build_machine_type = /obj/structure/frame
if(frame_type.frame_size != 5)
new /obj/item/stack/material/steel(user.loc, (5 - frame_type.frame_size))
if(get_dist(on_wall, user)>1)
return
@@ -92,6 +81,18 @@
to_chat(user, "<span class='danger'>There's already an item on this wall!</span>")
return
var/datum/frame/frame_types/frame_type
if(!build_machine_type)
var/datum/frame/frame_types/response = input(user, "What kind of frame would you like to make?", "Frame type request", null) in frame_types_wall
if(!response || response.name == "Cancel")
return
frame_type = response
build_machine_type = /obj/structure/frame
if(frame_type.frame_size != 5)
new /obj/item/stack/material/steel(user.loc, (5 - frame_type.frame_size))
var/obj/machinery/M = new build_machine_type(loc, ndir, 1, frame_type)
M.fingerprints = fingerprints
M.fingerprintshidden = fingerprintshidden