(0.13.1) - You are allowed to rest inside shops [RESOLVED 0.13.5]

User avatar
BadLuckBurt
Posts: 948
Joined: Sun Nov 05, 2017 8:30 pm

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

Post 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;
                }
DFU on UESP: https://en.uesp.net/w/index.php?title=T ... fall_Unity
DFU Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt

.

User avatar
Jay_H
Posts: 4072
Joined: Tue Aug 25, 2015 1:54 am
Contact:

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

Post by Jay_H »

My save is also a member of a knightly order, for my part.

User avatar
Hazelnut
Posts: 3016
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

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

Post 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.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
Interkarma
Posts: 7247
Joined: Sun Mar 22, 2015 1:51 am

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

Post 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.

User avatar
Hazelnut
Posts: 3016
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

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

Post 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.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

Locked