1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-15 01:24:45 +02:00

[programming challenge] An experiment.

This commit is contained in:
Michał W. Urbańczyk
2011-12-28 18:00:43 +00:00
parent b41dd8d88c
commit f5bb1f3ba3
7 changed files with 35 additions and 21 deletions

View File

@ -755,7 +755,7 @@ int CGameHandler::moveStack(int stack, THex dest)
*stackAtEnd = gs->curB->getStackT(dest);
assert(curStack);
assert(dest < BFIELD_SIZE);
assert(dest.isValid());
if (gs->curB->tacticDistance)
{
@ -5070,7 +5070,7 @@ void CGameHandler::runBattle()
const CGHeroInstance * curOwner = gs->curB->battleGetOwner(next);
if( (next->position < 0 || next->getCreature()->idNumber == 146) //arrow turret or ballista
if( (!next->position.isValid() || next->getCreature()->idNumber == 146) //arrow turret or ballista
&& (!curOwner || curOwner->getSecSkillLevel(CGHeroInstance::ARTILLERY) == 0)) //hero has no artillery
{
BattleAction attack;