Orvid / Champollion

A PEX to Papyrus Decompiler for Skyrim, Fallout 4 and Starfield
GNU Lesser General Public License v3.0
107 stars 20 forks source link

Starfield decompile error with script compiled with Caprica #29

Open ForsakenShell opened 11 months ago

ForsakenShell commented 11 months ago

Script compiled with Caprica v0.3.0 Papryrus VM error: warning: Assigning None to a non-object variable named "::temp1" Attempted decompiled with Champollion v1.3.2 but got error Orphaned nodes in GetActionControl from instruction 14 to 14

Line (568) in question from the script is: lkItem.Activate( akLooter, False )

Not sure what other information I can provide.

Attached zip contains the script (source and compiled). LootFunctions.zip

leppie commented 10 months ago

It seems to be related to using an if after there was a nested if.

Here are 2 small repro's

ScriptName Test Extends ScriptObject

Function Test(Int i)
    if i == 0
        if i != 1
          i = 2
        endif
    endif
    if i == 4
    endif    
EndFunction

Function Test2(Int i)
    if i == 0
        if i != 1
          i = 2
        endif
    else
       if i == 4
       endif
    endif    
EndFunction

You will also note some weird decompiling for the nested if if you remove the following if.