Fuel rods can't be turned back to uranium/incendium if they've already been used, fixed level generation breaking with smaller subs

This commit is contained in:
Regalis
2016-02-13 13:09:27 +02:00
parent 1506738ff7
commit 08f1d05507
9 changed files with 52 additions and 15 deletions
@@ -58,9 +58,11 @@ namespace Barotrauma.Items.Components
return;
}
foreach (string deconstructProduct in targetItem.Prefab.DeconstructItems)
foreach (DeconstructItem deconstructProduct in targetItem.Prefab.DeconstructItems)
{
var itemPrefab = ItemPrefab.list.FirstOrDefault(ip => ip.Name.ToLower() == deconstructProduct.ToLower()) as ItemPrefab;
if (deconstructProduct.RequireFullCondition && targetItem.Condition < 100.0f) continue;
var itemPrefab = ItemPrefab.list.FirstOrDefault(ip => ip.Name.ToLower() == deconstructProduct.ItemPrefabName.ToLower()) as ItemPrefab;
if (itemPrefab==null)
{
DebugConsole.ThrowError("Tried to deconstruct item ''"+targetItem.Name+"'' but couldn't find item prefab ''"+deconstructProduct+"''!");