1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00

Code style

Co-Authored-By: Alexander Shishkin <alexvins@users.noreply.github.com>
This commit is contained in:
Ewilhan 2019-05-18 18:37:02 +02:00 committed by GitHub
parent 023d6c88fd
commit cba94f8bb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -367,7 +367,7 @@ const T * takeOneUnit(std::vector<const T*> & all, const int turn, int8_t & last
if(all[i]) if(all[i])
{ {
currentUnitSpeed = all[i]->getInitiative(turn); currentUnitSpeed = all[i]->getInitiative(turn);
switch (phase) switch(phase)
{ {
case 1: // Faster first, attacker priority, higher slot first case 1: // Faster first, attacker priority, higher slot first
if(returnedUnit == nullptr || currentUnitSpeed > returnedUnitSpeed) if(returnedUnit == nullptr || currentUnitSpeed > returnedUnitSpeed)
@ -513,7 +513,9 @@ void CBattleInfoCallback::battleGetTurnOrder(std::vector<battle::Units> & out, c
{ {
current = takeOneUnit(phase[pi], actualTurn, lastMoved, pi); current = takeOneUnit(phase[pi], actualTurn, lastMoved, pi);
if(!current) if(!current)
{
pi++; pi++;
}
else else
{ {
out.back().push_back(current); out.back().push_back(current);
@ -522,7 +524,7 @@ void CBattleInfoCallback::battleGetTurnOrder(std::vector<battle::Units> & out, c
} }
} }
if (lastMoved < 0) if(lastMoved < 0)
lastMoved = BattleSide::ATTACKER; lastMoved = BattleSide::ATTACKER;
if(!outputFull() && (maxTurns == 0 || out.size() < maxTurns)) if(!outputFull() && (maxTurns == 0 || out.size() < maxTurns))