Load old ObjectData correctly (#553)

* Load old ObjectData correctly

ITS changed ObjectDataStructs::OBJECT_BOMBS_AND_OTHER::ubBombOwner data size from 1 byte to 2 bytes, and it was not taken into account when loading ObjectData
This commit is contained in:
Asdow
2025-11-11 20:14:46 +02:00
committed by GitHub
parent 9ce1492651
commit 264105071a
3 changed files with 99 additions and 6 deletions
+28
View File
@@ -1179,6 +1179,34 @@ ObjectData& ObjectData::operator =(const ObjectData& src)
return *this;
}
ObjectData& ObjectData::operator =(const ObjectData_PRE_ITS& src)
{
if ((void*)this != (void*)&src)
{
//copy over the data
this->bTrap = src.bTrap;
this->fUsed = src.fUsed;
this->ubImprintID = src.ubImprintID;
this->bTemperature = src.bTemperature;
this->ubDirection = src.ubDirection;
this->ubWireNetworkFlag = src.ubWireNetworkFlag;
this->bDefuseFrequency = src.bDefuseFrequency;
this->sRepairThreshold = src.sRepairThreshold;
this->sObjectFlag = src.sObjectFlag;
//copy over the union
this->misc.bBombStatus = src.misc.bBombStatus;
this->misc.bDetonatorType = src.misc.bDetonatorType;
this->misc.usBombItem = src.misc.usBombItem;
this->misc.bDelay = src.misc.bDelay;
this->misc.ubBombOwner = static_cast<UINT16>(src.misc.ubBombOwner);
this->misc.bActionValue = src.misc.bActionValue;
this->misc.ubTolerance = src.misc.ubTolerance;
}
return *this;
}
ObjectData::~ObjectData()
{
DeleteLBE();