Skip to content
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

Error when equipping shield if one is already equipped. #28

Open
SickBoyWi opened this issue Apr 16, 2019 · 0 comments
Open

Error when equipping shield if one is already equipped. #28

SickBoyWi opened this issue Apr 16, 2019 · 0 comments

Comments

@SickBoyWi
Copy link

If I have a pawn with a shield equipped, and try to equip a different one, I get this error:

JobDriver threw exception in initAction for pawn Rogrum driver=JobDriver_Equip (toilIndex=1) driver.job=(Equip (Job_87) A=Thing_RH_TET_Dwarf_ShieldMid58557) lastJobGiver=Verse.AI.ThinkNode_QueuedJob
System.NullReferenceException: Object reference not set to an instance of an object
at PawnShields.HarmonyPatches.EquipmentTracker_GetPawn (object) <0x0001e>
at PawnShields.HarmonyPatches.Patch_Pawn_EquipmentTracker_MakeRoomFor (Verse.Pawn_EquipmentTracker,Verse.ThingWithComps&) <0x00092>
at (wrapper dynamic-method) Verse.Pawn_EquipmentTracker.MakeRoomFor_Patch1 (object,Verse.ThingWithComps) <0x00152>
at Verse.AI.JobDriver_Equip/c__Iterator0.<>m__0 () <0x000f9>
at Verse.AI.JobDriver.TryActuallyStartNextToil () <0x0071f>

Verse.Log:Error(String, Boolean)
Verse.AI.JobUtility:TryStartErrorRecoverJob(Pawn, String, Exception, JobDriver)
Verse.AI.JobDriver:TryActuallyStartNextToil()
Verse.AI.JobDriver:ReadyForNextToil()
Verse.AI.JobDriver:Notify_PatherArrived()
Verse.AI.Pawn_PathFollower:PatherArrived()
Verse.AI.Pawn_PathFollower:TryEnterNextPathCell()
Verse.AI.Pawn_PathFollower:PatherTick()
Verse.Pawn:Tick_Patch1(Object)
Verse.TickList:Tick()
Verse.TickManager:DoSingleTick()
Verse.TickManager:TickManagerUpdate()
Verse.Game:UpdatePlay()
Verse.Root_Play:Update()

I traced it back through your source code, and here's the function that fails. The only thing that can be null there seems to be 'pawnField_Pawn_EquipmentTracker'.

        public static Pawn EquipmentTracker_GetPawn(object instance)
        {
            return (Pawn)pawnField_Pawn_EquipmentTracker.GetValue(instance);
        }

Is this a known issue? I don't see an open issue for it. Any thoughts?

@SickBoyWi SickBoyWi changed the title Error when equipping shield if on already equipped. Error when equipping shield if one is already equipped. Apr 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant