Skip to content

Commit 2572204

Browse files
committed
somehow, the compiler stopped emitting thunks for these functions in debug builds
1 parent ad83c30 commit 2572204

2 files changed

Lines changed: 1 addition & 13 deletions

File tree

src/game/client/swarm/rd_tooltip_fix.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,7 @@ static class CRD_Tooltip_Fix final : public CAutoGameSystem
2626
// There's only one method in the vtable, so let's just grab it.
2727
auto pApplySchemeSettings = **reinterpret_cast< void( vgui::Tooltip:: *const *const * )( vgui::IScheme * ) >( pTooltip );
2828

29-
#ifdef _DEBUG
30-
// This is a thunk, so we need to grab the real one.
31-
byte *pThunk = *reinterpret_cast< byte *const * >( &pApplySchemeSettings );
32-
Assert( *pThunk == 0xE9 );
33-
byte *pRealFunc = pThunk + 5 + *reinterpret_cast< const intptr_t * >( pThunk + 1 );
34-
#else
35-
// ...except in release builds, where it's not a thunk.
3629
byte *pRealFunc = *reinterpret_cast< byte *const * >( &pApplySchemeSettings );
37-
#endif
3830
Assert( *pRealFunc == 0xB9 );
3931

4032
// Grab the TextEntry handle that is read at the start of the method.

src/game/client/swarm/vgui/rd_vgui_settings_video.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,7 @@ static class CRD_VideoConfigVariableListHack : public CAutoGameSystem
2020
// videocfg.lib is statically linked, but the variable we need is marked as static, so we can't reference it using an extern.
2121
// Instead, we have to do this garbage:
2222
const byte *pUpdateCurrentVideoConfig = reinterpret_cast< const byte * >( &UpdateCurrentVideoConfig );
23-
#ifdef _DEBUG
24-
// Gotta deal with thunks on debug builds.
25-
Assert( *pUpdateCurrentVideoConfig == 0xE9 );
26-
pUpdateCurrentVideoConfig += 5 + *reinterpret_cast< const intptr_t * >( pUpdateCurrentVideoConfig + 1 );
27-
#endif
23+
2824
struct VideoConfigSetting_t
2925
{
3026
const char *m_szName;

0 commit comments

Comments
 (0)