public bool CanRepair(Inventory ingredientInv) { BlueprintDataBlock blueprintDataBlock; IInventoryItem repairItem = this.GetRepairItem(); if (repairItem == null || !repairItem.datablock.isRepairable) { return(false); } if (!repairItem.IsDamaged()) { return(false); } if (!BlueprintDataBlock.FindBlueprintForItem <BlueprintDataBlock>(repairItem.datablock, out blueprintDataBlock)) { return(false); } for (int i = 0; i < (int)blueprintDataBlock.ingredients.Length; i++) { BlueprintDataBlock.IngredientEntry ingredientEntry = blueprintDataBlock.ingredients[i]; int num = Mathf.CeilToInt((float)blueprintDataBlock.ingredients[i].amount * this.GetResourceScalar()); if (num > 0 && ingredientInv.CanConsume(blueprintDataBlock.ingredients[i].Ingredient, num) <= 0) { return(false); } } return(true); }