1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-15 01:24:45 +02:00

* 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)
This commit is contained in:
Michał W. Urbańczyk
2009-05-17 22:52:22 +00:00
parent 7862fe25d1
commit 7fbd4e696c
2 changed files with 10 additions and 3 deletions

View File

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

View File

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