When I save and load stockpile settings with stockpile management plugin, then saved barrels count will be loaded in bins and barrels are zero. So I think this change should correct it.
From #964, protobuf exceptions in loadstock/savestock would either fail by only
logging an error to the console (when run from the Lua UI) or by crashing the
game entirely (when run from the console).
Figuring out what actually causes the exceptions in the first place (possibly a
misunderstood structure layout?) would be a better solution than this, but this
will at least stop crashes for now.
Previously, it was possible to save outside of the stocksettings
directory or fail to save in a nonexistent subdirectory (e.g. when
a stockpile name had slashes in it).
Resolves#621
The file was approaching 3000 lines and contained multiple classes,
making it a real PITA to navigate through. upcoming features would only
add more LOC, so splitting was necessary.