Clients can create firesources if server tells them to, extinguishing fixes
This commit is contained in:
@@ -163,7 +163,15 @@ namespace Barotrauma.Items.Components
|
|||||||
displayPos += item.CurrentHull.Submarine.Position;
|
displayPos += item.CurrentHull.Submarine.Position;
|
||||||
|
|
||||||
Hull hull = Hull.FindHull(displayPos, item.CurrentHull);
|
Hull hull = Hull.FindHull(displayPos, item.CurrentHull);
|
||||||
if (hull != null) hull.Extinquish(deltaTime, ExtinquishAmount, displayPos);
|
if (hull != null)
|
||||||
|
{
|
||||||
|
hull.Extinquish(deltaTime, ExtinquishAmount, displayPos);
|
||||||
|
if (hull != item.CurrentHull)
|
||||||
|
{
|
||||||
|
item.CurrentHull.Extinquish(deltaTime, ExtinquishAmount, displayPos);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Body targetBody = Submarine.PickBody(rayStart, rayEnd, ignoredBodies);
|
Body targetBody = Submarine.PickBody(rayStart, rayEnd, ignoredBodies);
|
||||||
|
|||||||
@@ -61,10 +61,12 @@ namespace Barotrauma
|
|||||||
get { return hull; }
|
get { return hull; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public FireSource(Vector2 worldPosition, Hull spawningHull = null)
|
public FireSource(Vector2 worldPosition, Hull spawningHull = null, bool isNetworkMessage = false)
|
||||||
{
|
{
|
||||||
hull = Hull.FindHull(worldPosition, spawningHull);
|
hull = Hull.FindHull(worldPosition, spawningHull);
|
||||||
if (hull == null || (GameMain.Client!=null)) return;
|
if (hull == null) return;
|
||||||
|
|
||||||
|
if (!isNetworkMessage && GameMain.Client != null) return;
|
||||||
|
|
||||||
if (fireSoundBasic==null)
|
if (fireSoundBasic==null)
|
||||||
{
|
{
|
||||||
@@ -311,7 +313,7 @@ namespace Barotrauma
|
|||||||
float range = 100.0f;
|
float range = 100.0f;
|
||||||
|
|
||||||
if (pos.X < WorldPosition.X - range || pos.X > WorldPosition.X + size.X + range) return;
|
if (pos.X < WorldPosition.X - range || pos.X > WorldPosition.X + size.X + range) return;
|
||||||
if (pos.Y < WorldPosition.Y - size.Y || pos.Y > WorldPosition.Y + 500.0f) return;
|
if (pos.Y < WorldPosition.Y - range || pos.Y > WorldPosition.Y + 500.0f) return;
|
||||||
|
|
||||||
float extinquishAmount = amount * deltaTime;
|
float extinquishAmount = amount * deltaTime;
|
||||||
|
|
||||||
|
|||||||
@@ -876,7 +876,7 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var newFire = new FireSource(pos + Submarine.Position);
|
var newFire = new FireSource(pos + Submarine.Position, null, true);
|
||||||
newFire.Size = new Vector2(
|
newFire.Size = new Vector2(
|
||||||
newFire.Hull == null ? size : size * newFire.Hull.rect.Width,
|
newFire.Hull == null ? size : size * newFire.Hull.rect.Width,
|
||||||
newFire.Size.Y);
|
newFire.Size.Y);
|
||||||
|
|||||||
Reference in New Issue
Block a user