[x] I have searched the issue tracker to check if the issue has already been reported.
Description
Connecting the power connection to a different pin that is not power_in will allow the turret to shoot and take no power from the super capacitors
Steps To Reproduce
Load up the humpback, rewire a turret so the power coming in goes to set light instead of the power pin.
Fire the turret when it has sufficient charge
Charge of the capacitor won't go down.
Version
Windows v0.17.12.0 & Unstable v0.17.13.0
Additional information
The problem arises from the GetAvailableInstantaneousBatteryPower function in Powered.cs
It looks through all directly connected powerContainers to any of the turret's pins.
Hence it sees the capacity of the connected capacitor's and passes the check to fire.
But the firing function of the turret gets the connected powerContainers uses the GetConnectedBatteries function in Powered.cs
Which uses the new grids to find all the output side connected powerContainers on a grid only on the power_In pin.
Hence the power check is passed and the action of drawing power finds no powerContainers and doesn't take from them.
This also brings up the other inconsistency that the turret is only considering devices directly connected to the turret and not the grid.
Thus trying to power a turret through a junction box connected to a superCapacitor won't work.
Also just to entertain the idea, but possibly since discharge coils can draw a load from the grid instead of taking directly from batteries, maybe turrets should do the same? This would allow for relays (provided sufficient throughput) can be used to switch super capacitor between turrets or for a reactor that is overloading to power turrets directly.
Description Connecting the power connection to a different pin that is not power_in will allow the turret to shoot and take no power from the super capacitors
Steps To Reproduce Load up the humpback, rewire a turret so the power coming in goes to set light instead of the power pin. Fire the turret when it has sufficient charge Charge of the capacitor won't go down.
Version Windows v0.17.12.0 & Unstable v0.17.13.0
Additional information The problem arises from the GetAvailableInstantaneousBatteryPower function in Powered.cs It looks through all directly connected powerContainers to any of the turret's pins. Hence it sees the capacity of the connected capacitor's and passes the check to fire. But the firing function of the turret gets the connected powerContainers uses the GetConnectedBatteries function in Powered.cs Which uses the new grids to find all the output side connected powerContainers on a grid only on the power_In pin. Hence the power check is passed and the action of drawing power finds no powerContainers and doesn't take from them. This also brings up the other inconsistency that the turret is only considering devices directly connected to the turret and not the grid. Thus trying to power a turret through a junction box connected to a superCapacitor won't work.
Also just to entertain the idea, but possibly since discharge coils can draw a load from the grid instead of taking directly from batteries, maybe turrets should do the same? This would allow for relays (provided sufficient throughput) can be used to switch super capacitor between turrets or for a reactor that is overloading to power turrets directly.