Explorar o código

* fixed #28 bug
* fixed #30 bug (those elementals were wrongly double-wide)
* fixed #40 bug
* RowAdd always initialized in getSprite

bugs from http://antypika.aplus.pl/vcmi/forum/viewtopic.php?t=148&sid=1813b5192666d21ca931aac9ad778606

mateuszb %!s(int64=16) %!d(string=hai) anos
pai
achega
d3e5020da1
Modificáronse 3 ficheiros con 11 adicións e 2 borrados
  1. 2 1
      hch/CArtHandler.cpp
  2. 3 0
      hch/CCreatureHandler.cpp
  3. 6 1
      hch/CDefHandler.cpp

+ 2 - 1
hch/CArtHandler.cpp

@@ -207,6 +207,7 @@ void CArtHandler::addBonuses()
 
 	//Luck and morale 
 	ART_MORALE(45,+1); //Still Eye of the Dragon
+	ART_LUCK(45,+1); //Still Eye of the Dragon
 	ART_LUCK(46,+1); //Clover of Fortune
 	ART_LUCK(47,+1); //Cards of Prophecy
 	ART_LUCK(48,+1); //Ladybird of Luck
@@ -280,7 +281,7 @@ void CArtHandler::addBonuses()
 
 	giveArtBonus(97,HeroBonus::STACKS_SPEED,+1);//Necklace of Swiftness
 	giveArtBonus(98,HeroBonus::LAND_MOVEMENT,+600);//Boots of Speed
-	giveArtBonus(99,HeroBonus::STACKS_SPEED,+1);//Cape of Velocity
+	giveArtBonus(99,HeroBonus::STACKS_SPEED,+2);//Cape of Velocity
 
 	giveArtBonus(100,HeroBonus::SPELL_IMMUNITY,59);//Pendant of Dispassion
 	giveArtBonus(101,HeroBonus::SPELL_IMMUNITY,62);//Pendant of Second Sight

+ 3 - 0
hch/CCreatureHandler.cpp

@@ -545,6 +545,9 @@ void CCreatureHandler::loadCreatures()
 	creatures[147].abilities += makeCreatureAbility(StackFeature::NOT_ACTIVE, 0); //First Aid Tent //TODO: remove when support is added
 	creatures[148].abilities += makeCreatureAbility(StackFeature::NOT_ACTIVE, 0); //Ammo Cart
 
+	creatures[120].abilities -= StackFeature::DOUBLE_WIDE; //psychic elemental
+	creatures[121].abilities -= StackFeature::DOUBLE_WIDE; //magic elemental
+
 	creatures[0].abilities += makeCreatureAbility(StackFeature::CHARGE_IMMUNITY, 0); //pikeman immunity to Champion charge bonus
 	creatures[1].abilities += makeCreatureAbility(StackFeature::CHARGE_IMMUNITY, 0); //halberdier immunity to Champion charge bonus
 	creatures[4].abilities += makeCreatureAbility(StackFeature::ADDITIONAL_RETAILATION, 1); //griffins retailate twice

+ 6 - 1
hch/CDefHandler.cpp

@@ -316,7 +316,8 @@ SDL_Surface * CDefHandler::getSprite (int SIndex, unsigned char * FDef, BMPPalet
 	if (TopMargin > 0)
 		ftcp += TopMargin*(FullWidth+add);
 
-	switch(defType2) {
+	switch(defType2)
+	{
 	case 0:
 	{
 		for (int i=0;i<SpriteHeight;i++)
@@ -420,6 +421,8 @@ SDL_Surface * CDefHandler::getSprite (int SIndex, unsigned char * FDef, BMPPalet
 			if (RightMargin>0)
 				ftcp += RightMargin;
 
+			RowAdd=SpriteWidth-TotalRowLength;
+
 			if (add>0)
 				ftcp += add+RowAdd;
 		}
@@ -474,6 +477,8 @@ SDL_Surface * CDefHandler::getSprite (int SIndex, unsigned char * FDef, BMPPalet
 			if (RightMargin>0)
 				ftcp += RightMargin;
 
+			RowAdd=SpriteWidth-TotalRowLength;
+
 			if (add>0)
 				ftcp += add+RowAdd;
 		}