mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-03 14:59:23 +00:00
[CVRLuaToolsExtension] kinda fix
This commit is contained in:
parent
e85c1e2f25
commit
0f6006db83
1 changed files with 5 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
||||||
using ABI.CCK.Components;
|
using ABI.CCK.Components;
|
||||||
using ABI.Scripting.CVRSTL.Client;
|
using ABI.Scripting.CVRSTL.Client;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
using ABI_RC.Scripting.Persistence;
|
||||||
using MTJobSystem;
|
using MTJobSystem;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
|
@ -108,8 +109,11 @@ public static class CVRLuaClientBehaviourExtensions
|
||||||
behaviour._startupMessageQueue.Clear(); // will be repopulated
|
behaviour._startupMessageQueue.Clear(); // will be repopulated
|
||||||
behaviour.LogInfo("[CVRLuaToolsExtension] Resetting script...\n");
|
behaviour.LogInfo("[CVRLuaToolsExtension] Resetting script...\n");
|
||||||
|
|
||||||
|
// remove the script from the persistence manager, as the storage needs to be reinitialized
|
||||||
|
PersistenceManager.HandleUnsubscribe(behaviour.Storage, behaviour.script, behaviour.Context.ParentContent.ContentType, behaviour.Context.AssetID);
|
||||||
|
|
||||||
behaviour.script = null;
|
behaviour.script = null;
|
||||||
behaviour.script = LuaScriptFactory.ForLuaBehaviour(behaviour, boundObjectEntries, behaviour.gameObject, behaviour.transform, PersistentDataPath);
|
behaviour.script = LuaScriptFactory.ForLuaBehaviour(behaviour, boundObjectEntries, behaviour.gameObject, behaviour.transform);
|
||||||
|
|
||||||
behaviour.InitTimerIfNeeded(); // only null if crashed prior
|
behaviour.InitTimerIfNeeded(); // only null if crashed prior
|
||||||
behaviour.script.AttachDebugger(behaviour.timer); // reattach the debugger
|
behaviour.script.AttachDebugger(behaviour.timer); // reattach the debugger
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue