Resolve problem with robot destructive analyzer

CallTechName() was borrowed from destructive_analyzer.dm for reuse in
the portable analyzer.

Resolves #12356
This commit is contained in:
Daranz
2016-03-08 23:31:30 +01:00
committed by Neerti
parent 8582f20ee0
commit 2482ddf55a
4 changed files with 17 additions and 24 deletions

View File

@@ -28,10 +28,9 @@
user << "You activate the analyzer's microlaser, analyzing \the [loaded_item] and breaking it down."
flick("portable_analyzer_scan", src)
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
var/list/temp_tech = ConvertReqString2List(loaded_item.origin_tech)
for(var/T in temp_tech)
files.UpdateTech(T, temp_tech[T])
user << "\The [loaded_item] had level [temp_tech[T]] in [T]."
for(var/T in loaded_item.origin_tech)
files.UpdateTech(T, loaded_item.origin_tech[T])
user << "\The [loaded_item] had level [loaded_item.origin_tech[T]] in [CallTechName(T)]."
loaded_item = null
for(var/obj/I in contents)
for(var/mob/M in I.contents)

View File

@@ -47,19 +47,6 @@ won't update every console in existence) but it's more of a hassle to do. Also,
req_access = list(access_research) //Data and setting manipulation requires scientist access.
/obj/machinery/computer/rdconsole/proc/CallTechName(var/ID) //A simple helper proc to find the name of a tech with a given ID.
var/datum/tech/check_tech
var/return_name = null
for(var/T in typesof(/datum/tech) - /datum/tech)
check_tech = null
check_tech = new T()
if(check_tech.id == ID)
return_name = check_tech.name
qdel(check_tech)
check_tech = null
break
return return_name
/obj/machinery/computer/rdconsole/proc/CallMaterialName(var/ID)
var/return_name = ID
switch(return_name)

View File

@@ -122,6 +122,20 @@ research holder datum.
KT.level = max(KT.level + 1, level - 1)
return
// A simple helper proc to find the name of a tech with a given ID.
/proc/CallTechName(var/ID)
var/datum/tech/check_tech
var/return_name = null
for(var/T in typesof(/datum/tech) - /datum/tech)
check_tech = null
check_tech = new T()
if(check_tech.id == ID)
return_name = check_tech.name
qdel(check_tech)
check_tech = null
break
return return_name
/***************************************************************
** Technology Datums **
** Includes all the various technoliges and what they make. **