papyrus-lang
papyrus-lang copied to clipboard
Refactoring with "Rename Symbol" doesnt work as intended with states or inheritance.
Describe the bug Refactoring of functions and events with "Rename Symbol" doesnt work as intended with states or inheritance.
To Reproduce
In this example, all Foobar()
functions should have changed.
Scriptname ChildType extends BaseType
Event OnQuestInit()
Foobar(true)
Debug.TraceSelf(self, "OnQuestInit", "Player:" + Player)
EndEvent
var Function Foobar(var argument)
return "Child"
EndFunction
State DerpState
var Function Foobar(var argument)
return "Child Derp"
EndFunction
EndState
ScriptName BaseType extends Quest Native Const Hidden
Actor Property Player Auto Const Mandatory
var Function Foobar(var argument)
return "Base"
EndFunction
State DerpState
var Function Foobar(var argument)
return "Base Derp"
EndFunction
EndState
I just noticed that my BaseType
is not valid to compile. Auto properties and variables are not allowed on Native flagged scripts. I was moving things around to test refactoring and didnt compile in this case.
This doesnt affect the issue at hand though I bring it up in case you try to test the sample code. Just move the property into ChildType
to correct this. This comment can otherwise be ignored.