1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-09-16 09:26:28 +02:00

Quick Combat system setting works… if user doesn't click in the meantime.

This commit is contained in:
Michał W. Urbańczyk
2013-06-23 11:25:48 +00:00
parent 2a471eeb1a
commit 04d11519ef
8 changed files with 149 additions and 157 deletions

View File

@@ -579,16 +579,17 @@ void CClient::battleStarted(const BattleInfo * info)
// if(battleCallbacks.count(side))
// battleCallbacks[side]->setBattle(info);
shared_ptr<CPlayerInterface> att, def;
if(vstd::contains(playerint, info->sides[0]) && playerint[info->sides[0]]->human)
att = std::dynamic_pointer_cast<CPlayerInterface>( playerint[info->sides[0]] );
else
att = NULL;
shared_ptr<CPlayerInterface> att = nullptr, def = nullptr;
if(vstd::contains(playerint, info->sides[1]) && playerint[info->sides[1]]->human)
def = std::dynamic_pointer_cast<CPlayerInterface>( playerint[info->sides[1]] );
else
def = NULL;
//If quick combat is not, do not prepare interfaces for battleint
if(!settings["adventure"]["quickCombat"].Bool())
{
if(vstd::contains(playerint, info->sides[0]) && playerint[info->sides[0]]->human)
att = std::dynamic_pointer_cast<CPlayerInterface>( playerint[info->sides[0]] );
if(vstd::contains(playerint, info->sides[1]) && playerint[info->sides[1]]->human)
def = std::dynamic_pointer_cast<CPlayerInterface>( playerint[info->sides[1]] );
}
if(!gNoGUI && (!!att || !!def || gs->scenarioOps->mode == StartInfo::DUEL))
{