-
-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Guests share beds #803
Comments
Ah yeah. I see how this could cause it. When they choose to walk to it, they've already checked attractiveness, but there is no other reservation yet. By the time they reach it and make the reservation, there is another reservation, but it's not a blocking issue. |
Can pawns reserve beds before going to them? That would make it possible to check for opinion of the other guest who reserved the same bed. Don't pawns reserve workbenches before going to them? If so, it would make sense to implement the same logic with guest beds. |
The reservation systems for beds and other objects work quite differently. They go to the bed to claim it, and it's not claimed until they reach it. Technically, they are also reserving it for usage, but since it's a double bed, it allows two pawns to reserve it, and this reservation is canceled if they're interrupted somehow. It's a completely different system. |
My suggestion was to use the reservation system to get info on reservers. This way guests know if they'll be sleeping with strangers in advance and choose their beds accordingly. This seems to be an elegant solution without guests reevaluating all beds. I've coded this and created a pull request. |
It's live. |
On a side note, would it cause too much trouble to update the 1.4 assembly? My current playthrough is centered around Hospitality, and this bug annoyed me so much I decided to fix myself. Can't update the save file to 1.5 though. If it's too much of a hassle - no worries, you're already doing absolutely amazing work maintaining this mod for 8 years. Thank you! |
The -250 is overkill, since there's already the check that they must have a romantic relationship. Updating the 1.4 assembly is a fair bit of trouble. But if you make a PR of it updated correctly with the fix, I'll merge it. Make sure to compile it against the correct DLLs and with the correct assembly version, though. Normally I never touch old versions after a new one is out because the risk of breaking the old version somehow is way too high. |
The romantic relationship is checked only in Try testing it without Ideology. |
Ah, I must have missed that part. I suppose the relationship check should also be added to the other method then? |
I'd just remove
Note that I don't own Ideology, so I don't know how it works. My best bet is to include |
I've uploaded a fix. I've tested it without Ideology a few times and I think this should do the trick. |
Looks good! |
Guests sleep with strangers even if there are free beds with the same attractiveness.
To Reproduce
This seems to be a bit random, so might take 2 tries to reproduce.
I looked at the source code, and I think what happens is 2 guests reserve the same bed and start walking to it. At that time the bed still has no owners, so both guests assume it is unoccupied and then sleep together.
I think the solution is to check for bed owners and bed reservations when calculating bed attractiveness. ReservationManager has a ReserversOf method which can probably be used for this. I have zero experience in modding or c#, so unfourtunately I don't know how to implement this myself.
The text was updated successfully, but these errors were encountered: