Browse Source

* fixed #863 — all members of team will receive notification about FoW change
* fixed #486
* removed reference to a deleted file from lib VC project file

Michał W. Urbańczyk 13 years ago
parent
commit
5afa5cfb54
3 changed files with 13 additions and 10 deletions
  1. 12 8
      client/NetPacksClient.cpp
  2. 1 1
      lib/CDefObjInfoHandler.cpp
  3. 0 1
      lib/VCMI_lib.vcxproj

+ 12 - 8
client/NetPacksClient.cpp

@@ -156,10 +156,15 @@ void SetMovePoints::applyCl( CClient *cl )
 
 void FoWChange::applyCl( CClient *cl )
 {
-	if(mode)
-		INTERFACE_CALL_IF_PRESENT(player, tileRevealed, tiles);
-	else
-		INTERFACE_CALL_IF_PRESENT(player, tileHidden, tiles);
+
+	BOOST_FOREACH(auto &i, cl->playerint)
+		if(cl->getPlayerRelations(i.first, player) > 0) //ally or the same player 
+		{
+			if(mode)
+				i.second->tileRevealed(tiles);
+			else
+				i.second->tileHidden(tiles);
+		}
 
 	cl->invalidatePaths();
 }
@@ -368,10 +373,9 @@ void TryMoveHero::applyCl( CClient *cl )
 
 	int player = h->tempOwner;
 
-	if(vstd::contains(cl->playerint,player))
-	{
-		cl->playerint[player]->tileRevealed(fowRevealed);
-	}
+	BOOST_FOREACH(auto &i, cl->playerint)
+		if(cl->getPlayerRelations(i.first, player) > 0) //ally or the same player 
+			i.second->tileRevealed(fowRevealed);
 
 	//notify interfaces about move
 	for(std::map<ui8, CGameInterface*>::iterator i=cl->playerint.begin();i!=cl->playerint.end();i++)

+ 1 - 1
lib/CDefObjInfoHandler.cpp

@@ -132,8 +132,8 @@ void CDefObjInfoHandler::load()
 		if(i)
 		{
 			gobjs[124][i] = new CGDefInfo(*gobjs[124][0]);
-			gobjs[124][i]->name = holeDefs[i];
 		}
+		gobjs[124][i]->name = holeDefs[i];
 	}
 }
  

+ 0 - 1
lib/VCMI_lib.vcxproj

@@ -262,7 +262,6 @@
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\Global.h" />
-    <ClInclude Include="..\StartInfo.h" />
     <ClInclude Include="AI_Base.h" />
     <ClInclude Include="BattleAction.h" />
     <ClInclude Include="BattleHex.h" />