aboutsummaryrefslogtreecommitdiff
path: root/mp/src/game/shared/choreoscene.cpp
diff options
context:
space:
mode:
authorMichael Sartain <[email protected]>2014-10-02 08:25:55 -0700
committerMichael Sartain <[email protected]>2014-10-02 08:25:55 -0700
commit55ed12f8d1eb6887d348be03aee5573d44177ffb (patch)
tree3686f7ca78c780cd9a3d367b79a9d9250c1be7c0 /mp/src/game/shared/choreoscene.cpp
parent* Added support for Visual C++ 2013 Express to VPC (diff)
downloadsource-sdk-2013-55ed12f8d1eb6887d348be03aee5573d44177ffb.tar.xz
source-sdk-2013-55ed12f8d1eb6887d348be03aee5573d44177ffb.zip
Updated the SDK with the latest code from the TF and HL2 branches.
Diffstat (limited to 'mp/src/game/shared/choreoscene.cpp')
-rw-r--r--mp/src/game/shared/choreoscene.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/mp/src/game/shared/choreoscene.cpp b/mp/src/game/shared/choreoscene.cpp
index 734e89be..b77c94b8 100644
--- a/mp/src/game/shared/choreoscene.cpp
+++ b/mp/src/game/shared/choreoscene.cpp
@@ -156,6 +156,7 @@ CChoreoScene& CChoreoScene::operator=( const CChoreoScene& src )
m_pTokenizer = src.m_pTokenizer;
m_flCurrentTime = src.m_flCurrentTime;
+ m_flStartLoopTime = src.m_flStartLoopTime;
m_flStartTime = src.m_flStartTime;
m_flEndTime = src.m_flEndTime;
m_flSoundSystemLatency = src.m_flSoundSystemLatency;
@@ -234,6 +235,7 @@ void CChoreoScene::Init( IChoreoEventCallback *callback )
m_szMapname[ 0 ] = 0;
m_flCurrentTime = 0.0f;
+ m_flStartLoopTime = -1.f;
m_flStartTime = 0.0f;
m_flEndTime = 0.0f;
m_flSoundSystemLatency = 0.0f;
@@ -2312,6 +2314,8 @@ void CChoreoScene::ResetSimulation( bool forward /*= true*/, float starttime /*=
m_flCurrentTime = forward ? m_flEarliestTime : m_flLatestTime;
+ m_flStartLoopTime = -1.f;
+
// choreoprintf( 0, "Start time %f\n", m_flCurrentTime );
m_flLastActiveTime = 0.0f;
@@ -2473,6 +2477,15 @@ int CChoreoScene::EventThink( CChoreoEvent *e, float frame_start_time, float fra
}
}
*/
+
+ if ( !suppressed )
+ {
+ // if this SPEAK event starts before the beginning of the current loop, don't play the SPEAK event again in the loop
+ if ( m_flStartLoopTime >= 0.f && starttime < m_flStartLoopTime )
+ {
+ return iret;
+ }
+ }
}
break;
case CChoreoEvent::SUBSCENE:
@@ -2836,6 +2849,8 @@ void CChoreoScene::SetTime( float t )
void CChoreoScene::LoopToTime( float t )
{
m_flCurrentTime = t;
+
+ m_flStartLoopTime = t;
}
//-----------------------------------------------------------------------------