| 71 | } |
| 72 | |
| 73 | std::string getBookLocalizedNameFromIndex(int index, bool censored) |
| 74 | { |
| 75 | if ( allBooks.empty() || index < 0 || index >= allBooks.size() ) { |
| 76 | return ""; |
| 77 | } |
| 78 | if ( !spawn_blood && censored ) { |
| 79 | for ( int c = 0; c < num_banned_books; ++c ) { |
| 80 | auto banned_book = banned_books[c]; |
| 81 | if ( allBooks[index].default_name == banned_book ) { |
| 82 | return getBookLocalizedNameFromIndex((index + 1) % allBooks.size(), censored); |
| 83 | } |
| 84 | } |
| 85 | } |
| 86 | return ItemTooltips.bookNameLocalizations[allBooks[index].default_name]; |
| 87 | } |
| 88 | |
| 89 | //Local helper function to make getting the list of books cross-platform easier. |
| 90 | std::list<std::string> getListOfBooks() |
no test coverage detected