-fixed a typo in fabricableItem requirement & added checking for said typos

- fixed being able to set battery recharge sped over the limits
- fixed vents being added to OxygenGenerator.ventlist multiple times
- fixed item.Submarine not being set if pulling an item from a fabricator
- some tutorial fixes
- fixed TraitorMode endmessage not being shown if the sub isn't at the end and neither character is dead
- SalvageQuest fails if the item has been destroyed
-
This commit is contained in:
Regalis
2016-01-21 20:59:26 +02:00
parent 218b14d4bb
commit c78784068c
28 changed files with 143 additions and 75 deletions
@@ -2,6 +2,7 @@
using System;
using System.Collections.Generic;
using System.Xml.Linq;
using System.Linq;
namespace Barotrauma.Items.Components
{
@@ -73,7 +74,7 @@ namespace Barotrauma.Items.Components
running = true;
CurrFlow = Math.Min(voltage, 1.0f) * generatedAmount * 1000.0f;
CurrFlow = Math.Min(voltage, 1.0f) * generatedAmount*100.0f;
item.CurrentHull.Oxygen += CurrFlow * deltaTime;
UpdateVents(CurrFlow);
@@ -88,7 +89,9 @@ namespace Barotrauma.Items.Components
}
private void GetVents()
{
{
ventList.Clear();
foreach (MapEntity entity in item.linkedTo)
{
Item linkedItem = entity as Item;
@@ -101,7 +104,7 @@ namespace Barotrauma.Items.Components
private void UpdateVents(float deltaOxygen)
{
if (ventList.Count == 0) return;
if (!ventList.Any()) return;
deltaOxygen = deltaOxygen / ventList.Count;
foreach (Vent v in ventList)