Clients don't apply OnFire statuseffects to items. OnFire can cause items to explode, and because the client can't set the condition of the item to 0.0, it'll keep exploding until the server breaks the item. TODO: come up with a proper fix because now clients can't see oxy or fuel tanks exploding at their end.
This commit is contained in:
@@ -75,12 +75,11 @@ namespace Barotrauma
|
||||
|
||||
ApplyExplosionForces(worldPosition, attack.Range, force, attack.GetDamage(1.0f), attack.Stun);
|
||||
|
||||
if (flames)
|
||||
if (flames && GameMain.Client == null)
|
||||
{
|
||||
foreach (Item item in Item.ItemList)
|
||||
{
|
||||
if (item.CurrentHull != hull || item.FireProof || item.Condition <= 0.0f) continue;
|
||||
//if (item.ParentInventory != null) return;
|
||||
|
||||
if (Vector2.Distance(item.WorldPosition, worldPosition) > attack.Range * 0.1f) continue;
|
||||
|
||||
|
||||
@@ -280,10 +280,8 @@ namespace Barotrauma
|
||||
float range = (float)Math.Sqrt(size.X) * 10.0f;
|
||||
if (item.Position.X < position.X - range || item.Position.X > position.X + size.X + range) continue;
|
||||
if (item.Position.Y < position.Y - size.Y || item.Position.Y > hull.Rect.Y) continue;
|
||||
|
||||
//item.Condition -= (float)Math.Sqrt(size.X) * deltaTime;
|
||||
|
||||
item.ApplyStatusEffects(ActionType.OnFire, deltaTime);
|
||||
|
||||
if (GameMain.Client == null) item.ApplyStatusEffects(ActionType.OnFire, deltaTime);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user