You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] New custom NPC starts at relationship delta 2.0 instead of the configured delta #375
A custom NPC that is new to an existing save starts at the vanilla relationship delta 2.0 instead of the delta set with NPCRelationshipDataBuilder.WithDelta. The configured delta arrives a few seconds later, when the deferred FinalizeNetworkSpawn applies the relationship defaults. Code that reads the relationship in that window (customer setup, mod UI, a console dump right after load) gets 2.0.
Environment
Schedule I 0.4.7f12, IL2CPP, MelonLoader 0.7.3. The code path is shared with Mono.
Register a physical customer NPC with WithRelationshipDefaults(r => r.WithDelta(2.5f)), for example a Personnel pack NPC with "relationships": { "delta": 2.5 }.
Load an existing save that has never seen this NPC.
Read npc.RelationData.RelationDelta as soon as the save is loaded.
Expected behavior
2.5 from the first read.
Observed behavior
Read at load: relDelta=2 unlockType=Recommendation.
Same NPC a few seconds later: relDelta=2.5.
Not the same as #260 (saved values lost on reload). This is the starting value before any save exists.
Cause
NPCRelationData.Init sets RelationDelta = NPCData.Relationship.DefaultRelationshipValue * 5. S1API leaves DefaultRelationshipValue at the vanilla 0.4 and applies the configured delta only in FinalizeNetworkSpawn, which NPCNetworkBootstrap defers. Init runs twice before that:
In the S1API constructor (InitializeRelationshipData).
In native Awake of the spawned instance.
Both start the NPC at 2.0.
Suggested fix
Write delta / 5 into Relationship.DefaultRelationshipValue before both Init calls. Saved relationship data still replaces it during load.
changed the title [-][BUG] New custom NPC starts at relationship delta 2.0 instead of the configured delta until spawn[/-][+][BUG] New custom NPC starts at relationship delta 2.0 instead of the configured delta[/+]on Oct 29, 2026
Activity
[-][BUG] New custom NPC starts at relationship delta 2.0 instead of the configured delta until spawn[/-][+][BUG] New custom NPC starts at relationship delta 2.0 instead of the configured delta[/+]fix(npc): start new custom npcs at the configured relationship delta