Bleeding edgy refresh (#303)
* not code stuff * other things * global vars, defines, helpers * onclick hud stuff, orphans, world.dm * controllers and datums * game folder * everything not client/mobs in modules * client folder * stage 1 mob stuff * simple animal things * silicons * carbon things * ayylmaos and monkeys * hyoomahn * icons n shit * sprite fixes * compile fixes * some fixes I cherrypicked. * qdel fixes * forgot brain refractors
This commit is contained in:
@@ -43,19 +43,18 @@
|
||||
if(prob(25))
|
||||
category = null
|
||||
var/c = category? " AND category='[sanitizeSQL(category)]'" :""
|
||||
var/DBQuery/query = dbcon.NewQuery("SELECT * FROM [format_table_name("library")] WHERE isnull(deleted)[c] GROUP BY title ORDER BY rand() LIMIT [amount];") // isdeleted copyright (c) not me
|
||||
if(query.Execute())
|
||||
while(query.NextRow())
|
||||
var/DBQuery/query_get_random_books = dbcon.NewQuery("SELECT * FROM [format_table_name("library")] WHERE isnull(deleted)[c] GROUP BY title ORDER BY rand() LIMIT [amount];") // isdeleted copyright (c) not me
|
||||
if(query_get_random_books.Execute())
|
||||
while(query_get_random_books.NextRow())
|
||||
var/obj/item/weapon/book/B = new(location)
|
||||
. += B
|
||||
B.author = query.item[2]
|
||||
B.title = query.item[3]
|
||||
B.dat = query.item[4]
|
||||
B.author = query_get_random_books.item[2]
|
||||
B.title = query_get_random_books.item[3]
|
||||
B.dat = query_get_random_books.item[4]
|
||||
B.name = "Book: [B.title]"
|
||||
B.icon_state= "book[rand(1,8)]"
|
||||
else
|
||||
log_game("SQL ERROR populating library bookshelf. Category: \[[category]\], Count: [amount], Error: \[[query.ErrorMsg()]\]\n")
|
||||
|
||||
return
|
||||
|
||||
/obj/structure/bookcase/random/fiction
|
||||
name = "bookcase (Fiction)"
|
||||
|
||||
Reference in New Issue
Block a user