diff --git a/JotunnModStub/Furling/FurlingRace.cs b/JotunnModStub/Furling/FurlingRace.cs index bf33e7e..da3c59d 100644 --- a/JotunnModStub/Furling/FurlingRace.cs +++ b/JotunnModStub/Furling/FurlingRace.cs @@ -8,6 +8,21 @@ namespace RacesOfValheim public class FurlingRace : MonoBehaviour { private static FurlingRace _instance; + + // The plugin adds this component itself, so Instance must find that copy rather than build + // a second one on first read. Same fault as TrolRace's, where two Updates reading one key + // switched the True Form off as it came on; here the only per-frame work is idempotent, so + // it had no visible effect, but two copies of a race component is never intended. + private void Awake() + { + if (_instance != null && _instance != this) + { + Destroy(this); + return; + } + _instance = this; + } + public static FurlingRace Instance { get diff --git a/JotunnModStub/Trol/TrolRace.cs b/JotunnModStub/Trol/TrolRace.cs index 591ca5b..e1894ec 100644 --- a/JotunnModStub/Trol/TrolRace.cs +++ b/JotunnModStub/Trol/TrolRace.cs @@ -10,6 +10,24 @@ namespace RacesOfValheim public class TrolRace : MonoBehaviour { private static TrolRace _instance; + + // THE PLUGIN ADDS THIS COMPONENT ITSELF, in RacesOfValheim.Awake, and nothing used to tell + // Instance so. The first read of Instance - CreateModAssets, on every start - found _instance + // empty and built a second TrolRace on a GameObject of its own, and from then on two Updates + // read every key. At Fader and past it the True Form key is a toggle: one copy put the form + // on and began to grow, the other saw the form already on in the same frame, was not itself + // transforming, and took it straight off. The Trol grew and shrank back, with no status and + // - since past Fader there is none - no cooldown. + private void Awake() + { + if (_instance != null && _instance != this) + { + Destroy(this); + return; + } + _instance = this; + } + public static TrolRace Instance { get