1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

* corrected typo in cr_shots

* recruiting creatures
This commit is contained in:
Michał W. Urbańczyk
2008-08-10 04:46:16 +00:00
parent 15ff21e84c
commit 6e02c1c5db
11 changed files with 187 additions and 164 deletions

View File

@@ -728,19 +728,18 @@ void CBattleInterface::hexLclicked(int whichOne)
if(!myTurn)
return; //we are not permit to do anything
int atCre = LOCPLINT->cb->battleGetStack(whichOne); //creature at destination tile; -1 if there is no one
//LOCPLINT->cb->battleGetCreature();
if(atCre==-1) //no creature at that tile
CStack* dest = LOCPLINT->cb->battleGetStackByPos(whichOne); //creature at destination tile; -1 if there is no one
if(!dest || !dest->alive) //no creature at that tile
{
if(std::find(shadedHexes.begin(),shadedHexes.end(),whichOne)!=shadedHexes.end())// and it's in our range
giveCommand(2,whichOne,activeStack);
}
else if(LOCPLINT->cb->battleGetStackByID(atCre)->owner != attackingHeroInstance->tempOwner
else if(dest->owner != attackingHeroInstance->tempOwner
&& LOCPLINT->cb->battleCanShoot(activeStack, whichOne)) //shooting
{
giveCommand(7,whichOne,activeStack);
}
else if(LOCPLINT->cb->battleGetStackByID(atCre)->owner != attackingHeroInstance->tempOwner) //attacking
else if(dest->owner != attackingHeroInstance->tempOwner) //attacking
{
std::vector<int> n = BattleInfo::neighbouringTiles(whichOne);
for(int i=0;i<n.size();i++)