mirror of
https://github.com/ENSL/NS.git
synced 2025-02-08 16:52:21 +00:00
35 lines
790 B
C++
35 lines
790 B
C++
|
#include "AvHAISoundQueue.h"
|
||
|
#include "AvHAIPlayerManager.h"
|
||
|
|
||
|
std::vector<AvHAISound> PendingSounds;
|
||
|
|
||
|
void AISND_RegisterNewSound(int EntIndex, float* NewLocation, AvHAISoundType NewSoundType, float Volume)
|
||
|
{
|
||
|
if (!AIMGR_IsBotEnabled() || Volume < 0.01f) { return; }
|
||
|
|
||
|
AvHAISound NewSound;
|
||
|
NewSound.EntIndex = EntIndex;
|
||
|
NewSound.SoundLocation[0] = NewLocation[0];
|
||
|
NewSound.SoundLocation[1] = NewLocation[1];
|
||
|
NewSound.SoundLocation[2] = NewLocation[2];
|
||
|
NewSound.Volume = Volume;
|
||
|
NewSound.SoundType = NewSoundType;
|
||
|
|
||
|
PendingSounds.push_back(NewSound);
|
||
|
}
|
||
|
|
||
|
AvHAISound AISND_PopSound()
|
||
|
{
|
||
|
if (PendingSounds.size() == 0) { return AvHAISound(); }
|
||
|
|
||
|
AvHAISound Result = PendingSounds.back();
|
||
|
|
||
|
PendingSounds.pop_back();
|
||
|
|
||
|
return Result;
|
||
|
}
|
||
|
|
||
|
void AISND_ClearSounds()
|
||
|
{
|
||
|
PendingSounds.clear();
|
||
|
}
|