From b74a05e858d189010722e0871aaf61f54ba7d79a Mon Sep 17 00:00:00 2001
From: SFGrenade <25555417+SFGrenade@users.noreply.github.com>
Date: Sun, 13 Oct 2024 12:11:39 +0200
Subject: [PATCH] save fsm state actions before copying the state bump version
number
---
Core_FsmUtil.csproj | 2 +-
src/FsmUtil.cs | 5 ++++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/Core_FsmUtil.csproj b/Core_FsmUtil.csproj
index 62502f9..246b5e7 100644
--- a/Core_FsmUtil.csproj
+++ b/Core_FsmUtil.csproj
@@ -7,7 +7,7 @@
Core_FsmUtil
A Hollow Knight Mod
Copyright © HK Modding 2023
- 1.1.1.1
+ 1.1.1.2
$(AssemblyVersion)
false
true
diff --git a/src/FsmUtil.cs b/src/FsmUtil.cs
index ff5cc73..2bd562c 100644
--- a/src/FsmUtil.cs
+++ b/src/FsmUtil.cs
@@ -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
};