1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-25 21:38:59 +02:00

fix automatic towers when out of ammo

This commit is contained in:
Andrii Danylchenko 2020-11-27 20:51:04 +02:00
parent 61f870af90
commit 4e359cd2a3

View File

@ -6117,7 +6117,9 @@ void CGameHandler::runBattle()
for(auto & elem : gs->curB->stacks)
{
if(elem->owner != next->owner && elem->isValidTarget())
if(elem->owner != next->owner
&& elem->isValidTarget()
&& gs->curB->battleCanShoot(next, elem->getPosition()))
{
target = elem;
break;