Fix SMES issues
Created by: clusterfack
Fixes #4095 (closed), why exactly was it just checking if there was ANY POWER and then draining MORE POWER THAN EXISTED in the powernet? Better question, how did it ever work properly like this in the past?
Fixes #4076 (closed), lastout wasn't being set to 0 when smes stopped outputting
Obviously SMES are delicate special snowflakes so make sure to look this over carefully