mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-21 07:31:26 +02:00
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:
@@ -2012,6 +2012,11 @@ void GameSave::readPSv(const std::vector<char> &dataVec)
|
|||||||
|
|
||||||
std::pair<bool, std::vector<char>> GameSave::serialiseOPS() const
|
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
|
// minimum version this save is compatible with
|
||||||
// when building, this number may be increased depending on what elements are used
|
// when building, this number may be increased depending on what elements are used
|
||||||
// or what properties are detected
|
// or what properties are detected
|
||||||
|
Reference in New Issue
Block a user