Skip to content

Commit a232546

Browse files
committed
update(player): Fix crash
1 parent 97a19fb commit a232546

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

src/components/Plugins/src/scripting/Player.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -334,14 +334,12 @@ SMM_API void scripting_Player_SetMatchStat(uint32 playerId, PlayerStat stat, int
334334
if (!playerController)
335335
return;
336336

337-
CSMatchStats_t *matchStats = &playerController->m_pActionTrackingServices->m_matchStats();
338-
339337
if (stat == PlayerStat::KILLS)
340-
matchStats->m_iKills = value;
338+
playerController->m_pActionTrackingServices->m_matchStats().m_iKills = value;
341339
else if (stat == PlayerStat::DAMAGE)
342-
matchStats->m_iDamage = value;
340+
playerController->m_pActionTrackingServices->m_matchStats().m_iDamage = value;
343341
else if (stat == PlayerStat::ASSISTS)
344-
matchStats->m_iAssists = value;
342+
playerController->m_pActionTrackingServices->m_matchStats().m_iAssists = value;
345343
else if (stat == PlayerStat::DEATHS)
346-
matchStats->m_iDeaths = value;
344+
playerController->m_pActionTrackingServices->m_matchStats().m_iDeaths = value;
347345
}

src/sdk/schema.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,10 @@ namespace sch
6969
ThisClass *pThisClass = (ThisClass *)((byte *)this - offset); \
7070
\
7171
if (m_chain != 0 && m_key.networked) \
72-
{ \
7372
g_Signatures->FetchSignature<NetworkStateChanged>("NetworkStateChanged")((uintptr_t)(pThisClass) + m_chain, m_key.offset + extra_offset, 0xFFFFFFFF); \
74-
} \
7573
else if (m_key.networked) \
7674
{ \
77-
if (!IsStruct) \
78-
SetStateChanged((Z_CBaseEntity *)pThisClass, m_key.offset + extra_offset); \
79-
else if (IsPlatformPosix()) /* This is currently broken on windows */ \
80-
CALL_VIRTUAL(void, 1, pThisClass, m_key.offset + extra_offset, 0xFFFFFFFF, 0xFFFF); \
75+
CALL_VIRTUAL(void, 1, pThisClass, m_key.offset + extra_offset, 0xFFFFFFFF, 0xFFFF); \
8176
} \
8277
*reinterpret_cast<std::add_pointer_t<type>>((uintptr_t)(pThisClass) + m_key.offset + extra_offset) = val; \
8378
} \

0 commit comments

Comments
 (0)