mirror of
https://github.com/electronicarts/CNC_TS_and_RA2_Mission_Editor.git
synced 2025-04-30 09:01:41 -04:00
fixed Ini editor 'add key' logic flaw .
This commit is contained in:
parent
c22a01e56d
commit
52bfa8321b
1 changed files with 7 additions and 0 deletions
|
@ -246,12 +246,19 @@ void CAll::OnAddkey()
|
|||
CString key, value;
|
||||
key = InputBox("Please set the name and value for the current key here: (for example, setting a new key ""Strength"" with the value 200 can be written as ""Strength=200"". You don´t need to specify a value.)", "Create key");
|
||||
|
||||
if (key.IsEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
CString value;
|
||||
if (key.Find("=") != -1) {
|
||||
// value specified
|
||||
// MW BUGFIX
|
||||
value = key.Right(key.GetLength() - key.Find("=") - 1);
|
||||
key = key.Left(key.Find("="));
|
||||
}
|
||||
key.Trim();
|
||||
value.Trim();
|
||||
|
||||
ini.SetString(sec, key, value);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue