diff options
author | Bardur Arantsson <bardur@scientician.net> | 2016-09-17 09:58:13 +0200 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2016-09-17 09:58:13 +0200 |
commit | 1f861bb683f70856787b100219fd40ff31be12b8 (patch) | |
tree | 1ed334f14ba6dc9bee69ce7b227e7e548248ddc0 /src/init1.cc | |
parent | cb9fde0cde82d4122c8bd9836309720294dee77f (diff) |
Rework store_info_type::actions into a std::vector<>
Diffstat (limited to 'src/init1.cc')
-rw-r--r-- | src/init1.cc | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/init1.cc b/src/init1.cc index 3dec9b6e..1d04509b 100644 --- a/src/init1.cc +++ b/src/init1.cc @@ -5870,12 +5870,18 @@ errr init_st_info_txt(FILE *fp) &a1, &a2, &a3, &a4, &a5, &a6)) return (1); /* Save the values */ - st_ptr->actions[0] = a1; - st_ptr->actions[1] = a2; - st_ptr->actions[2] = a3; - st_ptr->actions[3] = a4; - st_ptr->actions[4] = a5; - st_ptr->actions[5] = a6; + st_ptr->actions.push_back(a1); + st_ptr->actions.push_back(a2); + st_ptr->actions.push_back(a3); + st_ptr->actions.push_back(a4); + st_ptr->actions.push_back(a5); + st_ptr->actions.push_back(a6); + + /* Remove zero entries since they have no effect */ + st_ptr->actions.erase( + std::remove(st_ptr->actions.begin(), st_ptr->actions.end(), 0), + st_ptr->actions.end() + ); /* Next... */ continue; |