Skip to content

Commit 222bd4c

Browse files
committed
Tweak soundEnable PR a bit
1 parent a10305d commit 222bd4c

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

Client/game_sa/CFxManagerSA.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ CFxSystem* CFxManagerSA::CreateFxSystem( const char * szBlueprint, const CVector
1717
const CVector * pvecPosition = &vecPosition;
1818
DWORD dwThis = ( DWORD ) m_pInterface;
1919
DWORD dwFunc = FUNC_FxManager_c__CreateFxSystem;
20-
DWORD dwReturn = 0;
20+
CFxSystemSAInterface* pFxSystem;
2121

2222
_asm
2323
{
@@ -27,19 +27,18 @@ CFxSystem* CFxManagerSA::CreateFxSystem( const char * szBlueprint, const CVector
2727
push pvecPosition
2828
push szBlueprint
2929
call dwFunc
30-
mov dwReturn, eax
30+
mov pFxSystem, eax
3131
}
3232

33-
if ( dwReturn != 0 )
33+
if (pFxSystem)
3434
{
35-
if ( !bSoundEnable )
36-
* ( DWORD * )( ( DWORD )dwReturn + 0x100 ) = NULL;
35+
if (!bSoundEnable)
36+
pFxSystem->audioEntity.audio = nullptr;
3737

38-
CFxSystemSA* pFxSystemSA = new CFxSystemSA((CFxSystemSAInterface*)dwReturn);
38+
CFxSystemSA* pFxSystemSA = new CFxSystemSA(pFxSystem);
3939
return pFxSystemSA;
4040
}
41-
else
42-
return NULL;
41+
return nullptr;
4342
}
4443

4544
void CFxManagerSA::DestroyFxSystem(CFxSystem* pFxSystem)

Client/game_sa/CFxSystemSA.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,12 @@
4343

4444
class CAEFireAudioEntitySAInterface
4545
{
46+
public:
4647
// this derives from CAEAudioEntity
4748
// todo: reverse this structure and CAEAudioEntity
48-
int unk[0x22];
49+
std::int32_t pad1[0x21];
50+
51+
void* audio; // 0x84 // TODO: Reverse what this __exactly__ is
4952
};
5053
static_assert(sizeof(CAEFireAudioEntitySAInterface) == 0x88, "Invalid size for CAEFireAudioEntitySAInterface");
5154

0 commit comments

Comments
 (0)