read the values in the same way as we write

This commit is contained in:
DrPerkyLegit
2026-07-14 20:01:44 -04:00
parent 3833d0f3b7
commit f583a53f7f

View File

@@ -184,7 +184,6 @@ void TextureAndGeometryPacket::read(DataInputStream *dis) //throws IOException
uiAnimOverrideBitmask = dis->readInt();
short rawBoxC = dis->readShort();
short rawOffsetC = dis->readShort();
if (rawBoxC <= 0)
{
dwBoxC = 0;
@@ -197,27 +196,12 @@ void TextureAndGeometryPacket::read(DataInputStream *dis) //throws IOException
dwBoxC = 0; // sane limit for skin boxes
}
}
if (rawOffsetC <= 0)
{
dwOffsetC = 0;
}
else
{
dwOffsetC = (DWORD)(unsigned short)rawOffsetC;
if (dwOffsetC > 256)
{
dwOffsetC = 0; // sane limit for skin offsets
}
}
if(dwBoxC>0)
{
this->BoxDataA= new SKIN_BOX [dwBoxC];
}
if(dwOffsetC>0)
{
this->OffsetDataA= new SKIN_OFFSET [dwOffsetC];
}
for(DWORD i=0;i<dwBoxC;i++)
{
@@ -234,6 +218,27 @@ void TextureAndGeometryPacket::read(DataInputStream *dis) //throws IOException
this->BoxDataA[i].fM = dis->readFloat();
this->BoxDataA[i].fS = dis->readFloat();
}
short rawOffsetC = dis->readShort();
if (rawOffsetC <= 0)
{
dwOffsetC = 0;
}
else
{
dwOffsetC = (DWORD)(unsigned short)rawOffsetC;
if (dwOffsetC > 256)
{
dwOffsetC = 0; // sane limit for skin offsets
}
}
if (dwOffsetC > 0)
{
this->OffsetDataA = new SKIN_OFFSET[dwOffsetC];
}
for(DWORD i=0;i<dwOffsetC;i++)
{
this->OffsetDataA[i].ePart = static_cast<eBodyOffset>(dis->readShort());