Server notifies clients about junction boxes breaking (+ clients aren't allowed to break them), fixed explosion lightSource positioning

This commit is contained in:
Regalis
2016-04-22 17:28:22 +03:00
parent c2242ad525
commit 3347fcdd20
3 changed files with 7 additions and 5 deletions

View File

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

View File

@@ -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)
{