Ludeon Forums

RimWorld => Bugs => Topic started by: krafs on February 22, 2021, 02:48:04 PM

Title: [1.2] Scribe-loading collection fails if it contains generic from other assembly
Post by: krafs on February 22, 2021, 02:48:04 PM
I was making a mod, working on scribing a collection of IExposable classes in a GameComponent.
I populated the list with a generic class that used a generic argument from a different assembly.
This saved without a problem. However, loading the save did not manage to deserialize the classes from the save file, and yielded errors. It seems to not be able to find the generic type argument if it's from a different assembly.

How to reproduce:

1. Make an empty mod, with just an About/About.xml. (I zipped and attached the mod project I was testing with below).

2. Add an assembly to it containing just the following class:

public class ClassFromOtherAssembly
{ }

3. Add another assembly that references the first, that contains the following:
https://pastebin.com/nBteLY2L

4. Start a fresh Rimworld game with only this mod.

5. Save the game.

6. Load the saved game.

7. Errors appear in the log.

Attached zip contains Player.log, save-file, and the mod project described above. Should be able to just build and start the game with it.
Title: Re: [1.2] Scribe-loading collection fails if it contains generic from other assembly
Post by: ison on March 12, 2021, 08:57:41 AM
Thanks, added to Mantis.