1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-28 23:06:24 +02:00

addNewBonus: add turnsRemain check for N_TURNS, N_DAYS and ONE_WEEK

This commit is contained in:
ArseniyShestakov 2015-11-20 14:37:57 +03:00
parent f99ffbd074
commit b48d65ad57

View File

@ -780,6 +780,12 @@ void CBonusSystemNode::updateBonuses(const CSelector &s)
void CBonusSystemNode::addNewBonus(Bonus *b)
{
//turnsRemain shouldn't be zero for following durations
if(Bonus::NTurns(b) || Bonus::NDays(b) || Bonus::OneWeek(b))
{
assert(b->turnsRemain);
}
assert(!vstd::contains(exportedBonuses,b));
exportedBonuses.push_back(b);
exportBonus(b);