Skip to content

Commit 607f286

Browse files
committed
Fix an issue where the specified array dim (e.g. local string a, b[6];) of a local variable could go missing if it is merged with another local variable of the same type.
(cherry picked from commit 69b9b68f9f51b87b8a13ea215484b523b5cb5e01) # Conflicts: # src/Core/Classes/Props/UPropertyDecompiler.cs
1 parent 257be81 commit 607f286

2 files changed

Lines changed: 19 additions & 6 deletions

File tree

src/Core/Classes/Props/UPropertyDecompiler.cs

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,24 @@ public virtual string PreDecompile()
1818

1919
public override string Decompile()
2020
{
21-
return FormatFlags() + GetFriendlyType()
22-
+ " " + Name
23-
+ FormatSize()
24-
+ DecompileEditorData()
25-
+ DecompileMeta();
21+
// Decompile without the declaring keyword, as the caller will handle that.
22+
return FormatDeclaration();
23+
}
24+
25+
private string FormatDeclaration()
26+
{
27+
return FormatFlags()
28+
+ GetFriendlyType()
29+
+ " "
30+
+ FormatVariable();
31+
}
32+
33+
internal string FormatVariable()
34+
{
35+
return Name
36+
+ FormatSize()
37+
+ DecompileEditorData()
38+
+ DecompileMeta();
2639
}
2740

2841
// Post semicolon ";".

src/Core/Classes/UStructDecompiler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ protected string FormatLocals()
317317
// If previous is the same as the one now then format the params as one line until another type is reached
318318
if (curType == lastType)
319319
{
320-
output += locals[i].Name +
320+
output += locals[i].FormatVariable() +
321321
(
322322
curType == nextType
323323
? ((numParms >= 5 && numParms % 5 == 0)

0 commit comments

Comments
 (0)