NSTalkMonster: pause CHAN_VOICE and resume when unpaused.
This commit is contained in:
parent
7d780118ae
commit
ef6c200751
4 changed files with 22 additions and 2 deletions
|
@ -19,7 +19,7 @@
|
|||
which is our basic entity model.
|
||||
|
||||
This is a very low-level class. You're never meant to use this.
|
||||
Use NSEntity as a basis for your classes
|
||||
Use NSEntity as a basis for your classes.
|
||||
*/
|
||||
|
||||
class NSIO
|
||||
|
@ -50,11 +50,15 @@ class NSIO
|
|||
|
||||
virtual void(float) Save;
|
||||
virtual void(string,string) Restore;
|
||||
|
||||
/* save game */
|
||||
nonvirtual void(float, string, float) SaveFloat;
|
||||
nonvirtual void(float, string, int) SaveInt;
|
||||
nonvirtual void(float, string, string) SaveString;
|
||||
nonvirtual void(float, string, vector) SaveVector;
|
||||
nonvirtual void(float, string, bool) SaveBool;
|
||||
|
||||
/* load game */
|
||||
nonvirtual float(string) ReadFloat;
|
||||
nonvirtual int(string) ReadInt;
|
||||
nonvirtual string(string) ReadString;
|
||||
|
|
|
@ -222,7 +222,8 @@ class NSMonster:NSSurfacePropEntity
|
|||
|
||||
void(void) NSMonster;
|
||||
|
||||
#ifdef SERVER
|
||||
#ifdef SERVER
|
||||
/* overrides */
|
||||
virtual void(float) Save;
|
||||
virtual void(string,string) Restore;
|
||||
|
||||
|
|
|
@ -72,6 +72,8 @@ class NSTalkMonster:NSMonster
|
|||
sound_t *m_pSentenceQue;
|
||||
int m_iSentenceCount;
|
||||
int m_iSentencePos;
|
||||
float m_sndVoiceOffs;
|
||||
bool m_bWasPaused;
|
||||
#endif
|
||||
|
||||
void(void) NSTalkMonster;
|
||||
|
|
|
@ -777,6 +777,19 @@ NSTalkMonster::predraw(void)
|
|||
m_flBaseTime = frame1time;
|
||||
ProcessWordQue();
|
||||
|
||||
if (serverkeyfloat(SERVERKEY_PAUSESTATE) != 1) {
|
||||
if (m_bWasPaused == true) {
|
||||
soundupdate(this, CHAN_VOICE, "", 1.0, ATTN_NORM, 0, 0, -m_sndVoiceOffs);
|
||||
}
|
||||
m_sndVoiceOffs = getsoundtime(this, CHAN_VOICE);
|
||||
m_bWasPaused = false;
|
||||
} else {
|
||||
if (m_bWasPaused == false) {
|
||||
soundupdate(this, CHAN_VOICE, "", 0.0, ATTN_NORM, 0, 0, -m_sndVoiceOffs);
|
||||
}
|
||||
m_bWasPaused = true;
|
||||
}
|
||||
|
||||
return render;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue