Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
* do not show names of dummy objects
* fix localized string loading, to fix a bug that some objects are not shown
* fix a bug that some guide-line config entries are not correctly read
  • Loading branch information
soarqin committed May 10, 2022
1 parent e53001d commit f474d0b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bin/D2RMH.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[main]
; path to your Diablo II LOD v1.13c.
; path to your Diablo II LOD.
; if not found in this path, D2RMH will fallback to read installation path from registry.
d2_path = .
; font settings, you can:
Expand Down
2 changes: 1 addition & 1 deletion contrib/zhCN/D2RMH.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[main]
; D2LOD v1.13c路径
; D2LOD 路径
; 如果该路径不包含游戏,则D2RMH会尝试从注册表读取安装目录
d2_path = .
; 字体路径
Expand Down
5 changes: 5 additions & 0 deletions doc/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# v0.10.2
* do not show names of dummy objects
* fix localized string loading, to fix a bug that some objects are not shown
* fix a bug that some guide-line config entries are not correctly read

# v0.10.1
* fix map display after party window opened in multiplayer games

Expand Down
12 changes: 8 additions & 4 deletions src/data/gamedata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@ inline void loadTxt(D2TXT &txt, d2r::Storage &storage, const char *filename) {

template<typename T>
inline Data::LngString *moveStrings(std::unordered_map<T, Data::LngString> &to, std::unordered_map<T, Data::LngString> &from, const T &key) {
auto dstIte = to.find(key);
if (dstIte != to.end()) {
return &dstIte->second;
}
auto ite = from.find(key);
if (ite == from.end()) {
return nullptr;
Expand Down Expand Up @@ -286,9 +290,9 @@ inline void loadD2RData() {
loadJsonLng(names, d2r::storage, "data:data/local/lng/strings/shrines.json");
loadJsonLng(names, d2r::storage, "data:data/local/lng/strings/ui.json");
loadJsonLngById(mercNames, d2r::storage, "data:data/local/lng/strings/mercenaries.json");
sgamedata.strings.erase("dummy");
sgamedata.strings.erase("Dummy");
sgamedata.strings.erase("unused");
names.erase("dummy");
names.erase("Dummy");
names.erase("unused");

D2TXT levelTxt, objTxt, monTxt, shrineTxt, superuTxt;
D2TXT itemTxt[3];
Expand Down Expand Up @@ -464,7 +468,7 @@ inline void loadD2RData() {
} else if (s[0] == '+') {
sgamedata.guides[id].insert(0x10000 | strtoul(s.data() + 1, nullptr, 0));
} else if (s[0] >= '0' && s[0] <= '9'){
sgamedata.guides[id].insert(strtoul(s.data() + 1, nullptr, 0));
sgamedata.guides[id].insert(strtoul(s.data(), nullptr, 0));
}
auto ite2 = levelIdByName.find(util::utf8toucs4(s));
if (ite2 == levelIdByName.end()) {
Expand Down

0 comments on commit f474d0b

Please sign in to comment.