1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-15 01:24:45 +02:00
- fixed several gcc warnings
- some work on JSON (const char* as input, no crash on missing value)
This commit is contained in:
Ivan Savenko
2011-09-23 15:58:18 +00:00
parent 750995f7f9
commit d113517db4
12 changed files with 147 additions and 146 deletions

View File

@ -796,7 +796,7 @@ void BattleInfo::getPotentiallyAttackableHexes(AttackableTiles &at, const CStack
std::vector<THex> hexes = attacker->getSurroundingHexes(attackerPos);
BOOST_FOREACH (THex tile, hexes)
{
if (THex::mutualPosition(tile, destinationTile) > -1 && THex::mutualPosition(tile, hex) > -1 //adjacent both to attacker's head and attacked tile
if ((THex::mutualPosition(tile, destinationTile) > -1 && THex::mutualPosition(tile, hex) > -1) //adjacent both to attacker's head and attacked tile
|| tile == destinationTile) //or simply attacked directly
{
CStack * st = getStackT(tile, true);
@ -843,7 +843,6 @@ std::set<CStack*> BattleInfo::getAttackedCreatures(const CStack* attacker, THex
AttackableTiles at;
getPotentiallyAttackableHexes(at, attacker, destinationTile, attackerPos);
std::set<CStack*> attackedCres;
const int WN = BFIELD_WIDTH;
BOOST_FOREACH (THex tile, at.hostileCreaturePositions) //all around & three-headed attack
{
CStack * st = getStackT(tile, true);