浏览代码

* fix for bug 272, 176 and (probably) 273 (creatures cannot be attacked with catapult, position of explosion of catapult shot seems to be fixed for non 800x600 resolutions)

mateuszb 16 年之前
父节点
当前提交
4780bcd1a6
共有 2 个文件被更改,包括 5 次插入2 次删除
  1. 2 2
      client/CBattleInterface.cpp
  2. 3 0
      lib/CGameState.cpp

+ 2 - 2
client/CBattleInterface.cpp

@@ -1020,8 +1020,8 @@ CShootingAnim::CShootingAnim(CBattleInterface * _owner, int attacker, int _dest,
 	if(catapult) //catapult attack
 	{
 		owner->addNewAnim( new CSpellEffectAnim(owner, "SGEXPL.DEF",
-			-130 + 22 * ( ((dest/BFIELD_WIDTH) + 1)%2 ) + 44 * (dest % BFIELD_WIDTH),
-			-50 + 42 * (dest/BFIELD_WIDTH) ));
+			-130 + 22 * ( ((dest/BFIELD_WIDTH) + 1)%2 ) + 44 * (dest % BFIELD_WIDTH) + owner->pos.x,
+			-50 + 42 * (dest/BFIELD_WIDTH) + owner->pos.y ));
 	}
 }
 

+ 3 - 0
lib/CGameState.cpp

@@ -2833,6 +2833,9 @@ bool CGameState::battleCanShoot(int ID, int dest)
 	if(our->hasFeatureOfType(StackFeature::FORGETFULL)) //forgetfulness
 		return false;
 
+	if(our->creature->idNumber == 145 && dst) //catapult cannot attack creatures
+		return false;
+
 	if(our->hasFeatureOfType(StackFeature::SHOOTER)//it's shooter
 		&& our->owner != dst->owner
 		&& dst->alive()