Skip to content

Commit fbaefcf

Browse files
committed
[xrGame] Fix voice chat, enable it for all mp modes
1 parent a0ce0c3 commit fbaefcf

File tree

5 files changed

+15
-12
lines changed

5 files changed

+15
-12
lines changed

src/xrGame/game_cl_freemp.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,3 @@ void game_cl_freemp::OnScreenResolutionChanged()
200200
}
201201
}
202202

203-
void game_cl_freemp::OnVoiceMessage(NET_Packet* P)
204-
{
205-
m_pVoiceChat->ReceiveMessage(P);
206-
}
207-

src/xrGame/game_cl_freemp.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ class game_cl_freemp :public game_cl_mp
3838

3939
virtual void OnScreenResolutionChanged();
4040

41-
private:
42-
void OnVoiceMessage(NET_Packet* P);
43-
4441
private:
4542

4643
};

src/xrGame/game_cl_mp.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1895,3 +1895,8 @@ void game_cl_mp::ProcessPlayersInfoReply(NET_Packet& P)
18951895
tmp_cb(info_count);
18961896
}
18971897
}
1898+
1899+
void game_cl_mp::OnVoiceMessage(NET_Packet* P)
1900+
{
1901+
m_pVoiceChat->ReceiveMessage(P);
1902+
}

src/xrGame/game_cl_mp.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,6 @@ class game_cl_mp : public game_cl_GameState
180180
virtual void TranslateGameMessage(u32 msg, NET_Packet& P);
181181
virtual void CommonMessageOut(pcstr msg);
182182

183-
virtual bool OnKeyboardPress(int key);
184-
virtual bool OnKeyboardRelease(int key);
185-
CVoiceChat* m_pVoiceChat = nullptr;
186-
187183
virtual bool CanBeReady() { return true; };
188184
virtual void shedule_Update(u32 dt);
189185
bool IsLocalPlayerInitialized() const;
@@ -313,6 +309,12 @@ class game_cl_mp : public game_cl_GameState
313309
//-------------------------------------------------------------------------------------------------
314310
static xr_string generate_file_name(const xr_string& base_name, const time_t* date_time = nullptr);
315311
static xr_string sanitize_filename(const xr_string& base_name);
312+
313+
virtual bool OnKeyboardPress(int key);
314+
virtual bool OnKeyboardRelease(int key);
315+
CVoiceChat* m_pVoiceChat = nullptr;
316+
private:
317+
virtual void OnVoiceMessage(NET_Packet* P);
316318
//-------------------------------------------------------------------------------------------------
317319
#include "game_cl_mp_messages_menu.h"
318320
};

src/xrGame/xrGame.vcxproj.filters

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6374,6 +6374,8 @@
63746374
<ClInclude Include="net_physics_state.h">
63756375
<Filter>AI\AMonsters\common\net</Filter>
63766376
</ClInclude>
6377+
<ClInclude Include="VoiceChat.h" />
6378+
<ClInclude Include="VoiceSender.h" />
63776379
</ItemGroup>
63786380
<ItemGroup>
63796381
<ClCompile Include="damage_manager.cpp">
@@ -9624,6 +9626,8 @@
96249626
<ClCompile Include="game_sv_freemp_upgrade_and_repair.cpp">
96259627
<Filter>Core\Server\Games\client\freemp</Filter>
96269628
</ClCompile>
9629+
<ClCompile Include="VoiceChat.cpp" />
9630+
<ClCompile Include="VoiceSender.cpp" />
96279631
</ItemGroup>
96289632
<ItemGroup>
96299633
<Natvis Include="..\OpenXRay.natvis" />

0 commit comments

Comments
 (0)