extern void init_file_paths(char *path);
extern void init_angband(void);
extern errr init_buildings(void);
-#ifdef ALLOW_TEMPLATES
-extern u32b fake_name_size;
-extern u32b fake_text_size;
-#endif /* ALLOW_TEMPLATES */
/* load.c */
extern errr rd_savefile_new(void);
static bool add_text(u32b *offset, header *head, cptr buf)
{
/* Hack -- Verify space */
- if (head->text_size + strlen(buf) + 8 > fake_text_size)
+ if (head->text_size + strlen(buf) + 8 > FAKE_TEXT_SIZE)
return (FALSE);
/* New text? */
static bool add_name(u32b *offset, header *head, cptr buf)
{
/* Hack -- Verify space */
- if (head->name_size + strlen(buf) + 8 > fake_name_size)
+ if (head->name_size + strlen(buf) + 8 > FAKE_NAME_SIZE)
return (FALSE);
/* New name? */
/*
- * Hack -- help initialize the fake "name" and "text" arrays when
- * parsing an "ascii" template file.
- */
-u32b fake_name_size;
-u32b fake_text_size;
-
-
-/*
* Standard error message text
*/
cptr err_str[PARSE_ERROR_MAX] =
{
/*** Make the fake arrays ***/
- /* Assume the size of "*_name" and "*_text" */
- fake_name_size = FAKE_NAME_SIZE;
- fake_text_size = FAKE_TEXT_SIZE;
-
/* Allocate the "*_info" array */
C_MAKE(head->info_ptr, head->info_size, char);
/* Hack -- make "fake" arrays */
- if (name) C_MAKE(head->name_ptr, fake_name_size, char);
- if (text) C_MAKE(head->text_ptr, fake_text_size, char);
+ if (name) C_MAKE(head->name_ptr, FAKE_NAME_SIZE, char);
+ if (text) C_MAKE(head->text_ptr, FAKE_TEXT_SIZE, char);
if (info) (*info) = head->info_ptr;
if (name) (*name) = head->name_ptr;
C_KILL(head->info_ptr, head->info_size, char);
/* Hack -- Free the "fake" arrays */
- if (name) C_KILL(head->name_ptr, fake_name_size, char);
- if (text) C_KILL(head->text_ptr, fake_text_size, char);
-
- /* Forget the array sizes */
- fake_name_size = 0;
- fake_text_size = 0;
+ if (name) C_KILL(head->name_ptr, FAKE_NAME_SIZE, char);
+ if (text) C_KILL(head->text_ptr, FAKE_TEXT_SIZE, char);
#endif /* ALLOW_TEMPLATES */