rewrite text encoding to handle non-English properly

This commit is contained in:
Martin Michelsen
2023-10-24 12:02:22 -07:00
parent 6b97c628ef
commit 0c53a0dc41
65 changed files with 2483 additions and 2731 deletions
+9 -5
View File
@@ -166,10 +166,12 @@ ssize_t Card::apply_abnormal_condition(
cond.value8 = value + existing_cond_value;
cond.random_percent = random_percent;
switch (eff.arg1[0]) {
case 'a':
cond.a_arg_value = atoi(&eff.arg1[1]);
switch (eff.arg1.at(0)) {
case 'a': {
string s = eff.arg1.decode();
cond.a_arg_value = atoi(s.c_str() + 1);
break;
}
case 'e':
cond.remaining_turns = 99;
break;
@@ -179,8 +181,10 @@ ssize_t Card::apply_abnormal_condition(
case 'r':
cond.remaining_turns = 102;
break;
case 't':
cond.remaining_turns = atoi(&eff.arg1[1]);
case 't': {
string s = eff.arg1.decode();
cond.remaining_turns = atoi(s.c_str() + 1);
}
}
string cond_str = cond.str();