1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-03 00:46:55 +02:00
* crash on +5 growth week 
* crash on spawning wandering creatures on double growth months
(how come that has not been found in previous build?)

More logging for #729-like issues.
This commit is contained in:
Michał W. Urbańczyk
2011-05-28 01:02:28 +00:00
parent 4af4f0a707
commit 3ca95ef5ed
11 changed files with 82 additions and 38 deletions

View File

@ -3008,23 +3008,23 @@ void CGCreature::newTurn() const
if (stacks.begin()->second->count < CREEP_SIZE && cb->getDate(1) == 1 && cb->getDate(0) > 1)
{
ui32 power = temppower * (100 + WEEKLY_GROWTH)/100;
cb->setObjProperty(id, 10, std::min (power/1000 , (ui32)CREEP_SIZE)); //set new amount
cb->setObjProperty(id, 11, power); //increase temppower
cb->setObjProperty(id, ObjProperty::MONSTER_COUNT, std::min (power/1000 , (ui32)CREEP_SIZE)); //set new amount
cb->setObjProperty(id, ObjProperty::MONSTER_POWER, power); //increase temppower
}
if (STACK_EXP)
cb->setObjProperty(id, 12, 10000); //for testing purpose
cb->setObjProperty(id, ObjProperty::MONSTER_EXP, 10000); //for testing purpose
}
void CGCreature::setPropertyDer(ui8 what, ui32 val)
{
switch (what)
{
case 10:
case ObjProperty::MONSTER_COUNT:
stacks[0]->count = val;
break;
case 11:
case ObjProperty::MONSTER_POWER:
temppower = val;
break;
case 12:
case ObjProperty::MONSTER_EXP:
giveStackExp(val);
break;
case 13: