[MIRROR] Techweb fixes (#6023)

* Techweb fixes (#36513)

* Techweb fixes

* board

* robo

* Techweb fixes
This commit is contained in:
CitadelStationBot
2018-03-19 21:18:35 -05:00
committed by Poojawa
parent b74454bf5c
commit 9338d18a28
6 changed files with 97 additions and 27 deletions
@@ -41,7 +41,7 @@
cached_designs.Cut()
for(var/i in stored_research.researched_designs)
var/datum/design/d = stored_research.researched_designs[i]
if((d.departmental_flags & allowed_department_flags) && (d.build_type & allowed_buildtypes))
if((isnull(allowed_department_flags) || (d.departmental_flags & allowed_department_flags)) && (d.build_type & allowed_buildtypes))
cached_designs |= d
/obj/machinery/rnd/production/RefreshParts()
@@ -115,7 +115,7 @@
var/datum/design/D = (linked_console || requires_console)? linked_console.stored_research.researched_designs[id] : get_techweb_design_by_id(id)
if(!istype(D))
return FALSE
if(!(D.departmental_flags & allowed_department_flags))
if(!(isnull(allowed_department_flags) || (D.departmental_flags & allowed_department_flags)))
say("Warning: Printing failed: This fabricator does not have the necessary keys to decrypt design schematics. Please update the research data with the on-screen button and contact Nanotrasen Support!")
return FALSE
if(D.build_type && !(D.build_type & allowed_buildtypes))
@@ -152,7 +152,7 @@
matching_designs.Cut()
for(var/v in stored_research.researched_designs)
var/datum/design/D = stored_research.researched_designs[v]
if(!(D.build_type & allowed_buildtypes) || !(D.departmental_flags & allowed_department_flags))
if(!(D.build_type & allowed_buildtypes) || !(isnull(allowed_department_flags) || (D.departmental_flags & allowed_department_flags)))
continue
if(findtext(D.name,string))
matching_designs.Add(D)
@@ -308,7 +308,7 @@
var/datum/design/D = stored_research.researched_designs[v]
if(!(selected_category in D.category)|| !(D.build_type & allowed_buildtypes))
continue
if(!(D.departmental_flags & allowed_department_flags))
if(!(isnull(allowed_department_flags) || (D.departmental_flags & allowed_department_flags)))
continue
l += design_menu_entry(D, coeff)
l += "</div>"
@@ -22,4 +22,12 @@
/obj/machinery/rnd/production/circuit_imprinter/disconnect_console()
linked_console.linked_imprinter = null
..()
..()
/obj/machinery/rnd/production/circuit_imprinter/calculate_efficiency()
. = ..()
var/total_rating = 0
for(var/obj/item/stock_parts/manipulator/M in component_parts)
total_rating += M.rating * 2 //There is only one.
total_rating = max(1, total_rating)
efficiency_coeff = total_rating