warvulture

This commit is contained in:
Ferdinando 2026-08-24 19:17:47 +02:00
commit ee5a2e2e7b
12 changed files with 314 additions and 76 deletions

View file

@ -111,7 +111,25 @@ namespace RacesOfValheim
wear.m_hitEffect = new EffectList();
}
if (prefab.GetComponent<ZNetView>() == null) prefab.AddComponent<ZNetView>();
// PERSISTENT, EXPLICITLY, and this is the whole reason a nest could vanish at world
// load. Every other station in the mod is cloned from a real building - a workbench, a
// barrel, a cartography table - and inherits a ZNetView that is already persistent. The
// nest is the one piece built out of SCENERY, and a CreepProp is not saved with the
// world: it belongs to the location that placed it and is put back by the location, so
// its ZNetView (or the bare one added here, which defaults to false) marks the ZDO as
// throwaway. The hive stood, worked, took biomass - and was not written to the save.
// Next load, no ZDO, no nest.
//
// m_syncInitialScale stays OFF on purpose. It looks like the obvious partner to this
// line and it would be a bug: the stage growth is applied to the transform at runtime,
// so a ZNetView that stored the scale would restore the GROWN size, Awake would read it
// back as builtScale, and the nest would multiply itself by its stage again every
// reload. The size is derived from the stage on the ZDO instead, by every client.
ZNetView view = prefab.GetComponent<ZNetView>() ?? prefab.AddComponent<ZNetView>();
view.m_persistent = true;
view.m_distant = false;
view.m_type = ZDO.ObjectType.Default;
prefab.AddComponent<SvermHiveBehaviour>();
MountMouths(prefab);