mirror of
https://github.com/electronicarts/CNC_TS_and_RA2_Mission_Editor.git
synced 2025-07-17 19:56:38 -04:00
Fix: trigger deletion causing mismatched event & action deleted (#114)
* used copied 'triggerId' instead of reference, because it will be deleted and becomes invalid .
This commit is contained in:
parent
11c93c3b3b
commit
f7e3d96881
8 changed files with 15 additions and 1635 deletions
|
@ -220,11 +220,13 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
void RemoveByKey(const CString& key) {
|
||||
bool RemoveByKey(const CString& key) {
|
||||
auto const idx = this->FindIndex(key);
|
||||
if (idx >= 0) {
|
||||
RemoveAt(idx);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void RemoveValue(const CString& val) {
|
||||
|
@ -384,10 +386,11 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
void RemoveValueByKey(const CString& section, const CString& key) {
|
||||
bool RemoveValueByKey(const CString& section, const CString& key) {
|
||||
if (auto pSec = this->TryGetSection(section)) {
|
||||
pSec->RemoveByKey(key);
|
||||
return pSec->RemoveByKey(key);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// ================= Iterator Related =============================
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue