mirror of
https://github.com/electronicarts/CNC_TS_and_RA2_Mission_Editor.git
synced 2025-05-05 03:01:42 -04:00
fixed a possible bug causing by refactor .
This commit is contained in:
parent
8c2f8a6a4e
commit
4d9acfd447
1 changed files with 5 additions and 4 deletions
|
@ -204,15 +204,16 @@ void CTriggerEditorDlg::OnDeletetrigger()
|
|||
auto const& triggerId = ini["Triggers"].Nth(curtrig).first;
|
||||
|
||||
if (res == IDYES) {
|
||||
CString keyToDelete;
|
||||
std::vector<CString> keysToDelete;
|
||||
for (auto const& [type, def] : ini["Tags"]) {
|
||||
auto const attTrigg = GetParam(def, 2);
|
||||
if (triggerId == attTrigg) {
|
||||
keyToDelete = type;
|
||||
break;
|
||||
keysToDelete.push_back(type);
|
||||
}
|
||||
}
|
||||
ini.RemoveValueByKey("Tags", keyToDelete);
|
||||
for (auto const& keyToDelete : keysToDelete) {
|
||||
ini.RemoveValueByKey("Tags", keyToDelete);
|
||||
}
|
||||
}
|
||||
|
||||
ini.RemoveValueByKey("Triggers", triggerId);
|
||||
|
|
Loading…
Add table
Reference in a new issue