Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
server crash bug
#38
NP. Thanks :thumb:

Code:
//-----------------------------------------------------------------------------
// Purpose: Countdown to the round start
//-----------------------------------------------------------------------------
void CDiscArena::CountDownThink( void )
{
    // Freeze everyone until there's 3 seconds to go
    if ( m_iSecondsTillStart == 3 )
    {
&nbsp;for ( int i = 0; i < (m_iPlayersPerTeam * 2); i++ )
&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//white disc haxxx asm...
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// if the player is "dead" during countdown and they are not NULL
&nbsp; &nbsp; &nbsp;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CBasePlayer *pPlayer = ((CBasePlayer*)(CBaseEntity*)m_hCombatants[i]);

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if( m_hCombatants[i] != NULL &amp;&amp; !m_hCombatants[i]->IsAlive() )
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp; &nbsp;pPlayer->StopObserver();
&nbsp; &nbsp;pPlayer->Spawn();
&nbsp; &nbsp;// difference in ? m_hCombatants[i]->Spawn(); &nbsp; &nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp; &nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// end hax

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (m_hCombatants[i])
&nbsp; &nbsp;((CBaseEntity*)m_hCombatants[i])->pev->maxspeed = 320;
&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;}

&nbsp;&nbsp;&nbsp;&nbsp;m_iSecondsTillStart--;

&nbsp;&nbsp;&nbsp;&nbsp;// Play countdown VOX
&nbsp;&nbsp;&nbsp;&nbsp;if (m_iSecondsTillStart < 5)
&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;// Speech
&nbsp;for ( int i = 0; i < (m_iPlayersPerTeam * 2); i++ )
&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (m_hCombatants[i])
&nbsp; &nbsp;((CBasePlayer*)(CBaseEntity*)m_hCombatants[i])->ClientHearVox( g_szCountDownVox[ m_iSecondsTillStart ] );
&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;}

&nbsp;&nbsp;&nbsp;&nbsp;// Send the message to the clients in the arena
&nbsp;&nbsp;&nbsp;&nbsp;for ( int i = 1; i <= gpGlobals->maxClients; i++ )
&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;CBasePlayer *pPlayer = (CBasePlayer *)UTIL_PlayerByIndex( i );

&nbsp;if (pPlayer &amp;&amp; (pPlayer->pev->groupinfo &amp; pev->groupinfo) &amp;&amp; pPlayer->m_bHasDisconnected != TRUE)
&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MESSAGE_BEGIN( MSG_ONE, gmsgStartRnd, NULL, pPlayer->edict() );
&nbsp; &nbsp;WRITE_BYTE( m_iCurrRound );
&nbsp; &nbsp;WRITE_BYTE( m_iSecondsTillStart );
&nbsp; &nbsp;WRITE_BYTE( 0 );
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MESSAGE_END();
&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;}

&nbsp;&nbsp;&nbsp;&nbsp;if (m_iSecondsTillStart)
&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;pev->nextthink = gpGlobals->time + 1.0;
&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;else
&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;m_iArenaState = ARENA_BATTLE_IN_PROGRESS;

&nbsp;// Enable powerups
&nbsp;CBaseEntity *pFunc = NULL;
&nbsp;while ((pFunc = UTIL_FindEntityByClassname( pFunc, "item_powerup" )) != NULL)
&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;((CDiscwarPowerup*)pFunc)->Enable();
&nbsp;}

&nbsp;pev->nextthink = gpGlobals->time + 1.0;
&nbsp;SetThink( BattleThink );
&nbsp;&nbsp;&nbsp;&nbsp;}
}

//-----------------------------------------------------------------------------
&lt;@Miagi&gt; !8 Am I spamming?
&lt;@ChanServ&gt; Miagi: Yes.
&lt;@Miagi&gt; !8 Should I stop?
&lt;@ChanServ&gt; Miagi: Oh, please, PLEASE, make it stop!

Reply


Messages In This Thread
server crash bug - by _Acid_Head_ - 09-25-2004, 12:11 AM
server crash bug - by FuzzyShoting - 09-25-2004, 04:28 AM
server crash bug - by _Acid_Head_ - 09-25-2004, 06:44 AM
server crash bug - by jabbahunt - 09-25-2004, 07:26 AM
server crash bug - by Gwarsbane - 09-25-2004, 09:59 AM
server crash bug - by Miagi - 09-25-2004, 10:38 AM
server crash bug - by kermit - 09-25-2004, 03:05 PM
server crash bug - by Miagi - 09-25-2004, 03:31 PM
server crash bug - by Miagi - 09-25-2004, 04:24 PM
server crash bug - by kermit - 09-25-2004, 04:36 PM
server crash bug - by kermit - 09-25-2004, 04:39 PM
server crash bug - by RushJet1 - 09-25-2004, 08:55 PM
server crash bug - by _Acid_Head_ - 09-25-2004, 09:38 PM
server crash bug - by GRITS - 09-25-2004, 09:43 PM
server crash bug - by _Acid_Head_ - 09-25-2004, 09:51 PM
server crash bug - by Miagi - 09-25-2004, 10:34 PM
server crash bug - by Pique - 09-27-2004, 02:34 PM
server crash bug - by kermit - 09-27-2004, 04:47 PM
server crash bug - by _Acid_Head_ - 09-28-2004, 04:31 PM
server crash bug - by RushJet1 - 09-28-2004, 05:28 PM
server crash bug - by Guest - 09-28-2004, 06:29 PM
server crash bug - by _Acid_Head_ - 09-28-2004, 07:40 PM
server crash bug - by enzymo - 10-02-2004, 06:01 AM
server crash bug - by Miagi - 10-10-2004, 03:15 PM
server crash bug - by Miagi - 11-06-2004, 06:37 PM
server crash bug - by Pique - 11-06-2004, 10:34 PM
server crash bug - by Miagi - 11-06-2004, 10:54 PM
server crash bug - by kermit - 11-07-2004, 04:49 AM
server crash bug - by FuzzyShoting - 11-07-2004, 05:19 AM
server crash bug - by Guest - 11-21-2004, 06:32 AM
server crash bug - by Miagi - 11-21-2004, 02:03 PM
server crash bug - by Miagi - 11-21-2004, 03:23 PM
server crash bug - by Miagi - 11-21-2004, 03:51 PM
server crash bug - by Pique - 11-21-2004, 04:24 PM
server crash bug - by GRITS - 11-21-2004, 08:29 PM
server crash bug - by Miagi - 11-22-2004, 05:03 PM
server crash bug - by evil_admin - 11-22-2004, 05:28 PM
server crash bug - by Miagi - 11-22-2004, 05:47 PM
server crash bug - by Miagi - 11-27-2004, 02:14 PM
server crash bug - by evil_admin - 11-27-2004, 02:32 PM
server crash bug - by Miagi - 11-28-2004, 12:50 AM
server crash bug - by Miagi - 02-11-2005, 10:26 PM
server crash bug - by Miagi - 04-01-2005, 10:56 PM
server crash bug - by GRITS - 04-02-2005, 12:58 AM
server crash bug - by Miagi - 04-02-2005, 12:01 PM
server crash bug - by NITRO! - 04-02-2005, 12:02 PM

Forum Jump:


Users browsing this thread: 6 Guest(s)