Bugfix to ship construction

If an engine isn't present on the design(and this is the only case where
this could happen) an index for an array could be -1, this has been
fixed.