浏览代码

Added important fix reverted in r1817.

DjWarmonger 15 年之前
父节点
当前提交
1f2e9bf9c2
共有 2 个文件被更改,包括 6 次插入5 次删除
  1. 5 5
      lib/NetPacksLib.cpp
  2. 1 0
      server/CGameHandler.cpp

+ 5 - 5
lib/NetPacksLib.cpp

@@ -630,11 +630,6 @@ DLL_EXPORT void NewTurn::applyGs( CGameState *gs )
 		BOOST_FOREACH(CGHeroInstance *h, gs->map->heroes)
 			h->bonuses.remove_if(Bonus::OneDay);
 
-		if(resetBuilded) //reset amount of structures set in this turn in towns
-		{
-			BOOST_FOREACH(CGTownInstance* t, gs->map->towns)
-				t->builded = 0;
-		}
 		if(gs->getDate(1)) //new week, Monday that is
 		{
 			for( std::map<ui8, PlayerState>::iterator i=gs->players.begin() ; i!=gs->players.end();i++)
@@ -690,6 +685,11 @@ DLL_EXPORT void NewTurn::applyGs( CGameState *gs )
 
 			i->second.bonuses.remove_if(Bonus::OneDay);
 		}
+		if(resetBuilded) //reset amount of structures set in this turn in towns
+		{
+			BOOST_FOREACH(CGTownInstance* t, gs->map->towns)
+				t->builded = 0;
+		}
 	}
 }
 

+ 1 - 0
server/CGameHandler.cpp

@@ -1210,6 +1210,7 @@ void CGameHandler::newTurn()
 		NewTurn n2; //just to handle  creature growths after bonuses are applied
 		n2.specialWeek = NewTurn::NO_ACTION;
 		n2.day = gs->day;
+		n2.resetBuilded = true;
 
 		for(std::vector<CGTownInstance *>::iterator j = gs->map->towns.begin(); j!=gs->map->towns.end(); j++)//handle towns
 		{