From 754d63f7a5c3a54719f19bb038719e97c6f87728 Mon Sep 17 00:00:00 2001 From: AlexVinS Date: Tue, 13 Jun 2017 15:30:21 +0300 Subject: [PATCH] hack-fixed ENCHANTED trigger for first 2 rounds --- server/CGameHandler.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/CGameHandler.cpp b/server/CGameHandler.cpp index 2678bb080..fbcdcc7a4 100644 --- a/server/CGameHandler.cpp +++ b/server/CGameHandler.cpp @@ -5750,11 +5750,14 @@ void CGameHandler::runBattle() } } + bool firstRound = true;//FIXME: why first round is -1? + //main loop while (!battleResult.get()) //till the end of the battle ;] { BattleNextRound bnr; bnr.round = gs->curB->round + 1; + logGlobal->debug("Round %d", bnr.round); sendAndApply(&bnr); auto obstacles = gs->curB->obstacles; //we copy container, because we're going to modify it @@ -5769,7 +5772,7 @@ void CGameHandler::runBattle() for(auto stack : curB.stacks) { - if(stack->alive() && curB.round > 1) + if(stack->alive() && !firstRound) stackEnchantedTrigger(stack); } @@ -6001,6 +6004,7 @@ void CGameHandler::runBattle() } } + firstRound = false; } endBattle(gs->curB->tile, gs->curB->battleGetFightingHero(0), gs->curB->battleGetFightingHero(1));