[1.0.2059] GenRecipe.PostProcessProduct leads to nullReference Exception

Started by Albion, November 09, 2018, 05:06:29 AM

Previous topic - Next topic

Albion

Hey,
I created a recipe to craft Doomsday and triple rocket launchers for my mod.
However I ran into the following problem:
The vanilla defs for these launchers inherit from the BaseGun def which includes the art comp but NOT the quality comp. However when the recipe is finished the Method PostProcessProduct in the class GenRecipe gets called. The method checks first if the compQuality is null (which it is) and then checks for the compArt (which is NOT null) in the following process it however calls the compQuality without checking again if it is still null!
This leads to a nullRef exception because the launchers have a compArt but NOT a compQuality.

Therefore either the method has to be adjusted to check again for the compQuality or the entire subroutine for compArt should be moved into the routine for compQuality.
Alternatively the BaseGun def should have it's compArt moved to the BaseGunWithQuality def.