Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue/2137 #116

Merged
merged 4 commits into from Aug 29, 2015
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 11 additions & 8 deletions server/CGameHandler.cpp
Expand Up @@ -5414,26 +5414,29 @@ void CGameHandler::runBattle()
continue;
}

if(next->getCreature()->idNumber == CreatureID::CATAPULT && (!curOwner || curOwner->getSecSkillLevel(SecondarySkill::BALLISTICS) == 0)) //catapult, hero has no ballistics
if( next->getCreature()->idNumber == CreatureID::CATAPULT )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No spaces after "(" and before ")", please. http://wiki.vcmi.eu/index.php?title=Coding_guidelines

{
const auto & attackableBattleHexes = curB.getAttackableBattleHexes();

if(!attackableBattleHexes.empty())
if(attackableBattleHexes.empty())
{
makeStackDoNothing(next);
continue;
}

if(!curOwner || curOwner->getSecSkillLevel(SecondarySkill::BALLISTICS) == 0)
{
BattleAction attack;
attack.destinationTile = *RandomGeneratorUtil::nextItem(attackableBattleHexes, gs->getRandomGenerator());
attack.destinationTile = *RandomGeneratorUtil::nextItem(attackableBattleHexes,
gs->getRandomGenerator());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like bad formatting?

attack.actionType = Battle::CATAPULT;
attack.additionalInfo = 0;
attack.side = !next->attackerOwned;
attack.stackNumber = next->ID;

makeAutomaticAction(next, attack);
continue;
}
else
{
makeStackDoNothing(next);
}
continue;
}

if(next->getCreature()->idNumber == CreatureID::FIRST_AID_TENT)
Expand Down