mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-04-23 08:14:51 +02:00
Fix some cases of bogus missing element warnings
Namely, the ones caused by element numbers already invalid at the time of saving. This makes it impossible to intentionally have invalid element numbers in the low bits of properties listed in CarriesTypeIn, but these bits are considered to be under TPT's control anyway, so this is ok.
This commit is contained in:
parent
2b0ee9392c
commit
09ba266165
@ -2206,8 +2206,15 @@ std::pair<bool, std::vector<char>> GameSave::serialiseOPS() const
|
||||
{
|
||||
if (elements[part.type].CarriesTypeIn & (1U << index))
|
||||
{
|
||||
auto *prop = reinterpret_cast<const int *>(reinterpret_cast<const char *>(&part) + properties[index].Offset);
|
||||
paletteSet.insert(TYP(*prop));
|
||||
auto *prop = reinterpret_cast<int *>(reinterpret_cast<char *>(&part) + properties[index].Offset);
|
||||
if (sd.IsElement(TYP(*prop)))
|
||||
{
|
||||
paletteSet.insert(TYP(*prop));
|
||||
}
|
||||
else
|
||||
{
|
||||
*prop = PMAP(ID(*prop), 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user