diff --git a/code/game/gamemodes/miniantags/borer/borer.dm b/code/game/gamemodes/miniantags/borer/borer.dm
index 075e0e7a09b..16f59d335f8 100644
--- a/code/game/gamemodes/miniantags/borer/borer.dm
+++ b/code/game/gamemodes/miniantags/borer/borer.dm
@@ -392,10 +392,10 @@
content += "
"
for(var/datum in typesof(/datum/borer_chem))
- var/datum/borer_chem/C = new datum()
- var/datum/reagent/R = chemical_reagents_list[C.chemname]
- if(C.chemname)
- content += "| [R.name] ([C.chemuse]) [C.chemdesc] |
"
+ var/datum/borer_chem/C = datum
+ var/datum/reagent/R = chemical_reagents_list[initial(C.chemname)]
+ if(initial(C.chemname))
+ content += "| [R.name] ([initial(C.chemuse)]) [initial(C.chemdesc)] |
"
content += "
"
@@ -417,19 +417,17 @@
return
var/topic_chem = href_list["borer_use_chem"]
- var/datum/borer_chem/C
+ var/datum/borer_chem/C = null
for(var/datum in typesof(/datum/borer_chem))
- var/datum/borer_chem/test = new datum()
- if(test.chemname == topic_chem)
- C = test
+ var/datum/borer_chem/test = datum
+ if(initial(test.chemname) == topic_chem)
+ C = new test()
break
- var/datum/reagent/R = chemical_reagents_list[C.chemname]
- if(!istype(C, /datum/borer_chem))
- return
if(!C || !host || controlling || !src || stat)
return
+ var/datum/reagent/R = chemical_reagents_list[C.chemname]
if(chemicals < C.chemuse)
to_chat(src, "You need [C.chemuse] chemicals stored to secrete [R.name]!")
return
@@ -439,6 +437,9 @@
chemicals -= C.chemuse
log_game("[src]/([src.ckey]) has injected [R.name] into their host [host]/([host.ckey])")
+ // This is used because we use a static set of datums to determine what chems are available,
+ // instead of a table or something. Thus, when we instance it, we can safely delete it
+ qdel(C)
..()
/mob/living/simple_animal/borer/verb/hide_borer()
@@ -448,6 +449,7 @@
if(host)
to_chat(usr, "You cannot do this while you're inside a host.")
+ return
if(stat != CONSCIOUS)
return
@@ -702,7 +704,7 @@
B.detatch()
else
- to_chat(src, "ERROR NO BORER OR BRAINMOB DETECTED IN THIS MOB, THIS IS A BUG !")
+ log_runtime(EXCEPTION("Missing borer or missing host brain upon borer release."), src)
//Check for brain worms in head.
/mob/proc/has_brain_worms()