summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bldg.cc2
-rw-r--r--src/externs.h2
-rw-r--r--src/init1.cc26
-rw-r--r--src/init2.cc13
-rw-r--r--src/types.h2
-rw-r--r--src/variable.cc3
6 files changed, 7 insertions, 41 deletions
diff --git a/src/bldg.cc b/src/bldg.cc
index f77efa4c..ac9ab5e6 100644
--- a/src/bldg.cc
+++ b/src/bldg.cc
@@ -178,7 +178,7 @@ void show_building(store_type *s_ptr)
strnfmt(tmp_str, 80, " %c", ba_ptr->letter);
c_put_str(TERM_YELLOW, tmp_str, 21 + (i / 2), 17 + (30 * (i % 2)));
- strnfmt(tmp_str, 80, ") %s %s", ba_ptr->name + ba_name, buff);
+ strnfmt(tmp_str, 80, ") %s %s", ba_ptr->name, buff);
c_put_str(action_color, tmp_str, 21 + (i / 2), 2 + 17 + (30 * (i % 2)));
}
}
diff --git a/src/externs.h b/src/externs.h
index 84005c4b..40bb2cc3 100644
--- a/src/externs.h
+++ b/src/externs.h
@@ -335,9 +335,7 @@ extern trap_type *t_info;
extern wilderness_type_info *wf_info;
extern int wildc2i[256];
extern store_info_type *st_info;
-extern header *ba_head;
extern store_action_type *ba_info;
-extern char *ba_name;
extern header *ow_head;
extern owner_type *ow_info;
extern char *ow_name;
diff --git a/src/init1.cc b/src/init1.cc
index 31d56fed..8ce1524a 100644
--- a/src/init1.cc
+++ b/src/init1.cc
@@ -9595,11 +9595,6 @@ errr init_ba_info_txt(FILE *fp, char *buf)
/* Just before the first line */
error_line = -1;
-
- /* Start the "fake" stuff */
- ba_head->name_size = 0;
- ba_head->text_size = 0;
-
/* Parse */
fp_stack_init(fp);
while (0 == my_fgets_dostack(buf, 1024))
@@ -9661,7 +9656,7 @@ errr init_ba_info_txt(FILE *fp, char *buf)
if (i < error_idx) return (4);
/* Verify information */
- if (i >= ba_head->info_num) return (2);
+ if (i >= max_ba_idx) return (2);
/* Save the index */
error_idx = i;
@@ -9669,17 +9664,9 @@ errr init_ba_info_txt(FILE *fp, char *buf)
/* Point at the "info" */
ba_ptr = &ba_info[i];
- /* Hack -- Verify space */
- if (ba_head->name_size + strlen(s) + 8 > FAKE_NAME_SIZE) return (7);
-
- /* Advance and Save the name index */
- if (!ba_ptr->name) ba_ptr->name = ++ba_head->name_size;
-
- /* Append chars to the name */
- strcpy(ba_name + ba_head->name_size, s);
-
- /* Advance the index */
- ba_head->name_size += strlen(s);
+ /* Copy name */
+ assert(!ba_ptr->name);
+ ba_ptr->name = my_strdup(s);
/* Next... */
continue;
@@ -9731,11 +9718,6 @@ errr init_ba_info_txt(FILE *fp, char *buf)
return (6);
}
-
- /* Complete the "name" and "text" sizes */
- ++ba_head->name_size;
- ++ba_head->text_size;
-
/* No version yet */
if (!okay) return (2);
diff --git a/src/init2.cc b/src/init2.cc
index fd529c07..6dd866d5 100644
--- a/src/init2.cc
+++ b/src/init2.cc
@@ -1141,19 +1141,8 @@ static errr init_ba_info(void)
/* General buffer */
char buf[1024];
-
- /*** Make the header ***/
- ba_head = make_header(max_ba_idx);
-
-
- /*** Make the fake arrays ***/
-
/* Allocate the "ba_info" array */
- ba_info = make_array<store_action_type>(ba_head->info_num);
-
- /* Hack -- make "fake" arrays */
- ba_name = make_array<char>(FAKE_NAME_SIZE);
-
+ ba_info = make_array<store_action_type>(max_ba_idx);
/*** Load the ascii template file ***/
diff --git a/src/types.h b/src/types.h
index 6dd27a44..472c481f 100644
--- a/src/types.h
+++ b/src/types.h
@@ -1002,7 +1002,7 @@ typedef struct store_action_type store_action_type;
struct store_action_type
{
- u32b name; /* Name (offset) */
+ const char *name; /* Name */
s16b costs[3]; /* Costs for liked people */
char letter; /* Action letter */
diff --git a/src/variable.cc b/src/variable.cc
index 3fdb6f03..b6fe3edb 100644
--- a/src/variable.cc
+++ b/src/variable.cc
@@ -690,10 +690,7 @@ store_info_type *st_info;
/*
* The building actions types arrays
*/
-header *ba_head;
store_action_type *ba_info;
-char *ba_name;
-/* char *ba_text; */
/*
* The owner types arrays