Selaa lähdekoodia

- Fixed random crashes after creature spellcasting
- Added dummy projectiles to Commanders

DjWarmonger 13 vuotta sitten
vanhempi
sitoutus
f5e47474c5
2 muutettua tiedostoa jossa 23 lisäystä ja 12 poistoa
  1. 5 3
      client/BattleInterface/CBattleInterface.cpp
  2. 18 9
      config/creatures.json

+ 5 - 3
client/BattleInterface/CBattleInterface.cpp

@@ -697,7 +697,7 @@ void CBattleInterface::show(SDL_Surface * to)
 			activate();
 
 		//activation of next stack
-		if(pendingAnims.size() == 0 && stackToActivate != NULL) //FIXME: Faerie Dragon's Chain Lightning doesn't have animation ATM
+		if(pendingAnims.size() == 0 && stackToActivate != NULL)
 		{
 			activateStack();
 		}
@@ -2474,6 +2474,8 @@ void CBattleInterface::showQueue()
 
 void CBattleInterface::startAction(const BattleAction* action)
 {
+	possibleActions.clear(); //no random interface calls for inactive stack
+
 	if(action->actionType == BattleAction::END_TACTIC_PHASE)
 	{
 		SDL_FreeSurface(menu);
@@ -2733,7 +2735,7 @@ void CBattleInterface::handleHex(BattleHex myNumber, int eventType)
 				if(curInt->cb->battleCanShoot (activeStack, myNumber))
 					legalAction = true;
 				break;
-			case HOSTILE_CREATURE_SPELL: //TODO: check spell immunity
+			case HOSTILE_CREATURE_SPELL:
 				if (shere && shere->alive() && !ourStack && isCastingPossibleHere (sactive, shere, myNumber))
 					legalAction = true;
 				break;
@@ -2759,7 +2761,7 @@ void CBattleInterface::handleHex(BattleHex myNumber, int eventType)
 				break;
 			case OBSTACLE:
 				if (isCastingPossibleHere (sactive, shere, myNumber))
-					legalAction = true; //TODO
+					legalAction = true;
 				break;
 			case TELEPORT:
 			{

+ 18 - 9
config/creatures.json

@@ -1757,7 +1757,8 @@
 								[ "CASTS", 1, 0, 0 ] ,
 								[ "CREATURE_ENCHANT_POWER", 1, 0, 0 ] ,
 								[ "SPELLCASTER", 3, 37, 0 ] ], //expert cure
-				"defname": "ZM174NPC.DEF"
+				"defname": "ZM174NPC.DEF",
+				"projectile_defname": "PLCBOWX.DEF"
 			},
 
 			{
@@ -1769,7 +1770,8 @@
 								[ "CASTS", 1, 0, 0 ] ,
 								[ "CREATURE_ENCHANT_POWER", 1, 0, 0 ] ,
 								[ "SPELLCASTER", 3, 27, 0 ] ], //expert shield
-				"defname": "ZM175NPC.DEF"
+				"defname": "ZM175NPC.DEF",
+				"projectile_defname": "PLCBOWX.DEF"
 			},
 
 			{
@@ -1781,7 +1783,8 @@
 								[ "CASTS", 1, 0, 0 ] ,
 								[ "CREATURE_ENCHANT_POWER", 1, 0, 0 ] ,
 								[ "SPELLCASTER", 3, 44, 0 ] ], //expert precision
-				"defname": "ZM176NPC.DEF"
+				"defname": "ZM176NPC.DEF",
+				"projectile_defname": "PLCBOWX.DEF"
 			},
 
 			{
@@ -1793,7 +1796,8 @@
 								[ "CASTS", 1, 0, 0 ] ,
 								[ "CREATURE_ENCHANT_POWER", 1, 0, 0 ] ,
 								[ "SPELLCASTER", 3, 29, 0 ] ], //expert fire shield
-				"defname": "ZM177NPC.DEF"
+				"defname": "ZM177NPC.DEF",
+				"projectile_defname": "PLCBOWX.DEF"
 			},
 
 			{
@@ -1805,7 +1809,8 @@
 								[ "CASTS", 1, 0, 0 ] ,
 								[ "CREATURE_ENCHANT_POWER", 1, 0, 0 ] ,
 								[ "SPELLCASTER", 3, 39, 0 ] ], //expert animate dead
-				"defname": "ZM178NPC.DEF"
+				"defname": "ZM178NPC.DEF",
+				"projectile_defname": "PLCBOWX.DEF"
 			},
 
 			{
@@ -1817,7 +1822,8 @@
 								[ "CASTS", 1, 0, 0 ] ,
 								[ "CREATURE_ENCHANT_POWER", 1, 0, 0 ] ,
 								[ "SPELLCASTER", 3, 46, 0 ] ], //expert stone skin
-				"defname": "ZM179NPC.DEF"
+				"defname": "ZM179NPC.DEF",
+				"projectile_defname": "PLCBOWX.DEF"
 			},
 
 			{
@@ -1829,7 +1835,8 @@
 								[ "CASTS", 1, 0, 0 ] ,
 								[ "CREATURE_ENCHANT_POWER", 1, 0, 0 ] ,
 								[ "SPELLCASTER", 3, 37, 0 ] ], //expert cure
-				"defname": "ZM180NPC.DEF"
+				"defname": "ZM180NPC.DEF",
+				"projectile_defname": "PLCBOWX.DEF"
 			},
 
 			{
@@ -1841,7 +1848,8 @@
 								[ "CASTS", 1, 0, 0 ] ,
 								[ "CREATURE_ENCHANT_POWER", 1, 0, 0 ] ,
 								[ "SPELLCASTER", 3, 53, 0 ] ], //expert haste
-				"defname": "ZM181NPC.DEF"
+				"defname": "ZM181NPC.DEF",
+				"projectile_defname": "PLCBOWX.DEF"
 			},
 
 			{
@@ -1853,7 +1861,8 @@
 								[ "CASTS", 1, 0, 0 ] ,
 								[ "CREATURE_ENCHANT_POWER", 1, 0, 0 ] ,
 								[ "SPELLCASTER", 3, 58, 0 ] ], //expert counterstrike
-				"defname": "ZM182NPC.DEF"
+				"defname": "ZM182NPC.DEF",
+				"projectile_defname": "PLCBOWX.DEF"
 			},
 
 			{