Skip to content

Commit

Permalink
Fix bug with newlines in Briefing
Browse files Browse the repository at this point in the history
  • Loading branch information
jkoncick committed Oct 16, 2015
1 parent 6fab847 commit 5854334
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions mission_dialog.pas
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,8 @@ procedure TMissionDialog.load_ini_fields;
tmp_strings[i] := StringReplace(tmp_strings[i],'^',' ',[rfReplaceAll]);
end;
MapBriefing.Lines := tmp_strings;
// Remove additional trailing newline from the Memo
MapBriefing.Text := Copy(MapBriefing.Text, 1, Length(MapBriefing.Text) - 2);
tmp_strings.Destroy;
// Load event/condition notes
Mission.load_notes_from_ini(ini);
Expand Down Expand Up @@ -448,12 +450,7 @@ procedure TMissionDialog.save_ini_fields(map_filename: String);
if MapBriefing.Lines.Count = 0 then
ini.DeleteKey('Basic','Briefing')
else begin
for i := 0 to MapBriefing.Lines.Count - 1 do
begin
if i > 0 then
tmp_string := tmp_string + '_';
tmp_string := tmp_string + MapBriefing.Lines[i];
end;
tmp_string := StringReplace(MapBriefing.Text,chr(13)+chr(10),'_',[rfReplaceAll]);
ini.WriteString('Basic','Briefing',tmp_string);
end;
// Save event/condition notes
Expand Down

0 comments on commit 5854334

Please sign in to comment.