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:
Regalis
2017-04-03 20:48:09 +03:00
parent e75d596d34
commit 6895cdbd7d
2 changed files with 3 additions and 6 deletions

View File

@@ -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;

View File

@@ -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);
}
}