07-27-2003, 09:50 PM
yep, i think it's fixed...and the best part is the person who falls at the wrong time won't be penalized a loss carrying over to the next round.
here it is:
just comment out the original CountDownThink() in DiscArena.cpp and put this there below it...
////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CDiscArena::CountDownThink( void )
{
// Freeze everyone until there's 3 seconds to go
if ( m_iSecondsTillStart == 3 )
{
for ( int i = 0; i < (m_iPlayersPerTeam * 2); i++ )
{
//.ASM : white disc haxxx...
// if the player is "dead" during the round countdown,
// then bring the bastard back...:)
if(!m_hCombatants[i]->IsAlive())
m_hCombatants[i]->Spawn();
// end .ASM
if (m_hCombatants[i])
((CBaseEntity*)m_hCombatants[i])->pev->maxspeed = 320;
}
}
m_iSecondsTillStart--;
// Play countdown VOX
if (m_iSecondsTillStart < 5)
{
// Speech
for ( int i = 0; i < (m_iPlayersPerTeam * 2); i++ )
{
if (m_hCombatants[i])
((CBasePlayer*)(CBaseEntity*)m_hCombatants[i])->ClientHearVox( g_szCountDownVox[ m_iSecondsTillStart ] );
}
}
// Send the message to the clients in the arena
for ( int i = 1; i <= gpGlobals->maxClients; i++ )
{
CBasePlayer *pPlayer = (CBasePlayer *)UTIL_PlayerByIndex( i );
if (pPlayer && (pPlayer->pev->groupinfo & pev->groupinfo) && pPlayer->m_bHasDisconnected != TRUE)
{
MESSAGE_BEGIN( MSG_ONE, gmsgStartRnd, NULL, pPlayer->edict() );
WRITE_BYTE( m_iCurrRound );
WRITE_BYTE( m_iSecondsTillStart );
WRITE_BYTE( 0 );
MESSAGE_END();
}
}
if (m_iSecondsTillStart)
{
pev->nextthink = gpGlobals->time + 1.0;
}
else
{
m_iArenaState = ARENA_BATTLE_IN_PROGRESS;
// Enable powerups
CBaseEntity *pFunc = NULL;
while ((pFunc = UTIL_FindEntityByClassname( pFunc, "item_powerup" )) != NULL)
{
((CDiscwarPowerup*)pFunc)->Enable();
}
pev->nextthink = gpGlobals->time + 1.0;
SetThink( BattleThink );
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////
i would like to do some more tests and get people's opinion...it's worked great so far w/ the bots.
another rediculously simple solution...<_<...just proves i have no actual talent at this...lol
here it is:
just comment out the original CountDownThink() in DiscArena.cpp and put this there below it...
////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CDiscArena::CountDownThink( void )
{
// Freeze everyone until there's 3 seconds to go
if ( m_iSecondsTillStart == 3 )
{
for ( int i = 0; i < (m_iPlayersPerTeam * 2); i++ )
{
//.ASM : white disc haxxx...
// if the player is "dead" during the round countdown,
// then bring the bastard back...:)
if(!m_hCombatants[i]->IsAlive())
m_hCombatants[i]->Spawn();
// end .ASM
if (m_hCombatants[i])
((CBaseEntity*)m_hCombatants[i])->pev->maxspeed = 320;
}
}
m_iSecondsTillStart--;
// Play countdown VOX
if (m_iSecondsTillStart < 5)
{
// Speech
for ( int i = 0; i < (m_iPlayersPerTeam * 2); i++ )
{
if (m_hCombatants[i])
((CBasePlayer*)(CBaseEntity*)m_hCombatants[i])->ClientHearVox( g_szCountDownVox[ m_iSecondsTillStart ] );
}
}
// Send the message to the clients in the arena
for ( int i = 1; i <= gpGlobals->maxClients; i++ )
{
CBasePlayer *pPlayer = (CBasePlayer *)UTIL_PlayerByIndex( i );
if (pPlayer && (pPlayer->pev->groupinfo & pev->groupinfo) && pPlayer->m_bHasDisconnected != TRUE)
{
MESSAGE_BEGIN( MSG_ONE, gmsgStartRnd, NULL, pPlayer->edict() );
WRITE_BYTE( m_iCurrRound );
WRITE_BYTE( m_iSecondsTillStart );
WRITE_BYTE( 0 );
MESSAGE_END();
}
}
if (m_iSecondsTillStart)
{
pev->nextthink = gpGlobals->time + 1.0;
}
else
{
m_iArenaState = ARENA_BATTLE_IN_PROGRESS;
// Enable powerups
CBaseEntity *pFunc = NULL;
while ((pFunc = UTIL_FindEntityByClassname( pFunc, "item_powerup" )) != NULL)
{
((CDiscwarPowerup*)pFunc)->Enable();
}
pev->nextthink = gpGlobals->time + 1.0;
SetThink( BattleThink );
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////
i would like to do some more tests and get people's opinion...it's worked great so far w/ the bots.
another rediculously simple solution...<_<...just proves i have no actual talent at this...lol