RimWorldCCLTeam / CommunityCoreLibrary

For full details see the official Ludeon Forums thread.
https://ludeon.com/forums/index.php?topic=16599.0
The Unlicense
60 stars 27 forks source link

Issue179 #184

Closed Kelnor277 closed 7 years ago

Kelnor277 commented 7 years ago

Submitting PR just to show the changes. There's still problems and I think it can be cleaned up a bit by someone that knows more about CCL. Fixes Social Relax Jobs with prohibited drugs. Also fixes Social Relax jobs with Automated Factories.

Automated Factories still do not work with meals. Looks like the issues is JobGiver_GetFood puts the factory object in foodDef instead of the meal. This breaks the FoodUtility.WillIngestStackCountOf call with a null reference error..

Kelnor277 commented 7 years ago

I think I just had a better idea. Make a SynthesizedThing object extending thing with two additional fields. ThingDefToProduce, and Synthesizer. The overridden thing functions return the Factory's properties or the ThingDefToProduce ones in ways that make sense. IE. location functions return stuff to path to the factory interaction cell, and def returns the def of the production item.

That way we just return this object and no need to store the thingdef in a dictionary. Might even work without modifying base code, or at least require fewer modifications.