Browse Source

* Fixed crashbug on iterating stack effects
* Altered probabilities of starting with 1/2/3 stacks (according to Zamolxis tests)
* fix compilation min/max (windef.h is somehow included and it has its own macros min/max)

Michał W. Urbańczyk 16 years ago
parent
commit
7fbd4e696c
2 changed files with 10 additions and 3 deletions
  1. 2 2
      hch/CObjectHandler.cpp
  2. 8 1
      lib/NetPacksLib.cpp

+ 2 - 2
hch/CObjectHandler.cpp

@@ -525,9 +525,9 @@ void CGHeroInstance::initHero()
 
 		int x = 0; //how many stacks will hero receives <1 - 3>
 		pom = ran()%100;
-		if(pom < 5)
+		if(pom < 9)
 			x = 1;
-		else if(pom < 67)
+		else if(pom < 79)
 			x = 2;
 		else
 			x = 3;

+ 8 - 1
lib/NetPacksLib.cpp

@@ -25,6 +25,13 @@
  *
  */
 
+#ifdef min
+#undef min
+#endif
+#ifdef max
+#undef max
+#endif
+
 DLL_EXPORT void SetResource::applyGs( CGameState *gs )
 {
 	gs->getPlayer(player)->resources[resid] = val;
@@ -484,7 +491,7 @@ DLL_EXPORT void BattleNextRound::applyGs( CGameState *gs )
 			if(tmpFeatures[i].duration == StackFeature::N_TURNS)
 			{
 				tmpFeatures[i].turnsRemain--;
-				if(tmpEffects[i].turnsRemain > 0)
+				if(tmpFeatures[i].turnsRemain > 0)
 					s->features.push_back(tmpFeatures[i]);
 			}
 			else