Browse Source

Possibly "fixed" #915.
Fixed server output (printing ui8 as %d apparently breaks boost.format :/).

Michał W. Urbańczyk 13 years ago
parent
commit
c80d9b0a51
3 changed files with 8 additions and 2 deletions
  1. 2 1
      lib/CGameState.h
  2. 5 0
      lib/HeroBonus.cpp
  3. 1 1
      server/CGameHandler.cpp

+ 2 - 1
lib/CGameState.h

@@ -176,7 +176,8 @@ public:
 	template <typename Handler> void serialize(Handler &h, const int version)
 	{
 		h & color & human & currentSelection & team & resources & status;
-		h & heroes & towns & availableHeroes & dwellings & getBonusList();
+		h & heroes & towns & availableHeroes & dwellings;
+		h & getBonusList(); //FIXME FIXME FIXME 
 		h & status & daysWithoutCastle;
 		h & enteredLosingCheatCode & enteredWinningCheatCode;
 		h & static_cast<CBonusSystemNode&>(*this);

+ 5 - 0
lib/HeroBonus.cpp

@@ -695,6 +695,11 @@ void CBonusSystemNode::unpropagateBonus(Bonus * b)
 	if(b->propagator->shouldBeAttached(this))
 	{
 		bonuses -= b;
+		while(vstd::contains(bonuses, b))
+		{
+			tlog1 << "Bonus was duplicated (" << b->Description() << ") at " << nodeName() << std::endl;
+			bonuses -= b;
+		}
 		BONUS_LOG_LINE("#$#" << b->Description() << " #is no longer propagated to# " << nodeName());
 	}
 

+ 1 - 1
server/CGameHandler.cpp

@@ -638,7 +638,7 @@ void CGameHandler::handleConnection(std::set<int> players, CConnection &c)
 				packType = typeList.getTypeID(pack); //get the id of type
 				
 				tlog5 << boost::format("Received client message (request %d by player %d) of type with ID=%d (%s).\n")
-					% requestID % player % packType % typeid(*pack).name();
+					% requestID % (int)player % packType % typeid(*pack).name();
 			}
 
 			//prepare struct informing that action was applied