This commit is contained in:
Paul 2001-08-08 16:54:00 +00:00
parent c2acfb3d6f
commit 0a38b50d9e
2 changed files with 24 additions and 2 deletions

View File

@ -767,6 +767,13 @@ if(newmode!=-1)
///
// Pending teleport?
if(m_teleportPending)
{
processTeleportToCommand();
}
for(i=0;i<_frames;i++)
{
updatePadInput();
@ -1809,16 +1816,26 @@ void CPlayer::teleportTo(int _x,int _y)
{
DVECTOR pos={_x,_y};
m_teleportPendingPos=pos;
m_teleportPending=true;
}
void CPlayer::processTeleportToCommand()
{
ASSERT(m_teleportPending);
CameraBox releaseCamBox={0,0,29999,29999};
setCameraBox(releaseCamBox);
setPos(pos);
setRespawnPos(pos);
setPos(m_teleportPendingPos);
setRespawnPos(m_teleportPendingPos);
calcCameraFocusPointTarget();
m_currentCamFocusPoint=m_currentCamFocusPointTarget;
m_teleportPending=false;
}
/*----------------------------------------------------------------------
Function:
Purpose:
@ -1954,6 +1971,7 @@ void CPlayer::respawn()
m_ignoreNewlyPressedButtonsOnPadThisThink=true;
m_canExitLevel=false;
m_teleportPending=false;
}
/*----------------------------------------------------------------------

View File

@ -276,6 +276,10 @@ public:
void teleportTo(int _x,int _y);
private:
void processTeleportToCommand();
int m_teleportPending;
DVECTOR m_teleportPendingPos;
void playAnimFrameSfx(int _animNo,int _animFrame);
void calcCameraFocusPointTarget();