@@ -3489,6 +3489,8 @@ internal void CreateFromClientNetworkSpawn()
34893489 {
34903490 _clientNetworkSpawnHydrationDepth -- ;
34913491 }
3492+
3493+ MarkCustomNpcFinalized ( ) ;
34923494 }
34933495
34943496 internal override void SaveInternal ( string folderPath , ref List < string > extraSaveables )
@@ -4659,9 +4661,7 @@ internal void FinalizeNetworkSpawn()
46594661
46604662 // Check if all custom NPCs are now ready (finalized)
46614663 // This sets the CustomNpcsReady flag once all custom NPCs have been spawned and finalized
4662- FinalizedCustomNpcTypes . Add ( GetType ( ) ) ;
4663- ReconcileAllCustomNpcRelationshipConnections ( ) ;
4664- CheckAndSetCustomNpcsReady ( ) ;
4664+ MarkCustomNpcFinalized ( ) ;
46654665 }
46664666 catch ( Exception ex )
46674667 {
@@ -4671,7 +4671,7 @@ internal void FinalizeNetworkSpawn()
46714671
46724672 /// <summary>
46734673 /// Checks if all custom NPCs have been finalized and sets the CustomNpcsReady flag.
4674- /// This is called from FinalizeNetworkSpawn to signal when all custom NPCs are ready .
4674+ /// Called after server finalization and client network-spawn hydration .
46754675 /// </summary>
46764676 internal static void CheckAndSetCustomNpcsReady ( )
46774677 {
@@ -4689,8 +4689,8 @@ internal static void CheckAndSetCustomNpcsReady()
46894689 if ( customNpcTypes . Count == 0 )
46904690 return ;
46914691
4692- bool allTypesFinalized = customNpcTypes . All (
4693- type => FinalizedCustomNpcTypes . Contains ( type ) ) ;
4692+ bool allTypesFinalized = Internal . Entities . CustomNpcReadinessPolicy
4693+ . AreAllTypesFinalized ( customNpcTypes , FinalizedCustomNpcTypes ) ;
46944694
46954695 if ( allTypesFinalized )
46964696 CustomNpcsReady = true ;
@@ -4701,6 +4701,15 @@ internal static void CheckAndSetCustomNpcsReady()
47014701 }
47024702 }
47034703
4704+ private void MarkCustomNpcFinalized ( )
4705+ {
4706+ Internal . Entities . CustomNpcReadinessPolicy . MarkFinalized (
4707+ GetType ( ) ,
4708+ FinalizedCustomNpcTypes ) ;
4709+ ReconcileAllCustomNpcRelationshipConnections ( ) ;
4710+ CheckAndSetCustomNpcsReady ( ) ;
4711+ }
4712+
47044713 internal static void ReconcileAllCustomNpcRelationshipConnections ( )
47054714 {
47064715 var configuredNpcs = All
0 commit comments