Skip to content

Commit

Permalink
support debug scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
maybegreat48 committed Oct 4, 2024
1 parent f4139cc commit 34bd80e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion GTA V Script Decompiler/Function.cs
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ private void HandleSwitch(Ast.StatementTree.Tree tree)
/// </summary>
public void BuildInstructions()
{
Offset = CodeBlock[4];
Offset = 0;
Instructions = new List<Instruction>();
InstructionMap = new Dictionary<int, int>();
int curoff;
Expand Down
7 changes: 6 additions & 1 deletion GTA V Script Decompiler/ScriptFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,14 @@ private void AddFunction(int start1, int start2)
{
for (var i = 0; i < namelen; i++)
{
name += (char)CodeTable[start1 + 5 + i];
var chr = (char)CodeTable[start1 + 5 + i];
if (chr != '\0')
name += chr;
}

if (name.StartsWith("__", StringComparison.Ordinal))
name = name.TrimStart('_');

foreach (var fun in Functions)
if (fun.Name == name)
name += "_0";
Expand Down

0 comments on commit 34bd80e

Please sign in to comment.