forked from Mirrors/openclonk
The mass mover clears its data when loading fails
Happened in some cases when changing a scenario section.
parent
a667e0beb6
commit
42e5c6cbec
|
@ -219,11 +219,11 @@ bool C4MassMoverSet::Save(C4Group &hGroup)
|
|||
|
||||
bool C4MassMoverSet::Load(C4Group &hGroup)
|
||||
{
|
||||
// clear previous
|
||||
Clear(); Default();
|
||||
size_t iBinSize,iMoverSize=sizeof(C4MassMover);
|
||||
if (!hGroup.AccessEntry(C4CFN_MassMover,&iBinSize)) return false;
|
||||
if ((iBinSize % iMoverSize)!=0) return false;
|
||||
// clear previous
|
||||
Clear(); Default();
|
||||
// load new
|
||||
Count = iBinSize / iMoverSize;
|
||||
if (!hGroup.Read(Set,iBinSize)) return false;
|
||||
|
|
Loading…
Reference in New Issue