From 52bfa8321be6801ffded21147d4bb5c854e5440d Mon Sep 17 00:00:00 2001 From: Zero Fanker Date: Tue, 1 Oct 2024 22:39:05 -0400 Subject: [PATCH] fixed Ini editor 'add key' logic flaw . --- MissionEditor/All.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/MissionEditor/All.cpp b/MissionEditor/All.cpp index 8797e03..7a682a7 100644 --- a/MissionEditor/All.cpp +++ b/MissionEditor/All.cpp @@ -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);