KiameV / rimworld-weaponstorage

Storage for weapons and the ability to quickly equip weaponry.
MIT License
1 stars 1 forks source link

Freezes the game when non drafted hunter shifts weapon #7

Open tukoz opened 3 years ago

tukoz commented 3 years ago

Non drafted pawn shifting his weapon freezes the game (when clicking its assigned weapon #2 icon). Same issue than back in 1.0 [1] but now the log seems much more detailed:

JobDriver threw exception in initAction for pawn Wasp driver=JobDriver_Hunt (toilIndex=2) driver.job=(Hunt (Job_2772695) A=Thing_Rat604140)
System.NullReferenceException: Object reference not set to an instance of an object
  at System.String.FillStringChecked (System.String dest, System.Int32 destPos, System.String src) [0x00006] in <567df3e0919241ba98db88bec4c6696f>:0 
  at System.String.Concat (System.String str0, System.String str1) [0x00036] in <567df3e0919241ba98db88bec4c6696f>:0 
  at Verse.AI.JobDriver.TryActuallyStartNextToil () [0x00202] in <b02b390b894d4487a224faae4a3db641>:0 
  at Verse.AI.JobDriver.ReadyForNextToil () [0x00007] in <b02b390b894d4487a224faae4a3db641>:0 
  at Verse.AI.JobDriver.TryActuallyStartNextToil () [0x0022a] in <b02b390b894d4487a224faae4a3db641>:0 
  at Verse.AI.JobDriver.ReadyForNextToil () [0x00007] in <b02b390b894d4487a224faae4a3db641>:0 
  at Verse.AI.JobDriver.Notify_PatherArrived () [0x00009] in <b02b390b894d4487a224faae4a3db641>:0 
  at Verse.AI.Pawn_PathFollower.PatherArrived () [0x00018] in <b02b390b894d4487a224faae4a3db641>:0 
  at Verse.AI.Pawn_PathFollower.StartPath (Verse.LocalTargetInfo dest, Verse.AI.PathEndMode peMode) [0x00198] in <b02b390b894d4487a224faae4a3db641>:0 
  at (wrapper dynamic-method) Verse.AI.Toils_Combat+<>c__DisplayClass1_0.Verse.AI.Toils_Combat+c__DisplayClass1_0.<GotoCastPosition>b__0_Patch0(Verse.AI.Toils_Combat/<>c__DisplayClass1_0)
  at Verse.AI.JobDriver.TryActuallyStartNextToil () [0x001df] in <b02b390b894d4487a224faae4a3db641>:0 

(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

[1] Full log: http://sprunge.us/8yO8wO (my Steam community comment from March 20 at 22:51)

PS: Had not played since 1.0 and I love the various refinements crafted in WS since then :)

tukoz commented 3 years ago

I did some testing and the freezes occurred only (and systematically) with hunting pawns when you shift their weapon. That is whether they are shooting and in range, or going to haul the animal they killed a moment before. EDIT after further testing: When shifting weapon while the pawn is still way out of range of his target makes the game freeze NOT at once, but when said pawn comes in range -- that range of his initial weapon. Log then is the copy of that one above, i.e. when pawn shifts weapon while he's in range of his target.