[s] Small tweaks and fixes a edgecase with machine construction (#37494)

* Puts back required time for the emitter and field_generator and also removes a certain issue that certain people were causing

* Couple of things I missed

* I noticed the error with regards to atom and changed to obj like I was trying to originally. Also its fine to build on tables that wasnt the issue with this specific aspect.

* Edge windows. We need those.

* optimised the checks to be behind a if check for when you are actually needing to make something for the floor...

* Corrects a input proc by request

* Working is not my strong suit.
This commit is contained in:
Jalleo
2018-04-30 11:01:43 +01:00
committed by CitadelStationBot
parent 3369c804b2
commit 987cce76ed
4 changed files with 24 additions and 12 deletions
+20 -8
View File
@@ -227,26 +227,36 @@
else
to_chat(usr, "<span class='warning'>You haven't got enough [src] to build \the [R.title]!</span>")
return FALSE
if(R.window_checks && !valid_window_location(usr.loc, usr.dir))
var/turf/T = get_turf(usr)
if(R.window_checks && !valid_window_location(T, usr.dir))
to_chat(usr, "<span class='warning'>The [R.title] won't fit here!</span>")
return FALSE
if(R.one_per_turf && (locate(R.result_type) in usr.loc))
if(R.one_per_turf && (locate(R.result_type) in T))
to_chat(usr, "<span class='warning'>There is another [R.title] here!</span>")
return FALSE
if(R.on_floor && !isfloorturf(usr.loc))
to_chat(usr, "<span class='warning'>\The [R.title] must be constructed on the floor!</span>")
return FALSE
if(R.on_floor)
if(!isfloorturf(T))
to_chat(usr, "<span class='warning'>\The [R.title] must be constructed on the floor!</span>")
return FALSE
for(var/obj/AM in T)
if(istype(AM,/obj/structure/grille))
continue
if(istype(AM,/obj/structure/table))
continue
if(AM.density)
to_chat(usr, "<span class='warning'>Theres a [AM.name] here. You cant make a [R.title] here!</span>")
return FALSE
if(R.placement_checks)
switch(R.placement_checks)
if(STACK_CHECK_CARDINALS)
var/turf/step
for(var/direction in GLOB.cardinals)
step = get_step(usr, direction)
step = get_step(T, direction)
if(locate(R.result_type) in step)
to_chat(usr, "<span class='warning'>\The [R.title] must not be built directly adjacent to another!</span>")
return FALSE
if(STACK_CHECK_ADJACENT)
if(locate(R.result_type) in range(1, usr))
if(locate(R.result_type) in range(1, T))
to_chat(usr, "<span class='warning'>\The [R.title] must be constructed at least one tile away from others of its type!</span>")
return FALSE
return TRUE
@@ -395,7 +405,9 @@
var/window_checks = FALSE
var/placement_checks = FALSE
/datum/stack_recipe/New(title, result_type, req_amount = 1, res_amount = 1, max_res_amount = 1, time = 0, one_per_turf = FALSE, on_floor = FALSE, window_checks = FALSE, placement_checks = FALSE)
/datum/stack_recipe/New(title, result_type, req_amount = 1, res_amount = 1, max_res_amount = 1,time = 0, one_per_turf = FALSE, on_floor = FALSE, window_checks = FALSE, placement_checks = FALSE )
src.title = title
src.result_type = result_type
src.req_amount = req_amount