Skip to content

Commit c63e521

Browse files
RaphaelIT7misyltoad
authored andcommitted
Made JoltPhysicsObject::GetName() functional
1 parent 50cef39 commit c63e521

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

vphysics_jolt/vjolt_object.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ JoltPhysicsObject::JoltPhysicsObject( JPH::Body *pBody, JoltPhysicsEnvironment *
3131
, m_pGameData( pParams->pGameData )
3232
, m_materialIndex( Max( nMaterialIndex, 0 ) ) // Sometimes we get passed -1.
3333
, m_flVolume( pParams->volume )
34+
, m_pName( pParams->pName )
3435
{
3536
// Josh:
3637
// Assert that m_pGameData is the first element, some games
@@ -916,8 +917,7 @@ const CPhysCollide *JoltPhysicsObject::GetCollide() const
916917

917918
const char *JoltPhysicsObject::GetName() const
918919
{
919-
// Slart: Jolt used to store debug names in JPH::Body, but it was removed. So now everybody's NoName.
920-
return "NoName";
920+
return m_pName;
921921
}
922922

923923
//-------------------------------------------------------------------------------------------------

vphysics_jolt/vjolt_object.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ class JoltPhysicsObject final : public IPhysicsObjectInterface
239239
// remain un-named offset by the vtable to get to this
240240
// instead of calling GetGameData().
241241
void *m_pGameData = nullptr;
242+
const char *m_pName = "NoName";
242243

243244
uint16 m_gameFlags = 0;
244245
uint16 m_gameIndex = 0;

0 commit comments

Comments
 (0)