The mass mover clears its data when loading fails

Happened in some cases when changing a scenario section.
David Dormagen 2011-07-16 21:57:14 +00:00
parent a667e0beb6
commit 42e5c6cbec
1 changed files with 2 additions and 2 deletions

View File

@ -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;