JereKuusela / valheim-expand_world_data

The Unlicense
2 stars 1 forks source link

Compatibility issue between ExpandWorld and Shudnal's Seasons mod #5

Closed mdf25 closed 9 months ago

mdf25 commented 9 months ago

Not sure what caused this nullref but when season hit the winter it spammed the console with this over and over:

[Error  : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
ExpandWorldData.DataManager.CleanGhostInit (ZNetView view) (at <a1c3077df485469aa35aab6d721a454d>:0)
ExpandWorldData.DataManager.CleanGhostInit (UnityEngine.GameObject obj) (at <a1c3077df485469aa35aab6d721a454d>:0)
ExpandWorldData.DataManager.Instantiate (UnityEngine.GameObject prefab, UnityEngine.Vector3 pos, UnityEngine.Quaternion rot, Service.ZDOData data) (at <a1c3077df485469aa35aab6d721a454d>:0)
ExpandWorldData.VegetationSpawning.Instantiate (UnityEngine.GameObject prefab, UnityEngine.Vector3 pos, UnityEngine.Quaternion rot, System.Collections.Generic.List`1[T] clearAreas) (at <a1c3077df485469aa35aab6d721a454d>:0)
(wrapper dynamic-method) ZoneSystem.DMD<ZoneSystem::PlaceVegetation>(ZoneSystem,Vector2i,UnityEngine.Vector3,UnityEngine.Transform,Heightmap,System.Collections.Generic.List`1<ZoneSystem/ClearArea>,ZoneSystem/SpawnMode,System.Collections.Generic.List`1<UnityEngine.GameObject>)
ZoneSystem.SpawnZone (Vector2i zoneID, ZoneSystem+SpawnMode mode, UnityEngine.GameObject& root) (at <dbd2a6fbcde9498cadcacfb37ef883e3>:0)
ZoneSystem.PokeLocalZone (Vector2i zoneID) (at <dbd2a6fbcde9498cadcacfb37ef883e3>:0)
ZoneSystem.CreateLocalZones (UnityEngine.Vector3 refPoint) (at <dbd2a6fbcde9498cadcacfb37ef883e3>:0)
ZoneSystem.Update () (at <dbd2a6fbcde9498cadcacfb37ef883e3>:0)

Moreover if I moved around a lot sometimes it would spawn a rock or tree at the position I was looking at, and theer were many duplicates of Rock_3 around my location that weren't there before and one instance of the pine tree in the ocean as I was flying around testing.

From looking at Seasons.dll it appears it uses prefab variants for certain things, so not sure if that conflicts with the vegetation.

shudnal commented 9 months ago

Hi! You should've post that issue earlier in Seasons repo as well. You can join us in search of issue reason. https://github.com/shudnal/Seasons/issues/7

shudnal commented 9 months ago

The reason was the call of m_nview.Destroy(); at Pickable.Awake. That's still possible in vanilla game with some unusual circumstances.

mdf25 commented 9 months ago

Fixed on Seasons side so closing :D