Find and Replace Mode: fixed a bug where searching for linedef or thing action and arguments would not show "0" as an argument if it was the last arguments. Fixes 528

This commit is contained in:
biwa 2021-02-20 12:29:35 +01:00
parent cbedfb24b5
commit 467f791bd3
2 changed files with 15 additions and 9 deletions

View file

@ -218,12 +218,15 @@ namespace CodeImp.DoomBuilder.BuilderModes
else
{
List<string> argslist = new List<string>();
// Process args, drop trailing zeroes
for(int i = l.Args.Length - 1; i > -1; i--)
LinedefActionInfo info = General.Map.Config.GetLinedefActionInfo(l.Action);
// Process args
for (int i = l.Args.Length - 1; i >= 0; i--)
{
if(l.Args[i] == 0 && argslist.Count == 0) continue; // Skip tail zeroes
argslist.Insert(0, l.Args[i].ToString());
if (info.Args[i].Used)
argslist.Insert(0, l.Args[i].ToString());
else if(argslist.Count != 0) // Show unused args as "-" if they are not at the last args
argslist.Insert(0, "-");
}
// Process arg0str...

View file

@ -220,12 +220,15 @@ namespace CodeImp.DoomBuilder.BuilderModes
else
{
List<string> argslist = new List<string>();
LinedefActionInfo info = General.Map.Config.GetLinedefActionInfo(t.Action);
// Process args, drop trailing zeroes
for(int i = t.Args.Length - 1; i > -1; i--)
// Process args
for (int i = t.Args.Length - 1; i >= 0; i--)
{
if(t.Args[i] == 0 && argslist.Count == 0) continue; // Skip tail zeroes
argslist.Insert(0, t.Args[i].ToString());
if (info.Args[i].Used)
argslist.Insert(0, t.Args[i].ToString());
else if (argslist.Count != 0) // Show unused args as "-" if they are not at the last args
argslist.Insert(0, "-");
}
// Process arg0str...