fixed terrain list item skipped issue, caused by refine .

This commit is contained in:
Zero Fanker 2024-04-16 22:35:16 -04:00
parent d45137f942
commit 52151f6ce5
2 changed files with 23 additions and 6 deletions

View file

@ -3057,7 +3057,7 @@ void CLoading::InitTMPs(CProgressCtrl* prog)
bMorph = TRUE;
}
if (!pSec->GetBool("AllowToPlace")) {
if (!pSec->GetBool("AllowToPlace", true)) {
bPlace = FALSE;
}

View file

@ -156,8 +156,8 @@ void CTerrainDlg::Update()
string += TranslateStringACP(pSec->GetString("SetName"));
string += ")";
BOOL bForced = FALSE;
BOOL bForcedNot = FALSE;
bool bForced = false;
bool bIgnore = false;
// force yes
@ -165,16 +165,33 @@ void CTerrainDlg::Update()
auto tsetc = CString(std::to_string(atoi(tset)).c_str());
if (g_data["UseSet" + theaterType].HasValue(tsetc)) {
bForced = TRUE;
bForced = true;
}
// force no
if (g_data["IgnoreSet" + theaterType].HasValue(tsetc)) {
bForcedNot = TRUE;
bIgnore = true;
}
auto legal = false;
do {
if (bForced) {
legal = true;
break;
}
if (bIgnore) {
break;
}
auto const& tile = (*tiledata)[tilecount];
if (tile.bMarbleMadness) {
break;
}
if (tile.bAllowToPlace) {
legal = true;
}
} while (0);
if (bForced || (!bForcedNot && (*tiledata)[tilecount].bAllowToPlace && !(*tiledata)[tilecount].bMarbleMadness)) {
if (legal) {
TileSet->SetItemData(TileSet->AddString(string), i);
}