Page 2 of 2

Re: (0.13.1) - You are allowed to rest inside shops

Posted: Sat Jan 08, 2022 8:46 am
by BadLuckBurt
Interkarma wrote: Fri Jan 07, 2022 10:29 pm I can reproduce with attached save. Maybe related to character being a Knight and free room check?
I think that's it. I've tested with your save and Ming is indeed able to rest in a shop.

I added a Debug.Log call and since you're a member of the FightersGuild, you're allowed to rest there according to the code.

Code: Select all

Got guild for faction id: 510, social group: Merchants, guild: FightersGuild 
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 39)

Resting allowed because guild member - factionID = 510 
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 39)
It's this bit of code in CanRest of DaggerfallRestWindow.cs where it happens:

Code: Select all

                // Check for guild hall rest privileges (exclude taverns since they are all marked as fighters guilds in data)
                if (playerEnterExit.BuildingDiscoveryData.buildingType != DFLocation.BuildingTypes.Tavern &&
                    GameManager.Instance.GuildManager.GetGuild(playerEnterExit.BuildingDiscoveryData.factionID).CanRest())
                {
                    playerEnterExit.Interior.FindMarker(out allocatedBed, DaggerfallInterior.InteriorMarkerTypes.Rest);
                    return true;
                }

Re: (0.13.1) - You are allowed to rest inside shops

Posted: Sat Jan 08, 2022 12:16 pm
by Jay_H
My save is also a member of a knightly order, for my part.

Re: (0.13.1) - You are allowed to rest inside shops

Posted: Sat Jan 08, 2022 12:38 pm
by Hazelnut
Thanks Interkarma, that gave me the thread I needed. Basically if you're a member of the Fighters Guild you can sleep in their guildhalls, but due to faction data (surprise) merchant faction (i.e. stores) 510 is marked as part of the FG. This may have been intentional as the FG simply sells fighting services I guess. Anyway either way the check for a buildings' guild as I wrote it returns FG allowing sleeping in and also accessing 24h a day when rank 6 or above in FG. :(

There are two ways to correct this, I can add a special case so that shops are not treated like FG for resting and entry which I've done in PR #2276.

Alternatively, the DFU FACTION.TXT could be changed but that would only fix it for new games I think.

EDIT: thanks Burt and Jay for your posts, I only saw them after posting this.

Re: (0.13.1) - You are allowed to rest inside shops

Posted: Mon Jan 10, 2022 10:01 pm
by Interkarma
Awesome! Happy that helped even though my first guess was wrong. Happy to have a fix that works in live games. That faction data is a constant source of small problems.

Thanks for PR, will merge that ahead of next builds.

Re: (0.13.1) - You are allowed to rest inside shops

Posted: Mon Jan 10, 2022 11:09 pm
by Hazelnut
No problem mate, while I don't like conditionals for special cases generally - I think this is the best approach for this particular issue.