zymex22 / Project-RimFactory-Revived

Project RimFactory Revived
MIT License
46 stars 34 forks source link

(Bug report) Colonist right clicks captured entity causes NullReferenceException. #780

Closed AnnaShiraishi closed 4 months ago

AnnaShiraishi commented 4 months ago

Describe the bug

Colonist right clicks captured entity causes NullReferenceException.

To Reproduce Reproducibility: true Steps to reproduce the behavior:

  1. capture a entity (I choose sightstealer) into a holding spot.
  2. select a colonist.
  3. right click the entity.

Expected behavior Right click menu should open.

Actual Behavior Error trying to make float menu for Brooks: System.NullReferenceException: Object reference not set to an instance of an object [Ref 78E46AED] at Verse.GenGrid.Walkable (Verse.IntVec3 c, Verse.Map map) [0x00000] in <91ef6de66e7b4ba2839be0ab7f01fedf>:0 at Verse.GenGrid.Standable (Verse.IntVec3 c, Verse.Map map) [0x00000] in <91ef6de66e7b4ba2839be0ab7f01fedf>:0 at Verse.ThingUtility.InteractionCellWhenAt (Verse.ThingDef def, Verse.IntVec3 center, Verse.Rot4 rot, Verse.Map map) [0x0004e] in <91ef6de66e7b4ba2839be0ab7f01fedf>:0 at Verse.Thing.get_InteractionCell () [0x00018] in <91ef6de66e7b4ba2839be0ab7f01fedf>:0 at Verse.Pawn.get_InteractionCell () [0x0002b] in <91ef6de66e7b4ba2839be0ab7f01fedf>:0 at ProjectRimFactory.Common.HarmonyPatches.Patch_CanReserve_SAL.Postfix (Verse.Pawn p, Verse.LocalTargetInfo target, System.Boolean ignoreOtherReservations, System.Boolean& __result) [0x0003d] in :0 at Verse.AI.ReservationUtility.CanReserve (Verse.Pawn p, Verse.LocalTargetInfo target, System.Int32 maxPawns, System.Int32 stackCount, Verse.ReservationLayerDef layer, System.Boolean ignoreOtherReservations) [0x00047] in <91ef6de66e7b4ba2839be0ab7f01fedf>:0

Error trying to make float menu for Brooks: System.NullReferenceException: Object reference not set to an instance of an object [Ref 78E46AED] Duplicate stacktrace, see ref for original UnityEngine.StackTraceUtility:ExtractStackTrace () Verse.Log:Error (string) RimWorld.FloatMenuMakerMap:TryMakeFloatMenu (Verse.Pawn) RimWorld.Selector:HandleMapClicks () RimWorld.Selector:SelectorOnGUI () RimWorld.MapInterface:HandleLowPriorityInput () RimWorld.UIRoot_Play:UIRootOnGUI () Verse.Root:OnGUI ()

Screenshots If applicable, add screenshots to help explain your problem. image

Rimworld (please complete the following information):

Modlist (please complete the following information):

Additional context

XTCProbstA2 commented 4 months ago

I have also gotten this bug while playing. I thought it was one of my other mods doing this. For the work around for the time being, I have been locking my player that needs to research the anomaly and they automatically do it right then and there till this is fixed. One little bug wont stop me from playing with the mod(s).

Sn1p3rr3c0n commented 4 months ago

oof a DLC only bug :(

can someone with the dlc try with that build and share the logs with me? ProjectRimFactory.zip

pgailloud commented 4 months ago

I have the same bug. Here is the log with the build you post : https://gist.github.com/HugsLibRecordKeeper/da253a80c9c1a234be38539a21c525c7

Reproduction:

Sn1p3rr3c0n commented 4 months ago

okey results are inconclusive. I Prepared an updated dll, would be glad if someone could test and share the logs ProjectRimFactory.zip

pgailloud commented 4 months ago

Here you go... https://gist.github.com/HugsLibRecordKeeper/7e635adc82a72a8863781e47a73e1b30

With a bit of information: the spam

Patch_CanReserve_SAL Begin
Patch_CanReserve_SAL End

come at all time. (the entity held being healed/studied by a pawn or not).

And only when i right click on a holding plateform with a pawn selected arrive the message like from the line 1601 to 1661.

Sn1p3rr3c0n commented 4 months ago

thx for the log https://gist.github.com/HugsLibRecordKeeper/7e635adc82a72a8863781e47a73e1b30#file-output_log-txt-L1643-L1660

i'm aware its spammy but there is no other way for me to efficiently get the details i seek

pgailloud commented 4 months ago

I understand for the spammy thing.

but the strange thing is it's not only the error who arrive when i right-click but all the block from the line 1601. You can't see it from the log because there is no timestamps but in the debug window ingame (there is timestamps) i saw it all happend in the same second.

Sn1p3rr3c0n commented 4 months ago

maybe a fix. needs testing ProjectRimFactory.zip

pgailloud commented 4 months ago

The fix is working. 👍 right-click on the entity held show the correct menu.

edit: without errors.

Sn1p3rr3c0n commented 4 months ago

I would appreciate if someone could test this patch as well. That should be a better version of the previous one while also fixing a similar issue with Alert_NoBabyFeeders ProjectRimFactory.zip

Sn1p3rr3c0n commented 4 months ago

Confirmed by laughing_dragon