From 8acfb8db3c0e0b57796702e264f2c0a911d3e2c8 Mon Sep 17 00:00:00 2001 From: Vincent Date: Fri, 30 Oct 2015 21:54:13 -0400 Subject: [PATCH] Grumble grumble doesn't work in new must be in initialize --- code/modules/library/random_books.dm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/code/modules/library/random_books.dm b/code/modules/library/random_books.dm index 684de17ee74..009b896ef5c 100644 --- a/code/modules/library/random_books.dm +++ b/code/modules/library/random_books.dm @@ -9,8 +9,12 @@ var/book_count = 2 anchored = 1 state = 2 - /obj/structure/bookcase/random/New() + ..() + if(ticker && ticker.game_state >= GAME_STATE_PLAYING) + initialize() + +/obj/structure/bookcase/random/initialize() if(!book_count || !isnum(book_count)) update_icon() return @@ -57,7 +61,7 @@ name = "bookcase (Reference)" category = "Reference" var/ref_book_prob = 20 -/obj/structure/bookcase/random/reference/New() +/obj/structure/bookcase/random/reference/initialize() while(book_count > 0 && prob(ref_book_prob)) book_count-- new /obj/item/weapon/book/manual/random(src)