OrionFive/Hospitality

Hospitality - VRE-Fungoid Telepathy gene issue

Absurde opened this issue · 3 comments

If Hospitality is loaded alongside VRE-Fungoid the Telepathy gene, which normally enables map-wide communication between carriers, only works if pawns have line of sight.

Steps to reproduce the behavior:

  1. Load both mods

  2. Create a quicktest map

  3. Put pawns in closed rooms with no windows/open doors (EDIT: forgot to mention, you have to give them the gene)

  4. Observe lack of social interaction.

  5. For contrast:
    5a. Put a hole/open door into the walls and even if there's a vast distance between pawns, they should be able to interact with line of sight
    5b. Do 1-4 without Hospitality loaded. Pawns should be able to interact through walls.

There is no error or anything, and I've gone through my mod list mod by mod to determine Hospitality seems to be the sole cause.

I took a look at the assembly and my guess is it might have something to do with 'GuestUtility-CanSee'. If that can maybe be patched to either check for the presence of the gene (VRE-F has a 'AlwaysInteract' method), or to maybe be only limited to guest interactions, that might solve the issue.

From what I can tell, both mods override TryInteractRandomly of Pawn_InteractionsTracker. This is unfortunate.

A fix for this is a fair amount of work and can't quickly be done. I'm afraid you'll have to live with it or not use Hospitality.

Ah, that's a shame. Ok, thanks for the response =]

I'll post this here just in case there's any informational value in it for someone in a similar predicament:
I managed to make it work by compiling Hospitality with an added assembly reference to VRE-F, and in
Patches - Pawn_InteractionsTracker_Patch.TryInteractRandomly - CanInteractNowWith
changing the LineOfSight check to
if (!GenSight.LineOfSight(pawn.Position, recipient.Position, pawn.MapHeld, true) && !(pawn.genes.HasGene(VanillaRacesExpandedFungoid.InternalDefOf.VRE_Telepathy) && recipient.genes.HasGene(VanillaRacesExpandedFungoid.InternalDefOf.VRE_Telepathy))).
Now obviously this is incredibly rough and isn't a viable general solution, but in case someone is searching for a dirty fix, this seems to work for me, and for now (about 1 in-game day) without noticable problems. Cheers