Check cell count for being at most 255 when saving

Not important for vanilla but it might surprise modders when their saves get truncated. Better than a static_assert on CELLS because that's further upstream, and mods might like to be able to work even if they can't save.
This commit is contained in:
Tamás Bálint Misius
2025-02-26 08:52:24 +01:00
parent 794045731a
commit 3e571db922

View File

@@ -2012,6 +2012,11 @@ void GameSave::readPSv(const std::vector<char> &dataVec)
std::pair<bool, std::vector<char>> GameSave::serialiseOPS() const
{
if (blockSize.X > 255 || blockSize.Y > 255)
{
throw BuildException("simulation size not supported by the save format");
}
// minimum version this save is compatible with
// when building, this number may be increased depending on what elements are used
// or what properties are detected