From d33961f89a0c80f2fae4020184e72467b5c192cf Mon Sep 17 00:00:00 2001 From: Bardur Arantsson Date: Wed, 5 Oct 2016 18:45:08 +0200 Subject: Move race_info and race_mod_info to GameEditData --- src/xtra2.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/xtra2.cc') diff --git a/src/xtra2.cc b/src/xtra2.cc index 5ed06491..040299ff 100644 --- a/src/xtra2.cc +++ b/src/xtra2.cc @@ -5288,9 +5288,11 @@ static void corrupt_corrupted(void) /* * Change to an other subrace */ -void switch_subrace(int racem, bool_ copy_old) +void switch_subrace(std::size_t racem, bool_ copy_old) { - if ((racem < 0) && (racem >= max_rmp_idx)) return; + auto &race_mod_info = game->edit_data.race_mod_info; + + assert(racem < race_mod_info.size()); /* If we switch to the saved subrace, we copy over the old subrace data */ if (copy_old && (racem == SUBRACE_SAVE)) -- cgit v1.2.3