Skip to content

VEF.Cooking.Comp_TempTransforms::DoTick() does not actually check "if any" #171

@jkname

Description

@jkname
                //Here is the main change: when the temperature is reached the item is "Ruined", and
                //this code will spawn a new item with the same stackCount, the same ingredients list
                //(if any) and destroy the original item

                Thing newItem = ThingMaker.MakeThing(ThingDef.Named(Props.thingToTransformInto));
                newItem.stackCount = this.parent.stackCount;
                newItem.TryGetComp<CompIngredients>().ingredients = this.parent.TryGetComp<CompIngredients>().ingredients;

Does not actually check "if any", should be:

                if( newItem.TryGetComp<CompIngredients>()?.ingredients != null )
                    newItem.TryGetComp<CompIngredients>().ingredients = this.parent.TryGetComp<CompIngredients>()?.ingredients;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions