From 005acb5529de8cc986aa68c3e5b9b2859959deb4 Mon Sep 17 00:00:00 2001 From: "johnsonmt88@gmail.com" Date: Tue, 22 Jan 2013 02:54:16 +0000 Subject: [PATCH] Runtime fix for: runtime error: Cannot read null.name proc name: New (/obj/effect/golemrune/New) The reaction that creates the rune was creating the rune in nullspace, it tried to use the loc in it's constructor, then it set the loc afterwards. Now it runs the constructor and such, THEN runs 'announce_to_ghosts()' after it is assigned a loc. I've also changed src.loc.name to get_area(src) so instead of "A golem rune was created in area Floor " it says "A golem rune was created in Chemistry." git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5597 316c924e-a436-60f5-8080-3fe189b3f50e --- code/modules/mob/living/carbon/metroid/metroid.dm | 11 ++++++++--- code/modules/reagents/Chemistry-Recipes.dm | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/code/modules/mob/living/carbon/metroid/metroid.dm b/code/modules/mob/living/carbon/metroid/metroid.dm index e87d0af56f5..ca35999b3ea 100644 --- a/code/modules/mob/living/carbon/metroid/metroid.dm +++ b/code/modules/mob/living/carbon/metroid/metroid.dm @@ -987,9 +987,6 @@ mob/living/carbon/slime/var/temperature_resistance = T0C+75 New() ..() processing_objects.Add(src) - for(var/mob/dead/observer/G in player_list) - if(G.client) - G << "Golem rune created in area [src.loc.name] " process() var/mob/dead/observer/ghost @@ -1026,6 +1023,14 @@ mob/living/carbon/slime/var/temperature_resistance = T0C+75 G.key = ghost.key G << "You are an adamantine golem. You move slowly, but are highly resistant to heat and cold as well as blunt trauma. You are unable to wear clothes, but can still use most tools. Serve [user], and assist them in completing their goals at any cost." del (src) + + + proc/announce_to_ghosts() + for(var/mob/dead/observer/G in player_list) + if(G.client) + var/area/A = get_area(src) + if(A) + G << "Golem rune created in [A.name]." //////////////////////////////Old shit from metroids/RoRos, and the old cores, would not take much work to re-add them//////////////////////// /* diff --git a/code/modules/reagents/Chemistry-Recipes.dm b/code/modules/reagents/Chemistry-Recipes.dm index 1ec97fea465..1d0a1302798 100644 --- a/code/modules/reagents/Chemistry-Recipes.dm +++ b/code/modules/reagents/Chemistry-Recipes.dm @@ -1257,6 +1257,7 @@ datum on_reaction(var/datum/reagents/holder) var/obj/effect/golemrune/Z = new /obj/effect/golemrune Z.loc = get_turf_loc(holder.my_atom) + Z.announce_to_ghosts() //////////////////////////////////////////FOOD MIXTURES//////////////////////////////////// tofu