Browse Source

* 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 years ago
parent
commit
4780bcd1a6
2 changed files with 5 additions and 2 deletions
  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
 	if(catapult) //catapult attack
 	{
 	{
 		owner->addNewAnim( new CSpellEffectAnim(owner, "SGEXPL.DEF",
 		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
 	if(our->hasFeatureOfType(StackFeature::FORGETFULL)) //forgetfulness
 		return false;
 		return false;
 
 
+	if(our->creature->idNumber == 145 && dst) //catapult cannot attack creatures
+		return false;
+
 	if(our->hasFeatureOfType(StackFeature::SHOOTER)//it's shooter
 	if(our->hasFeatureOfType(StackFeature::SHOOTER)//it's shooter
 		&& our->owner != dst->owner
 		&& our->owner != dst->owner
 		&& dst->alive()
 		&& dst->alive()