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

Exception thrown while saving with active artillery ArtilleryComp #6

Open
perkinslr opened this issue May 21, 2022 · 0 comments
Open

Comments

@perkinslr
Copy link

Steps to Reproduce

  1. Start a new game and settle near an industrial-or-later settlement.
  2. Dev mode in an artillery piece and ammo
  3. Bombard the nearby settlement, provoking bombardment
  4. Save the game before the bombardment stops.

Stack Trace

This produces the following exception:

Exception while saving VFESecurity.WorldArtilleryTracker: System.InvalidCastException: Specified cast is not valid.
  at Verse.Scribe_Collections.Look[T] (System.Collections.Generic.List`1[T]& list, System.Boolean saveDestroyedThings, System.String label, Verse.LookMode lookMode, System.Object[] ctorArgs) [0x00161] in <9472cef786a241bbb917e810bc0a1328>:0 
  at Verse.Scribe_Collections.Look[T] (System.Collections.Generic.HashSet`1[T]& valueHashSet, System.Boolean saveDestroyedThings, System.String label, Verse.LookMode lookMode) [0x00050] in <9472cef786a241bbb917e810bc0a1328>:0 
  at Verse.Scribe_Collections.Look[T] (System.Collections.Generic.HashSet`1[T]& valueHashSet, System.String label, Verse.LookMode lookMode) [0x00000] in <9472cef786a241bbb917e810bc0a1328>:0 
  at VFESecurity.WorldArtilleryTracker.ExposeData () [0x00061] in <05c23ee943ea466f9f0a452da1a42c37>:0 
  at Verse.Scribe_Deep.Look[T] (T& target, System.Boolean saveDestroyedThings, System.String label, System.Object[] ctorArgs) [0x00167] in <9472cef786a241bbb917e810bc0a1328>:0  

Which happens on line 113 of WorldArtilleryTracker.cs when trying to save the non-empty cachedArtilleryCompsBombarding.

Mod List

Harmony
Core
Royalty
VFE Framework
VFE Sec
Hugs Lib
Better Mods Mismatch Window

Notes

I added additional debugging information to the ExposeData method, and verified cachedArtilleryCompsBombarding is the type expected, and contains only the type expected, so I'm not sure what is causing the problem. Skipping saving cachedArtilleryCompsBombarding or emptying it during the save removes the error.

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