mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-07-31 13:40:12 +02:00
fix issue loading manually created SOAP bubbles in some saves
This commit is contained in:
@@ -203,22 +203,16 @@ int Simulation::Load(int fullX, int fullY, GameSave * save, bool includePressure
|
|||||||
std::map<unsigned int, unsigned int>::iterator n = soapList.find(parts[i].tmp);
|
std::map<unsigned int, unsigned int>::iterator n = soapList.find(parts[i].tmp);
|
||||||
if (n != end)
|
if (n != end)
|
||||||
parts[i].tmp = n->second;
|
parts[i].tmp = n->second;
|
||||||
else
|
// sometimes the proper SOAP isn't found. It should remove the link, but seems to break some saves
|
||||||
{
|
// so just ignore it
|
||||||
parts[i].tmp = 0;
|
|
||||||
parts[i].ctype ^= 2;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if ((parts[i].ctype & 0x4) == 4)
|
if ((parts[i].ctype & 0x4) == 4)
|
||||||
{
|
{
|
||||||
std::map<unsigned int, unsigned int>::iterator n = soapList.find(parts[i].tmp2);
|
std::map<unsigned int, unsigned int>::iterator n = soapList.find(parts[i].tmp2);
|
||||||
if (n != end)
|
if (n != end)
|
||||||
parts[i].tmp2 = n->second;
|
parts[i].tmp2 = n->second;
|
||||||
else
|
// sometimes the proper SOAP isn't found. It should remove the link, but seems to break some saves
|
||||||
{
|
// so just ignore it
|
||||||
parts[i].tmp2 = 0;
|
|
||||||
parts[i].ctype ^= 4;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user