mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-12 03:02:54 +00:00
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:
@@ -30,13 +30,6 @@
|
|||||||
|
|
||||||
return "[output][and_text][input[index]]"
|
return "[output][and_text][input[index]]"
|
||||||
|
|
||||||
|
|
||||||
/proc/ConvertReqString2List(var/list/source_list)
|
|
||||||
var/list/temp_list = params2list(source_list)
|
|
||||||
for(var/O in temp_list)
|
|
||||||
temp_list[O] = text2num(temp_list[O])
|
|
||||||
return temp_list
|
|
||||||
|
|
||||||
//Returns list element or null. Should prevent "index out of bounds" error.
|
//Returns list element or null. Should prevent "index out of bounds" error.
|
||||||
proc/listgetindex(var/list/list,index)
|
proc/listgetindex(var/list/list,index)
|
||||||
if(istype(list) && list.len)
|
if(istype(list) && list.len)
|
||||||
|
|||||||
@@ -28,10 +28,9 @@
|
|||||||
user << "You activate the analyzer's microlaser, analyzing \the [loaded_item] and breaking it down."
|
user << "You activate the analyzer's microlaser, analyzing \the [loaded_item] and breaking it down."
|
||||||
flick("portable_analyzer_scan", src)
|
flick("portable_analyzer_scan", src)
|
||||||
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
|
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
|
||||||
var/list/temp_tech = ConvertReqString2List(loaded_item.origin_tech)
|
for(var/T in loaded_item.origin_tech)
|
||||||
for(var/T in temp_tech)
|
files.UpdateTech(T, loaded_item.origin_tech[T])
|
||||||
files.UpdateTech(T, temp_tech[T])
|
user << "\The [loaded_item] had level [loaded_item.origin_tech[T]] in [CallTechName(T)]."
|
||||||
user << "\The [loaded_item] had level [temp_tech[T]] in [T]."
|
|
||||||
loaded_item = null
|
loaded_item = null
|
||||||
for(var/obj/I in contents)
|
for(var/obj/I in contents)
|
||||||
for(var/mob/M in I.contents)
|
for(var/mob/M in I.contents)
|
||||||
|
|||||||
@@ -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.
|
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)
|
/obj/machinery/computer/rdconsole/proc/CallMaterialName(var/ID)
|
||||||
var/return_name = ID
|
var/return_name = ID
|
||||||
switch(return_name)
|
switch(return_name)
|
||||||
|
|||||||
@@ -122,6 +122,20 @@ research holder datum.
|
|||||||
KT.level = max(KT.level + 1, level - 1)
|
KT.level = max(KT.level + 1, level - 1)
|
||||||
return
|
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 **
|
** Technology Datums **
|
||||||
** Includes all the various technoliges and what they make. **
|
** Includes all the various technoliges and what they make. **
|
||||||
|
|||||||
Reference in New Issue
Block a user