From 3e1603b73984928fb690dfd5c5a24f06295ddefa Mon Sep 17 00:00:00 2001 From: BoroBongo Date: Sun, 22 Nov 2026 02:27:53 +0000 Subject: [PATCH] fix: G2 Old Camp NPCs sleep in their beds - beds that are oCMobDoor vobs (BEDHIGH_2_OC) are AI_UseMob mobs Like the engine, a bed is a bed even when the world stores it as oCMobDoor. VobService skipped every oCMobDoor for the NPC mob list, so ZS_Sleep never found these beds and the Old Camp slept standing next to them. Real doors stay excluded (ZenKitExtension.IsBed: visual BED*). Ported from the experimental branch (c496efa16). --- .../Scripts/Services/Vobs/VobService.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Assets/Gothic-Core/Scripts/Services/Vobs/VobService.cs b/Assets/Gothic-Core/Scripts/Services/Vobs/VobService.cs index 719d842ef..bcff9ee93 100644 --- a/Assets/Gothic-Core/Scripts/Services/Vobs/VobService.cs +++ b/Assets/Gothic-Core/Scripts/Services/Vobs/VobService.cs @@ -716,10 +716,21 @@ private void AddToMobInteractableList(VobContainer container) // Movers, triggers and chests are asked by name (Wld_SendTrigger, Mob_HasItems); ignores other types. _gameStateService.RegisterNamedVob(container); - switch (container.Vob.Type) + var type = container.Vob.Type; + + // Beds that are oCMobDoor vobs (G2's Old Camp BEDHIGH_2_OC, also built as beds by VobInitializerDomain) are + // AI_UseMob mobs like the engine: NPCs never found them for ZS_Sleep and slept standing next to them. + if (type == VirtualObjectType.oCMobDoor && container.Vob.IsBed()) + { + Logger.Log($"[VobService] '{container.Vob.Visual?.Name}' is an oCMobDoor bed - usable by NPCs.", + LogCat.Vob); + type = VirtualObjectType.oCMobBed; + } + + switch (type) { // case VirtualObjectType.oCMOB: // FIXME - Needed? e.g. IMovableObject - // oCMobDoor excluded: doors use VR hinge physics for interaction, not AI_UseMob. + // oCMobDoor excluded: doors use VR hinge physics for interaction, not AI_UseMob (beds: above). case VirtualObjectType.oCMobFire: case VirtualObjectType.oCMobInter: case VirtualObjectType.oCMobBed: