diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2015-01-06 17:31:21 -0800 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2015-01-22 23:33:13 -0800 |
commit | 2cd52ab17ee1b830bc53321b112411122dddc1c8 (patch) | |
tree | 43666d3295c55ae6b395c5d8cd3fd026e71468a3 /src/char/inter.cpp | |
parent | e1418f378c66343a35db3791cbf0d54a4be3fbd3 (diff) | |
download | tmwa-2cd52ab17ee1b830bc53321b112411122dddc1c8.tar.gz tmwa-2cd52ab17ee1b830bc53321b112411122dddc1c8.tar.bz2 tmwa-2cd52ab17ee1b830bc53321b112411122dddc1c8.tar.xz tmwa-2cd52ab17ee1b830bc53321b112411122dddc1c8.zip |
Use Spanned<T> while parsing config
Diffstat (limited to 'src/char/inter.cpp')
-rw-r--r-- | src/char/inter.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/char/inter.cpp b/src/char/inter.cpp index 4b10dbc..df05434 100644 --- a/src/char/inter.cpp +++ b/src/char/inter.cpp @@ -37,8 +37,11 @@ #include "../io/extract.hpp" #include "../io/lock.hpp" #include "../io/read.hpp" +#include "../io/span.hpp" #include "../io/write.hpp" +#include "../mmo/config_parse.hpp" + #include "../proto2/char-map.hpp" #include "../high/extract_mmo.hpp" @@ -157,24 +160,24 @@ int inter_accreg_save(void) return 0; } -bool inter_config(XString w1, ZString w2) +bool inter_config(io::Spanned<XString> w1, io::Spanned<ZString> w2) { { - if (w1 == "storage_txt"_s) + if (w1.data == "storage_txt"_s) { - storage_txt = w2; + storage_txt = w2.data; } - else if (w1 == "party_txt"_s) + else if (w1.data == "party_txt"_s) { - party_txt = w2; + party_txt = w2.data; } - else if (w1 == "accreg_txt"_s) + else if (w1.data == "accreg_txt"_s) { - accreg_txt = w2; + accreg_txt = w2.data; } - else if (w1 == "party_share_level"_s) + else if (w1.data == "party_share_level"_s) { - party_share_level = atoi(w2.c_str()); + party_share_level = atoi(w2.data.c_str()); if (party_share_level < 0) party_share_level = 0; } |