浏览代码

* bug #569 fixed

mateuszb 14 年之前
父节点
当前提交
8a063b88e5
共有 2 个文件被更改,包括 4 次插入4 次删除
  1. 2 2
      client/CBattleInterface.cpp
  2. 2 2
      server/CGameHandler.cpp

+ 2 - 2
client/CBattleInterface.cpp

@@ -2376,8 +2376,9 @@ const CGHeroInstance * CBattleInterface::getActiveHero()
 void CBattleInterface::hexLclicked(int whichOne)
 {
 	const CStack * actSt = activeStack;
+	const CStack* dest = curInt->cb->battleGetStackByPos(whichOne); //creature at destination tile; -1 if there is no one
 	if( ((whichOne%BFIELD_WIDTH)!=0 && (whichOne%BFIELD_WIDTH)!=(BFIELD_WIDTH-1)) //if player is trying to attack enemey unit or move creature stack
-		|| (actSt->hasBonusOfType(Bonus::CATAPULT) && !spellDestSelectMode )
+		|| (actSt->hasBonusOfType(Bonus::CATAPULT) && !spellDestSelectMode || dest ) //enemy's first aid tent can stand there and we want to shoot it
 		)
 	{
 		if(!myTurn)
@@ -2423,7 +2424,6 @@ void CBattleInterface::hexLclicked(int whichOne)
 		}
 		else //we don't cast any spell
 		{
-			const CStack* dest = curInt->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

+ 2 - 2
server/CGameHandler.cpp

@@ -3874,8 +3874,8 @@ void CGameHandler::handleTownEvents(CGTownInstance * town, NewTurn &n, std::map<
 		}
 
 		if(ev->nextOccurence)
-		{
-			town->events.pop_front();
+		{
+			town->events.pop_front();
 
 			ev->firstOccurence += ev->nextOccurence;
 			std::list<CCastleEvent*>::iterator it = town->events.begin();