warvulture
This commit is contained in:
parent
8580d65a56
commit
0aa1dc4dc8
19 changed files with 2432 additions and 24 deletions
|
|
@ -261,6 +261,17 @@ namespace RacesOfValheim
|
|||
// GameObject - walks straight into Say(m_randomStartTrade, ...) right after opening the store.
|
||||
Trader trader = prefab.GetComponent<Trader>() ?? prefab.AddComponent<Trader>();
|
||||
trader.m_name = PieceDisplayName;
|
||||
|
||||
// DISABLED ON PURPOSE, and it is the line that keeps the log clean. Trader was written for
|
||||
// Haldor, who is a creature with an animator and a LookAt rig: Trader.Update() calls
|
||||
// m_animator.SetBool("Stand", ...) and m_lookAt.ResetTarget() with no null check on every
|
||||
// frame no player is nearby, and Trader.Start() calls InvokeRepeating("RandomTalk", 0, 0)
|
||||
// on a component nobody authored in the editor. On a totem both of those are null, so the
|
||||
// piece threw a NullReferenceException every frame from the moment it was raised. A
|
||||
// disabled component runs neither, and StoreGui needs neither: Show() only reads fields off
|
||||
// the Trader and asks it for its item list, and GetComponent finds it disabled just the
|
||||
// same. This is the same fix SvermHiveStore.Mount already carries for the Hive Market.
|
||||
trader.enabled = false;
|
||||
trader.m_items = new List<Trader.TradeItem>();
|
||||
trader.m_useItems = new List<Trader.TraderUseItem>();
|
||||
trader.m_randomTalk = new List<string>();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue