Skip to content

Commit

Permalink
save fsm state actions before copying the state
Browse files Browse the repository at this point in the history
bump version number
  • Loading branch information
SFGrenade committed Oct 13, 2024
1 parent ce3ac7e commit b74a05e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Core_FsmUtil.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<AssemblyTitle>Core_FsmUtil</AssemblyTitle>
<Description>A Hollow Knight Mod</Description>
<Copyright>Copyright © HK Modding 2023</Copyright>
<AssemblyVersion>1.1.1.1</AssemblyVersion>
<AssemblyVersion>1.1.1.2</AssemblyVersion>
<FileVersion>$(AssemblyVersion)</FileVersion>
<ImplicitUsings>false</ImplicitUsings>
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
Expand Down
5 changes: 4 additions & 1 deletion src/FsmUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,10 @@ public static FsmState AddFsmState(this PlayMakerFSM fsm, FsmState state)
[PublicAPI]
public static FsmState CopyFsmState(this PlayMakerFSM fsm, string fromState, string toState)
{
FsmState copy = new FsmState(fsm.GetFsmState(fromState))
FsmState from = fsm.GetFsmState(fromState);
// save the actions before we create a new state from this, as the copy constructor will create the new actions from the saved action data from the state we put in, and that is only updated if we call .SaveActions()
from.SaveActions();
FsmState copy = new FsmState(from)
{
Name = toState
};
Expand Down

0 comments on commit b74a05e

Please sign in to comment.