Compatability with sawmills. (#60)

This commit is contained in:
Pieter-Jan Briers
2018-04-19 20:23:49 +02:00
committed by GitHub
parent 41bda76980
commit 74193d1182
2 changed files with 13 additions and 13 deletions

View File

@@ -84,7 +84,7 @@ namespace Content.Server.GameObjects.Components.Power
return; return;
} }
//Storage doesn't have anything, depower everything //Storage doesn't have anything, depower everything
else if(storage.RequestAllCharge() == 0) else if (storage.RequestAllCharge() == 0)
{ {
DepowerAllDevices(); DepowerAllDevices();
return; return;
@@ -130,7 +130,7 @@ namespace Content.Server.GameObjects.Components.Power
foreach (var entity in entities) foreach (var entity in entities)
{ {
var device = entity.GetComponent<PowerDeviceComponent>(); var device = entity.GetComponent<PowerDeviceComponent>();
//Make sure the device can accept power providers to give it power //Make sure the device can accept power providers to give it power
if (device.Drawtype == DrawTypes.Provider || device.Drawtype == DrawTypes.Both) if (device.Drawtype == DrawTypes.Provider || device.Drawtype == DrawTypes.Both)
{ {
@@ -194,7 +194,7 @@ namespace Content.Server.GameObjects.Components.Power
else else
{ {
var name = device.Owner.Prototype.Name; var name = device.Owner.Prototype.Name;
Logger.Log(String.Format("We tried to remove a device twice from the same {0} somehow, prototype {1}", Name, name)); Logger.Info(String.Format("We tried to remove a device twice from the same {0} somehow, prototype {1}", Name, name));
} }
} }
} }

View File

@@ -152,11 +152,11 @@ namespace Content.Server.GameObjects.Components.Power
{ {
PowerAllDevices(); //This merely makes our inevitable betrayal all the sweeter PowerAllDevices(); //This merely makes our inevitable betrayal all the sweeter
RetrievePassiveStorage(); RetrievePassiveStorage();
var depowervalue = activeload - (activesupply + passivesupply); var depowervalue = activeload - (activesupply + passivesupply);
//Providers use same method to recreate functionality //Providers use same method to recreate functionality
foreach(var device in Deviceloadlist) foreach (var device in Deviceloadlist)
{ {
device.Powered = false; device.Powered = false;
DepoweredDevices.Add(device); DepoweredDevices.Add(device);
@@ -169,7 +169,7 @@ namespace Content.Server.GameObjects.Components.Power
private void PowerAllDevices() private void PowerAllDevices()
{ {
foreach(var device in DepoweredDevices) foreach (var device in DepoweredDevices)
{ {
device.Powered = true; device.Powered = true;
} }
@@ -206,7 +206,7 @@ namespace Content.Server.GameObjects.Components.Power
public void DirtyKill() public void DirtyKill()
{ {
Wirelist.Clear(); Wirelist.Clear();
while(Nodelist.Count != 0) while (Nodelist.Count != 0)
{ {
Nodelist[0].DisconnectFromPowernet(); Nodelist[0].DisconnectFromPowernet();
} }
@@ -291,7 +291,7 @@ namespace Content.Server.GameObjects.Components.Power
/// </summary> /// </summary>
public void UpdateDevice(PowerDeviceComponent device, float oldLoad) public void UpdateDevice(PowerDeviceComponent device, float oldLoad)
{ {
if(Deviceloadlist.Contains(device)) if (Deviceloadlist.Contains(device))
{ {
Load -= oldLoad; Load -= oldLoad;
Load += device.Load; Load += device.Load;
@@ -303,7 +303,7 @@ namespace Content.Server.GameObjects.Components.Power
/// </summary> /// </summary>
public void RemoveDevice(PowerDeviceComponent device) public void RemoveDevice(PowerDeviceComponent device)
{ {
if(Deviceloadlist.Contains(device)) if (Deviceloadlist.Contains(device))
{ {
Load -= device.Load; Load -= device.Load;
Deviceloadlist.Remove(device); Deviceloadlist.Remove(device);
@@ -313,7 +313,7 @@ namespace Content.Server.GameObjects.Components.Power
else else
{ {
var name = device.Owner.Prototype.Name; var name = device.Owner.Prototype.Name;
Logger.Log(String.Format("We tried to remove a device twice from the same powernet somehow, prototype {0}", name)); Logger.Info(String.Format("We tried to remove a device twice from the same powernet somehow, prototype {0}", name));
} }
} }
@@ -352,7 +352,7 @@ namespace Content.Server.GameObjects.Components.Power
else else
{ {
var name = generator.Owner.Prototype.Name; var name = generator.Owner.Prototype.Name;
Logger.Log(String.Format("We tried to remove a device twice from the same power somehow, prototype {1}", name)); Logger.Info(String.Format("We tried to remove a device twice from the same power somehow, prototype {1}", name));
} }
} }
@@ -361,12 +361,12 @@ namespace Content.Server.GameObjects.Components.Power
/// </summary> /// </summary>
public void AddPowerStorage(PowerStorageComponent storage) public void AddPowerStorage(PowerStorageComponent storage)
{ {
if(storage.ChargePowernet) if (storage.ChargePowernet)
PowerStorageSupplierlist.Add(storage); PowerStorageSupplierlist.Add(storage);
else else
PowerStorageConsumerlist.Add(storage); PowerStorageConsumerlist.Add(storage);
} }
//How do I even call this? TODO: fix //How do I even call this? TODO: fix
public void UpdateStorageType(PowerStorageComponent storage) public void UpdateStorageType(PowerStorageComponent storage)
{ {