mirror of
https://github.com/YGGverse/hlsdk-portable.git
synced 2025-02-04 11:04:28 +00:00
Fix linear move bug
This commit is contained in:
parent
9812574734
commit
7999455e9f
@ -26,6 +26,7 @@
|
||||
#include "saverestore.h"
|
||||
#include "nodes.h"
|
||||
#include "doors.h"
|
||||
#include "game.h"
|
||||
|
||||
extern CGraph WorldGraph;
|
||||
|
||||
@ -428,6 +429,20 @@ After moving, set origin to exact final destination, call "move done" function
|
||||
*/
|
||||
void CBaseToggle::LinearMoveDone( void )
|
||||
{
|
||||
// stupid bug: Linear move is broken during changelevel
|
||||
if( mp_coop.value && pev->globalname )
|
||||
{
|
||||
Vector vecDestDelta = m_vecFinalDest - pev->origin;
|
||||
if( vecDestDelta.Length() > 50 )
|
||||
{
|
||||
pev->nextthink = -1;
|
||||
float speed = pev->velocity.Length();
|
||||
if( speed < 10 )
|
||||
speed = 10;
|
||||
LinearMove( m_vecFinalDest, 10);
|
||||
return;
|
||||
}
|
||||
}
|
||||
UTIL_SetOrigin( pev, m_vecFinalDest );
|
||||
pev->velocity = g_vecZero;
|
||||
pev->nextthink = -1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user