-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathStreamAtPlayer.cpp
More file actions
65 lines (47 loc) · 1.52 KB
/
StreamAtPlayer.cpp
File metadata and controls
65 lines (47 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//
// by Weikton 05.09.23
//
#include "../main.h"
#include "../game/game.h"
#include "../net/netgame.h"
#include "StreamAtPlayer.h"
#include "StreamInfo.h"
extern CNetGame *pNetGame;
StreamAtPlayer::StreamAtPlayer(const uint32_t color, std::string name,
const float distance, const PLAYERID playerId) noexcept
: LocalStream(StreamType::LocalStreamAtPlayer, color, std::move(name), distance)
, playerId(playerId)
{}
void StreamAtPlayer::Tick() noexcept
{
this->LocalStream::Tick();
if(!pNetGame) return;
CPlayerPool *pPlayerPool = pNetGame->GetPlayerPool();
if(!pPlayerPool) return;
CRemotePlayer *pPlayer = pPlayerPool->GetAt(this->playerId);
if(!pPlayer) return;
CPlayerPed *pPlayerPed = pPlayer->GetPlayerPed();
if(!pPlayerPed) return;
MATRIX4X4 pPlayerMatrix;
pPlayerPed->GetMatrix(&pPlayerMatrix);
for(const auto& channel : this->GetChannels())
{
if(channel->HasSpeaker())
{
}
}
}
void StreamAtPlayer::OnChannelCreate(const Channel& channel) noexcept
{
static const BASS_3DVECTOR kZeroVector { 0, 0, 0 };
this->LocalStream::OnChannelCreate(channel);
if(!pNetGame) return;
CPlayerPool *pPlayerPool = pNetGame->GetPlayerPool();
if(!pPlayerPool) return;
CRemotePlayer *pPlayer = pPlayerPool->GetAt(this->playerId);
if(!pPlayer) return;
CPlayerPed *pPlayerPed = pPlayer->GetPlayerPed();
if(!pPlayerPed) return;
MATRIX4X4 pPlayerMatrix;
pPlayerPed->GetMatrix(&pPlayerMatrix);
}