fix implicit ptext length conversion

This commit is contained in:
Martin Michelsen
2023-01-08 09:01:14 -08:00
parent 8c5160e36f
commit d076838747
2 changed files with 6 additions and 1 deletions
+1 -1
View File
@@ -1241,7 +1241,7 @@ static HandlerResult S_65_67_68(shared_ptr<ServerState>,
}
auto& p = session.lobby_players[index];
p.guild_card_number = cmd.entries[x].lobby_data.guild_card;
ptext<char, 0x10> name = cmd.entries[x].disp.name;
string name = encode_sjis(cmd.entries[x].disp.name);
p.name = name;
p.section_id = cmd.entries[x].disp.section_id;
p.char_class = cmd.entries[x].disp.char_class;
+5
View File
@@ -39,6 +39,11 @@ inline std::u16string decode_sjis(const std::string& s) {
return decode_sjis(s.data(), s.size());
}
// These functions exist so that decode_sjis and encode_sjis can be
// indiscriminately used within templates that use different char types.
inline const std::string& encode_sjis(const std::string& s) { return s; }
inline const std::u16string& decode_sjis(const std::u16string& s) { return s; }
// (1b) Type-independent utility functions
template <typename T>