warvulture
This commit is contained in:
parent
1c4b20bb06
commit
d79f78e9f0
10 changed files with 901 additions and 90 deletions
|
|
@ -316,7 +316,16 @@ namespace RacesOfValheim
|
|||
Character character = GetComponent<Character>();
|
||||
if (character == null || character.IsDead())
|
||||
{
|
||||
Destroy(gameObject);
|
||||
// ZNetScene.Destroy, NEVER Object.Destroy, and this line was the teleport crash.
|
||||
//
|
||||
// An escort is a real networked creature, and ZNetView.OnDestroy - read out of the
|
||||
// assembly, not assumed - only releases asset references: it does not take the
|
||||
// object out of ZNetScene.m_instances. A plain Object.Destroy therefore left the
|
||||
// scene holding a dead ZNetView, and the next time the world unloaded around the
|
||||
// player, which is exactly what a teleport is, ZNetScene.RemoveObjects walked that
|
||||
// entry and threw. See ZNetSceneOrphanPatch.cs for the whole chain.
|
||||
if (ZNetScene.instance != null) ZNetScene.instance.Destroy(gameObject);
|
||||
else Destroy(gameObject);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue