Page 1 of 1

how to add new spellbook

PostPosted: Sunday, 30th December 2018, 15:14
by cubejjw
I was add new spellbook(containing some of charm spells), but there is a problem that associated with "spl-book.cc"
It occasionally causes an error with the message "book of 45 out of range 0 (0) .. (int)ARRAYSZ(spellbook_templates) (44)".
I think this will be caused by maximum number of fixed-books.
However, I only found the definition of the maximum number of books in "book-type.h"(#define NUM_FIXED_BOOKS (MAX_FIXED_BOOK + 1))


I checked the changes when the Fen Folio was added, but it did not helpful. What is the solution to solve this crash?

Re: how to add new spellbook

PostPosted: Monday, 31st December 2018, 05:34
by Siegurt
cubejjw wrote:I was add new spellbook(containing some of charm spells), but there is a problem that associated with "spl-book.cc"
It occasionally causes an error with the message "book of 45 out of range 0 (0) .. (int)ARRAYSZ(spellbook_templates) (44)".
I think this will be caused by maximum number of fixed-books.
However, I only found the definition of the maximum number of books in "book-type.h"(#define NUM_FIXED_BOOKS (MAX_FIXED_BOOK + 1))


I checked the changes when the Fen Folio was added, but it did not helpful. What is the solution to solve this crash?

You'll note higher up in book-type.h it says:
  Code:
MAX_FIXED_BOOK = BOOK_NECRONOMICON

Which is how it defines what MAX_FIXED_BOOK is (BOOK_NECRONOMICON is the last enum value of type "book_type" that's considered a valid "fixed book"