valheimPlus / ValheimPlus

A HarmonyX Mod aimed at improving the gameplay and quality of life of the game Valheim.
http://valheim.plus
GNU Affero General Public License v3.0
967 stars 237 forks source link

[BUG] #758

Open fbda opened 1 year ago

fbda commented 1 year ago

Char not Save when logout

Logout with errors, CHAR not Saved

[Error : Unity Log] NullReferenceException: Object reference not set to an instance of an object Stack trace: Skills.Save (ZPackage pkg) (at <35c0f7aa1999477788815a7bf78200d7>:0) Player.Save (ZPackage pkg) (at <35c0f7aa1999477788815a7bf78200d7>:0) PlayerProfile.SavePlayerData (Player player) (at <35c0f7aa1999477788815a7bf78200d7>:0) Game.SavePlayerProfile (System.Boolean setLogoutPoint) (at <35c0f7aa1999477788815a7bf78200d7>:0) Game.Shutdown () (at <35c0f7aa1999477788815a7bf78200d7>:0) Game.Logout () (at <35c0f7aa1999477788815a7bf78200d7>:0) Menu.Logout () (at <35c0f7aa1999477788815a7bf78200d7>:0) Menu.OnLogoutYes () (at <35c0f7aa1999477788815a7bf78200d7>:0) UnityEngine.Events.InvokableCall.Invoke () (at :0) UnityEngine.Events.UnityEvent.Invoke () (at :0) UnityEngine.UI.Button.Press () (at <67859b8eac9e4f3b99606821e32b26c6>:0) UnityEngine.UI.Button.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) (at <67859b8eac9e4f3b99606821e32b26c6>:0) UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at <67859b8eac9e4f3b99606821e32b26c6>:0) UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) (at <67859b8eac9e4f3b99606821e32b26c6>:0) UnityEngine.EventSystems.EventSystem:Update()

bg364 commented 1 year ago

It is most likely related to Fishing skill (wasn't fishing changed in Valheim in last updates?)

Onnes11 commented 1 year ago

We hit this problem on our server, and I think I've managed to get it to reproduce on a clean, minimal setup.

  1. Fresh V+ install through r2modman
  2. (Important) Enable PlayerProjectile and enableScaleWithSkillLevel
  3. Fresh character, fresh world
  4. Spawn in fishingrod and fishingbait
  5. Cast once so there's any amount of exp gained in fishing
  6. Logout
  7. [Error  : Unity Log] NullReferenceException: Object reference not set to an instance of an object
    Stack trace:
    Skills.Save (ZPackage pkg) (at <35c0f7aa1999477788815a7bf78200d7>:0)
    Player.Save (ZPackage pkg) (at <35c0f7aa1999477788815a7bf78200d7>:0)
    PlayerProfile.SavePlayerData (Player player) (at <35c0f7aa1999477788815a7bf78200d7>:0)
    Game.SavePlayerProfile (System.Boolean setLogoutPoint) (at <35c0f7aa1999477788815a7bf78200d7>:0)
    Game.Shutdown () (at <35c0f7aa1999477788815a7bf78200d7>:0)
    Game.OnApplicationQuit () (at <35c0f7aa1999477788815a7bf78200d7>:0)