Fixed vents, more powerful oxygen generators in vanilla subs
This commit is contained in:
@@ -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.
Reference in New Issue
Block a user