This commit is contained in:
parent
c2acfb3d6f
commit
0a38b50d9e
2 changed files with 24 additions and 2 deletions
|
@ -767,6 +767,13 @@ if(newmode!=-1)
|
||||||
///
|
///
|
||||||
|
|
||||||
|
|
||||||
|
// Pending teleport?
|
||||||
|
if(m_teleportPending)
|
||||||
|
{
|
||||||
|
processTeleportToCommand();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
for(i=0;i<_frames;i++)
|
for(i=0;i<_frames;i++)
|
||||||
{
|
{
|
||||||
updatePadInput();
|
updatePadInput();
|
||||||
|
@ -1809,16 +1816,26 @@ void CPlayer::teleportTo(int _x,int _y)
|
||||||
{
|
{
|
||||||
DVECTOR pos={_x,_y};
|
DVECTOR pos={_x,_y};
|
||||||
|
|
||||||
|
m_teleportPendingPos=pos;
|
||||||
|
m_teleportPending=true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CPlayer::processTeleportToCommand()
|
||||||
|
{
|
||||||
|
ASSERT(m_teleportPending);
|
||||||
|
|
||||||
CameraBox releaseCamBox={0,0,29999,29999};
|
CameraBox releaseCamBox={0,0,29999,29999};
|
||||||
setCameraBox(releaseCamBox);
|
setCameraBox(releaseCamBox);
|
||||||
|
|
||||||
setPos(pos);
|
setPos(m_teleportPendingPos);
|
||||||
setRespawnPos(pos);
|
setRespawnPos(m_teleportPendingPos);
|
||||||
|
|
||||||
calcCameraFocusPointTarget();
|
calcCameraFocusPointTarget();
|
||||||
m_currentCamFocusPoint=m_currentCamFocusPointTarget;
|
m_currentCamFocusPoint=m_currentCamFocusPointTarget;
|
||||||
|
m_teleportPending=false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
/*----------------------------------------------------------------------
|
||||||
Function:
|
Function:
|
||||||
Purpose:
|
Purpose:
|
||||||
|
@ -1954,6 +1971,7 @@ void CPlayer::respawn()
|
||||||
m_ignoreNewlyPressedButtonsOnPadThisThink=true;
|
m_ignoreNewlyPressedButtonsOnPadThisThink=true;
|
||||||
|
|
||||||
m_canExitLevel=false;
|
m_canExitLevel=false;
|
||||||
|
m_teleportPending=false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
/*----------------------------------------------------------------------
|
||||||
|
|
|
@ -276,6 +276,10 @@ public:
|
||||||
void teleportTo(int _x,int _y);
|
void teleportTo(int _x,int _y);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void processTeleportToCommand();
|
||||||
|
int m_teleportPending;
|
||||||
|
DVECTOR m_teleportPendingPos;
|
||||||
|
|
||||||
void playAnimFrameSfx(int _animNo,int _animFrame);
|
void playAnimFrameSfx(int _animNo,int _animFrame);
|
||||||
void calcCameraFocusPointTarget();
|
void calcCameraFocusPointTarget();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue