From 8e6d00ea42f9862acfee544b02f615f2ce7f156a Mon Sep 17 00:00:00 2001 From: Sirryan2002 <80364400+Sirryan2002@users.noreply.github.com> Date: Tue, 19 Jul 2022 06:03:57 -0400 Subject: [PATCH] Library Fixes (#18414) * library fixes * apply code review suggestions Co-authored-by: Charlie <69320440+hal9000PR@users.noreply.github.com> Co-authored-by: Charlie <69320440+hal9000PR@users.noreply.github.com> --- code/modules/library/book.dm | 2 +- code/modules/library/library_computer.dm | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code/modules/library/book.dm b/code/modules/library/book.dm index e92653d0e36..0b793511eea 100644 --- a/code/modules/library/book.dm +++ b/code/modules/library/book.dm @@ -167,7 +167,7 @@ user << browse("[dat]
" + "[pages[current_page]]", "window=book[UID()]") /obj/item/book/Topic(href, href_list) - if(..()) + if(..() || isobserver(usr)) return if(href_list["next_page"]) if(current_page > length(pages)) //should never be false, but just in-case diff --git a/code/modules/library/library_computer.dm b/code/modules/library/library_computer.dm index 93fdf7dc6bd..84c13916500 100644 --- a/code/modules/library/library_computer.dm +++ b/code/modules/library/library_computer.dm @@ -444,7 +444,7 @@ user_data.search_rating["max"] = clamp(text2num(answer), user_data.search_rating["min"], 10) populate_booklist() if("edit_search_ratingmin") - if(!text2num(answer)) + if(isnull(text2num(answer))) return user_data.search_rating["min"] = clamp(text2num(answer), 0, user_data.search_rating["max"]) populate_booklist() @@ -463,8 +463,8 @@ if("setpagenumber") if(!text2num(answer)) return - archive_page_num = clamp(text2num(answer), 1, getmaxpages()) populate_booklist() + archive_page_num = clamp(text2num(answer), 1, getmaxpages()) else return FALSE else