game.h
добавил после 61 строки:
В game.cpp
строка 88 заменил:
На:
Строка 5671, добавил перед:
такое:
В gameplayer.cpp
строка 286 после:
Добавил:
Строка 355, после:
Добавил:
В gameplayer.h
строка 135, после:
Добавил:
строка 195, после:
Добавил:
строка 238, после:
Добавил:
В stats.cpp,
после:
Добавил:
в statsdota.cpp в конце добавил:
в statsdota.h, после:
Добавил:
Что б команда вводилась с помощью тега "-":
в game_base.cpp, заменил:
На:
добавил после 61 строки:
- Код: Выделить всё
bool m_DotaGame;
В game.cpp
строка 88 заменил:
- Код: Выделить всё
if( m_Map->GetMapType( ) == "w3mmd" )
m_Stats = new CStatsW3MMD( this, m_Map->GetMapStatsW3MMDCategory( ) );
else if( m_Map->GetMapType( ) == "dota" )
m_Stats = new CStatsDOTA( this );
else
m_Stats = NULL;
На:
- Код: Выделить всё
m_DotaGame = false;
if( m_Map->GetMapType( ) == "w3mmd" )
m_Stats = new CStatsW3MMD( this, m_Map->GetMapStatsW3MMDCategory( ) );
else if( m_Map->GetMapType( ) == "dota" )
{
m_Stats = new CStatsDOTA( this );
m_DotaGame = true;
}
else
m_Stats = NULL;
Строка 5671, добавил перед:
- Код: Выделить всё
//
// !YES
//
такое:
- Код: Выделить всё
if( ( Command == "forfeit" || Command == "ff" ) && m_GameLoaded )
{
unsigned char CurentTeam=m_Slots[GetSIDFromPID(player->GetPID())].GetTeam();
if (CurentTeam>1)
return false ;
player->SetFFVote(true);
uint32_t VotesNeeded= 0;
uint32_t Votes = 0;
for( vector<CGamePlayer *> :: iterator i = m_Players.begin( ); i != m_Players.end( ); i++ )
{
if( !(*i)->GetLeftMessageSent( ) )
if(m_Slots[GetSIDFromPID((*i)->GetPID())].GetTeam() == CurentTeam)
{
VotesNeeded++;
if( (*i)->GetFFVote( ) )
Votes++;
}
}
SendAllChat( player->GetName()+" сдался [" + UTIL_ToString( Votes )+"/"+ UTIL_ToString(VotesNeeded)+"] "+"-ff чтобы сдаться");
if( Votes >= VotesNeeded )
{
if (m_DotaGame )
{
SendAllChat("Победители The " + (string)(CurentTeam == 0 ? "Scrouge" : "Sentinel") + " игра закончится через 5 секунд.");
m_Stats->SetWinner((uint32_t)(CurentTeam == 0 ? 2 : 1));
}
else SendAllChat("Игра закончится через 5 секунд.");
m_GameEndCountDownStarted = true;
m_GameEndCountDownCounter = 5;
m_GameEndLastCountDownTicks = GetTicks();
}
}
В gameplayer.cpp
строка 286 после:
- Код: Выделить всё
m_KickVote = false;
Добавил:
- Код: Выделить всё
m_FFVote= false;
Строка 355, после:
- Код: Выделить всё
m_KickVote = false;
Добавил:
- Код: Выделить всё
m_FFVote= false;
В gameplayer.h
строка 135, после:
- Код: Выделить всё
bool m_KickVote; // if the player voted to kick a player or not
Добавил:
- Код: Выделить всё
bool m_FFVote; // Forfeit
строка 195, после:
- Код: Выделить всё
bool GetKickVote( ) { return m_KickVote; }
Добавил:
- Код: Выделить всё
bool GetFFVote( ) { return m_FFVote; }
строка 238, после:
- Код: Выделить всё
void SetKickVote( bool nKickVote ) { m_KickVote = nKickVote; }
Добавил:
- Код: Выделить всё
void SetFFVote( bool nFFVote ) { m_FFVote = nFFVote; }
В stats.cpp,
после:
- Код: Выделить всё
virtual void Save( CGHost *GHost, CGHostDB *DB, uint32_t GameID );
Добавил:
- Код: Выделить всё
virtual void SetWinner( uint32_t n_Winner );
в statsdota.cpp в конце добавил:
- Код: Выделить всё
void CStatsDOTA :: SetWinner( uint32_t n_Winner )
{
m_Winner = n_Winner;
}
в statsdota.h, после:
- Код: Выделить всё
virtual void Save( CGHost *GHost, CGHostDB *DB, uint32_t GameID );
Добавил:
- Код: Выделить всё
virtual void SetWinner( uint32_t n_Winner );
Что б команда вводилась с помощью тега "-":
в game_base.cpp, заменил:
- Код: Выделить всё
if( Message == "?trigger" )
SendChat( player, m_GHost->m_Language->CommandTrigger( string( 1, m_GHost->m_CommandTrigger ) ) );
На:
- Код: Выделить всё
if( (Message == "-ff" || Message == "-fastfinish" || Message == "-сдаться" || Message == "-сдаюсь") && m_GameLoaded)
EventPlayerBotCommand(player,"ff",string( ));
else if( Message == "?trigger" )
SendChat( player, m_GHost->m_Language->CommandTrigger( string( 1, m_GHost->m_CommandTrigger ) ) );