Fixed vents, more powerful oxygen generators in vanilla subs

This commit is contained in:
Regalis
2016-05-30 18:25:50 +03:00
parent c71a935de6
commit c77060d485
5 changed files with 14 additions and 13 deletions

View File

@@ -43,9 +43,7 @@ namespace Barotrauma.Items.Components
{
IsActive = true;
ventList = new List<Vent>();
item.linkedTo.CollectionChanged += delegate { GetVents(); };
//item.linkedTo.CollectionChanged += delegate { GetVents(); };
}
public override void Update(float deltaTime, Camera cam)
@@ -77,12 +75,11 @@ namespace Barotrauma.Items.Components
running = true;
CurrFlow = Math.Min(voltage, 1.0f) * generatedAmount*100.0f;
item.CurrentHull.Oxygen += CurrFlow * deltaTime;
//item.CurrentHull.Oxygen += CurrFlow * deltaTime;
UpdateVents(CurrFlow);
voltage = 0.0f;
voltage -= deltaTime;
}
public override void UpdateBroken(float deltaTime, Camera cam)
@@ -107,13 +104,19 @@ namespace Barotrauma.Items.Components
}
}
public override void OnMapLoaded()
{
GetVents();
}
//public override void OnMapLoaded()
//{
// GetVents();
//}
private void UpdateVents(float deltaOxygen)
{
if (ventList == null)
{
ventList = new List<Vent>();
GetVents();
}
if (!ventList.Any() || totalHullVolume == 0.0f) return;
foreach (Vent v in ventList)

View File

@@ -21,8 +21,6 @@ namespace Barotrauma.Items.Components
public override void Update(float deltaTime, Camera cam)
{
base.Update(deltaTime, cam);
if (item.CurrentHull == null) return;
item.CurrentHull.Oxygen += oxygenFlow * deltaTime;

Binary file not shown.

Binary file not shown.