delay when respawning from spect mode

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@2358 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
driAn
2008-08-23 10:30:11 +00:00
parent 8b543bd50c
commit 43c0fa0f9a
2 changed files with 16 additions and 9 deletions
+12 -8
View File
@@ -395,15 +395,18 @@ bool tryrespawn()
{
if(player1->state==CS_DEAD)
{
if(lastmillis>player1->respawnoffset+(m_ctf ? 5000 : 2000))
{
if(player1->isspectating() && player1->spectatemode!=SM_DEATHCAM)
{
spectate(SM_DEATHCAM);
player1->respawnoffset = lastmillis+2000;
return false;
}
int respawnmillis = player1->respawnoffset+(m_ctf ? 5000 : 2000);
// set min wait time when in spectate mode (avoid unfair specting)
if(player1->isspectating() && player1->spectatemode!=SM_DEATHCAM)
{
spectate(SM_DEATHCAM);
player1->respawnoffset = lastmillis; // count again
return false;
}
if(lastmillis>respawnmillis)
{
player1->attacking = false;
if(m_arena) { conoutf("waiting for new round to start..."); return false; }
respawnself();
@@ -411,6 +414,7 @@ bool tryrespawn()
player1->lastaction -= weapon::weaponchangetime/2;
return true;
}
else hudoutf("waiting %3.1f seconds for respawning", (respawnmillis-lastmillis)/(float)1000);
}
return false;
}