Added code for skin offsets

Added code to the file which have the functionality to get skin boxes and duplicated the functionality for skin offsets. The code causes the game to crash when switching to third person. The error occurs with the skin offsets returning as an empty class object.
This commit is contained in:
Langtanium
2026-04-02 17:07:48 -07:00
parent 48e84a9dc4
commit 3888de7ab4
16 changed files with 320 additions and 10 deletions

View File

@@ -898,9 +898,10 @@ void PlayerConnection::handleTextureAndGeometry(shared_ptr<TextureAndGeometryPac
{
// we don't have the dlc skin, so retrieve the data from the app store
vector<SKIN_BOX *> *pvSkinBoxes = app.GetAdditionalSkinBoxes(packet->dwSkinID);
vector<SKIN_OFFSET *> *pvSkinOffsets = app.GetModelOffsets(packet->dwSkinID);
unsigned int uiAnimOverrideBitmask= app.GetAnimOverrideBitmask(packet->dwSkinID);
send(std::make_shared<TextureAndGeometryPacket>(packet->textureName, pbData, dwTextureBytes, pvSkinBoxes, uiAnimOverrideBitmask));
send(std::make_shared<TextureAndGeometryPacket>(packet->textureName, pbData, dwTextureBytes, pvSkinBoxes, pvSkinOffsets, uiAnimOverrideBitmask));
}
}
else
@@ -924,6 +925,14 @@ void PlayerConnection::handleTextureAndGeometry(shared_ptr<TextureAndGeometryPac
#endif
app.SetAdditionalSkinBoxes(packet->dwSkinID,packet->BoxDataA,packet->dwBoxC);
}
// add the offsets to the app list
if(packet->dwOffsetC!=0)
{
#ifndef _CONTENT_PACKAGE
wprintf(L"Adding skin offsets for skin id %X, offset count %d\n",packet->dwSkinID,packet->dwOffsetC);
#endif
app.SetSkinOffsets(packet->dwSkinID,packet->OffsetDataA,packet->dwOffsetC);
}
// Add the anim override
app.SetAnimOverrideBitmask(packet->dwSkinID,packet->uiAnimOverrideBitmask);
@@ -973,9 +982,10 @@ void PlayerConnection::handleTextureAndGeometryReceived(const wstring &textureNa
// get the data from the app
DWORD dwSkinID = app.getSkinIdFromPath(textureName);
vector<SKIN_BOX *> *pvSkinBoxes = app.GetAdditionalSkinBoxes(dwSkinID);
vector<SKIN_OFFSET *> *pvSkinOffsets = app.GetModelOffsets(dwSkinID);
unsigned int uiAnimOverrideBitmask= app.GetAnimOverrideBitmask(dwSkinID);
send(std::make_shared<TextureAndGeometryPacket>(textureName, pbData, dwTextureBytes, pvSkinBoxes, uiAnimOverrideBitmask));
send(std::make_shared<TextureAndGeometryPacket>(textureName, pbData, dwTextureBytes, pvSkinBoxes, pvSkinOffsets, uiAnimOverrideBitmask));
}
m_texturesRequested.erase(it);
}