From 7dce558e2815105eeb008ae87bdd3435e528cc05 Mon Sep 17 00:00:00 2001 From: DjWarmonger Date: Fri, 24 Jun 2011 18:16:28 +0000 Subject: [PATCH] More fixes. Estates skill is now handled as a Bonus. --- client/CKingdomInterface.cpp | 2 +- lib/CObjectHandler.cpp | 2 ++ server/CGameHandler.cpp | 8 ++++---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/client/CKingdomInterface.cpp b/client/CKingdomInterface.cpp index c30fc4d83..2f567f4ec 100644 --- a/client/CKingdomInterface.cpp +++ b/client/CKingdomInterface.cpp @@ -167,7 +167,7 @@ CKingdomInterface::CKingdomInterface() std::vector heroes = LOCPLINT->cb->getHeroesInfo(true); for(size_t i=0; ivalOfBonuses(Selector::typeSubtype(Bonus::SECONDARY_SKILL, CGHeroInstance::ESTATES)); + incomesVal[7] += heroes[i]->valOfBonuses(Selector::typeSubtype(Bonus::SECONDARY_SKILL_PREMY, CGHeroInstance::ESTATES)); incomesVal[7] += heroes[i]->valOfBonuses(Selector::typeSubtype(Bonus::GENERATE_RESOURCE, Res::GOLD)); } std::vector towns = LOCPLINT->cb->getTownsInfo(true); diff --git a/lib/CObjectHandler.cpp b/lib/CObjectHandler.cpp index 52f494c75..0780358ec 100644 --- a/lib/CObjectHandler.cpp +++ b/lib/CObjectHandler.cpp @@ -1224,6 +1224,8 @@ void CGHeroInstance::updateSkill(int which, int val) skillVal = 5 << (val-1); break; case FIRST_AID: skillVal = 25 + 25*val; break; + case ESTATES: + skillVal = 125 << (val-1); break; } diff --git a/server/CGameHandler.cpp b/server/CGameHandler.cpp index 5475b9701..57f058609 100644 --- a/server/CGameHandler.cpp +++ b/server/CGameHandler.cpp @@ -916,7 +916,7 @@ void CGameHandler::newTurn() if(gs->day) //not first day { - n.res[i->first][Res::GOLD] += h->valOfBonuses(Selector::typeSubtype(Bonus::SECONDARY_SKILL, CGHeroInstance::ESTATES)); //estates + n.res[i->first][Res::GOLD] += h->valOfBonuses(Selector::typeSubtype(Bonus::SECONDARY_SKILL_PREMY, CGHeroInstance::ESTATES)); //estates for (int k = 0; k < RESOURCE_QUANTITY; k++) { @@ -948,12 +948,12 @@ void CGameHandler::newTurn() { if((**j).town->primaryRes == 127) //we'll give wood and ore { - n.res[player][Res::WOOD] += 1; - n.res[player][Res::ORE] += 1; + n.res[player][Res::WOOD] ++; + n.res[player][Res::ORE] ++; } else { - n.res[player][(**j).town->primaryRes] += 1; + n.res[player][(**j).town->primaryRes] ++;; } } n.res[player][6] += (**j).dailyIncome();