This commit is contained in:
aozhiwei 2022-05-26 09:33:35 +08:00
commit 39a0fa64ce
3 changed files with 6 additions and 2 deletions

3
.gitignore vendored
View File

@ -20,4 +20,5 @@ __pycache__
.user .user
game.py game.py
*.cxx *.cxx
compile_commands.json compile_commands.json
*.DS_Store

BIN
res/imserver/en/text.xlsx Normal file

Binary file not shown.

View File

@ -181,5 +181,8 @@ std::string MetaMgr::ReplaceDirtyWord(const std::string& text, char c)
std::string MetaMgr::GetText(const std::string& textid, const std::string& def_text) std::string MetaMgr::GetText(const std::string& textid, const std::string& def_text)
{ {
auto itr = loader_->text_hash.find(textid); auto itr = loader_->text_hash.find(textid);
return itr != loader_->text_hash.end() ? itr->second : def_text; if (itr != loader_->text_hash.end()) {
return itr->second;
}
return loader_->text_hash.empty() ? def_text : "";
} }