Server notifies clients about junction boxes breaking (+ clients aren't allowed to break them), fixed explosion lightSource positioning
This commit is contained in:
@@ -63,8 +63,10 @@ namespace Barotrauma.Items.Components
|
||||
pt.currPowerConsumption += (-fullPower - pt.currPowerConsumption) / inertia;
|
||||
pt.Item.SendSignal(0, "", "power", fullPower / Math.Max(fullLoad, 1.0f));
|
||||
|
||||
//damage the item if voltage is too high
|
||||
if (-pt.currPowerConsumption < Math.Max(pt.powerLoad * Rand.Range(1.95f,2.05f), 200.0f)) continue;
|
||||
//damage the item if voltage is too high
|
||||
//(except if running as a client)
|
||||
if (GameMain.Client != null) continue;
|
||||
if (-pt.currPowerConsumption < Math.Max(pt.powerLoad * Rand.Range(1.9f,2.1f), 200.0f)) continue;
|
||||
|
||||
|
||||
float prevCondition = pt.item.Condition;
|
||||
|
||||
@@ -164,6 +164,8 @@ namespace Barotrauma
|
||||
condition = MathHelper.Clamp(value, 0.0f, 100.0f);
|
||||
if (condition == 0.0f && prev>0.0f)
|
||||
{
|
||||
new NetworkEvent(this.ID, false);
|
||||
|
||||
ApplyStatusEffects(ActionType.OnBroken, 1.0f, null);
|
||||
foreach (FixRequirement req in FixRequirements)
|
||||
{
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace Barotrauma
|
||||
float displayRange = attack.Range;
|
||||
if (displayRange < 0.1f) return;
|
||||
|
||||
light = new LightSource(worldPosition, displayRange, Color.LightYellow, hull != null ? hull.Submarine : null);
|
||||
light = new LightSource(worldPosition, displayRange, Color.LightYellow, null);
|
||||
CoroutineManager.StartCoroutine(DimLight());
|
||||
|
||||
float cameraDist = Vector2.Distance(GameMain.GameScreen.Cam.Position, worldPosition)/2.0f;
|
||||
@@ -86,8 +86,6 @@ namespace Barotrauma
|
||||
|
||||
if (Vector2.Distance(item.WorldPosition, worldPosition) > attack.Range * 0.1f) continue;
|
||||
|
||||
//item.Condition -= (float)Math.Sqrt(size.X) * deltaTime;
|
||||
|
||||
item.ApplyStatusEffects(ActionType.OnFire, 1.0f);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user