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