summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game_edit_data.hpp5
-rw-r--r--src/init1.cc3
-rw-r--r--src/init2.cc2
-rw-r--r--src/skills.cc5
-rw-r--r--src/variable.cc5
-rw-r--r--src/variable.hpp1
6 files changed, 12 insertions, 9 deletions
diff --git a/src/game_edit_data.hpp b/src/game_edit_data.hpp
index 9370b7d4..bfb2e418 100644
--- a/src/game_edit_data.hpp
+++ b/src/game_edit_data.hpp
@@ -64,4 +64,9 @@ struct GameEditData {
*/
std::vector<hist_type> bg;
+ /**
+ * Base skills for all characters.
+ */
+ skill_modifiers gen_skill;
+
};
diff --git a/src/init1.cc b/src/init1.cc
index f6d798a9..afd256a4 100644
--- a/src/init1.cc
+++ b/src/init1.cc
@@ -923,6 +923,7 @@ errr init_player_info_txt(FILE *fp)
auto &race_info = game->edit_data.race_info;
auto &race_mod_info = game->edit_data.race_mod_info;
auto &bg = game->edit_data.bg;
+ auto &gen_skill = game->edit_data.gen_skill;
int lev = 1;
int tit_idx = 0;
@@ -986,7 +987,7 @@ errr init_player_info_txt(FILE *fp)
/* Process 'G:k' for "General skills" */
if ((buf[0] == 'G') && (buf[2] == 'k'))
{
- if (read_skill_modifiers(gen_skill, buf + 4))
+ if (read_skill_modifiers(&gen_skill, buf + 4))
{
return 1;
}
diff --git a/src/init2.cc b/src/init2.cc
index be69192f..f48cc44c 100644
--- a/src/init2.cc
+++ b/src/init2.cc
@@ -550,7 +550,7 @@ namespace {
static void allocate()
{
- gen_skill = new skill_modifiers;
+ // Nothing to do
}
static errr parse(FILE *fp)
diff --git a/src/skills.cc b/src/skills.cc
index b97e80a8..a1f9f793 100644
--- a/src/skills.cc
+++ b/src/skills.cc
@@ -14,6 +14,7 @@
#include "cmd3.hpp"
#include "cmd5.hpp"
#include "cmd7.hpp"
+#include "game.hpp"
#include "gods.hpp"
#include "help.hpp"
#include "hooks.hpp"
@@ -1198,7 +1199,9 @@ static void augment_skills(s32b *v, s32b *m, skill_modifier const &s)
*/
void compute_skills(s32b *v, s32b *m, int i)
{
- augment_skills(v, m, gen_skill->modifiers[i]);
+ auto const &gen_skill = game->edit_data.gen_skill;
+
+ augment_skills(v, m, gen_skill.modifiers[i]);
augment_skills(v, m, rp_ptr->skill_modifiers.modifiers[i]);
augment_skills(v, m, rmp_ptr->skill_modifiers.modifiers[i]);
augment_skills(v, m, cp_ptr->skill_modifiers.modifiers[i]);
diff --git a/src/variable.cc b/src/variable.cc
index 272d9267..b1a8c674 100644
--- a/src/variable.cc
+++ b/src/variable.cc
@@ -787,11 +787,6 @@ s32b project_time_effect = 0;
effect_type effects[MAX_EFFECTS];
/*
- * General skills set
- */
-skill_modifiers *gen_skill;
-
-/*
* Table of "cli" macros.
*/
cli_comm *cli_info;
diff --git a/src/variable.hpp b/src/variable.hpp
index 9b1e4816..4f00f1da 100644
--- a/src/variable.hpp
+++ b/src/variable.hpp
@@ -229,7 +229,6 @@ extern school_type schools[SCHOOLS_MAX];
extern int project_time;
extern s32b project_time_effect;
extern effect_type effects[MAX_EFFECTS];
-extern skill_modifiers *gen_skill;
extern bool_ automatizer_enabled;
extern s16b last_teleportation_y;
extern s16b last_teleportation_x;