diff --git a/Subsurface/Content/Items/Electricity/poweritems.xml b/Subsurface/Content/Items/Electricity/poweritems.xml index a57442421..fb0260648 100644 --- a/Subsurface/Content/Items/Electricity/poweritems.xml +++ b/Subsurface/Content/Items/Electricity/poweritems.xml @@ -41,7 +41,27 @@ - + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Subsurface/Content/Items/Electricity/supercapacitor.png b/Subsurface/Content/Items/Electricity/supercapacitor.png new file mode 100644 index 000000000..46eab4595 Binary files /dev/null and b/Subsurface/Content/Items/Electricity/supercapacitor.png differ diff --git a/Subsurface/Content/Items/idcard.xml b/Subsurface/Content/Items/idcard.xml index 045bd351d..8e75e69f1 100644 --- a/Subsurface/Content/Items/idcard.xml +++ b/Subsurface/Content/Items/idcard.xml @@ -5,9 +5,9 @@ Tags="smallitem" pickdistance="150"> - + - + diff --git a/Subsurface/Source/Items/Components/Turret.cs b/Subsurface/Source/Items/Components/Turret.cs index 4a3ef3a9d..7a899881d 100644 --- a/Subsurface/Source/Items/Components/Turret.cs +++ b/Subsurface/Source/Items/Components/Turret.cs @@ -121,8 +121,31 @@ namespace Subsurface.Items.Components if (reload > 0.0f) return false; Projectile projectileComponent = null; + //search for a projectile from linked containers + Item projectile = null; + foreach (MapEntity e in item.linkedTo) + { + Item container = e as Item; + if (container == null) continue; + + ItemContainer containerComponent = container.GetComponent(); + if (containerComponent == null) continue; + + for (int i = 0; i < containerComponent.inventory.items.Length; i++) + { + if (containerComponent.inventory.items[i] == null) continue; + if ((projectileComponent = containerComponent.inventory.items[i].GetComponent()) != null) + { + projectile = containerComponent.inventory.items[i]; + break; + } + } + + if (projectileComponent != null) break; + } + + if (projectile == null || projectileComponent == null) return false; - //currPowerConsumption = powerConsumption; float availablePower = 0.0f; //List batteries = new List(); @@ -147,31 +170,6 @@ namespace Subsurface.Items.Components if (availablePower < currPowerConsumption) return false; - //search for a projectile from linked containers - Item projectile = null; - foreach (MapEntity e in item.linkedTo) - { - Item container = e as Item; - if (container == null) continue; - - ItemContainer containerComponent = container.GetComponent(); - if (containerComponent == null) continue; - - for (int i = 0; i < containerComponent.inventory.items.Length; i++) - { - if (containerComponent.inventory.items[i] == null) continue; - if ((projectileComponent = containerComponent.inventory.items[i].GetComponent()) != null) - { - projectile = containerComponent.inventory.items[i]; - break; - } - } - - if (projectileComponent != null) break; - } - - if (projectile == null || projectileComponent==null) return false; - projectile.body.ResetDynamics(); projectile.body.Enabled = true; projectile.SetTransform(ConvertUnits.ToSimUnits(new Vector2(item.Rect.X + barrelPos.X, item.Rect.Y - barrelPos.Y)), -rotation); diff --git a/Subsurface/Subsurface.csproj b/Subsurface/Subsurface.csproj index 95a6a0383..616b23517 100644 --- a/Subsurface/Subsurface.csproj +++ b/Subsurface/Subsurface.csproj @@ -315,6 +315,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest @@ -594,6 +597,7 @@ PreserveNewest + Designer PreserveNewest diff --git a/Subsurface_Solution.v12.suo b/Subsurface_Solution.v12.suo index 3a2a29164..07e54b4b4 100644 Binary files a/Subsurface_Solution.v12.suo and b/Subsurface_Solution.v12.suo differ