Browse Source

gcc compilation fixes.

OnionKnight 16 years ago
parent
commit
e3eeed0b70
5 changed files with 8 additions and 7 deletions
  1. 2 2
      client/CPreGame.cpp
  2. 1 1
      client/GUIBase.h
  3. 1 1
      client/GUIClasses.cpp
  4. 2 2
      hch/CObjectHandler.cpp
  5. 2 1
      lib/NetPacks.h

+ 2 - 2
client/CPreGame.cpp

@@ -799,7 +799,7 @@ int SelectionTab::getLine()
 {
 	int line = -1;
 	Point clickPos(GH.current->button.x, GH.current->button.y);
-	clickPos -= pos.topLeft();
+	clickPos = clickPos - pos.topLeft();
 
 	if (clickPos.y > 115  &&  clickPos.y < 564  &&  clickPos.x > 52  &&  clickPos.x < 366)
 	{
@@ -1674,4 +1674,4 @@ void CTextInput::setText( const std::string &nText, bool callCb )
 	redraw();
 	if(callCb)
 		cb(text);
-}
+}

+ 1 - 1
client/GUIBase.h

@@ -86,7 +86,7 @@ struct Point
 	template<typename T>
 	Point operator-(const T &b) const
 	{
-		return Point(x+b.x,y+b.y);
+		return Point(x - b.x, y - b.y);
 	}
 
 	template<typename T>

+ 1 - 1
client/GUIClasses.cpp

@@ -2105,7 +2105,7 @@ void CSplitWindow::clickLeft(tribool down, bool previousState)
 	if(down)
 	{
 		Point click(GH.current->motion.x,GH.current->motion.y);
-		click -= pos.topLeft();
+		click = click - pos.topLeft();
 		if(Rect(19,216,105,40).isIn(click)) //left picture
 			which = 0;
 		else if(Rect(175,216,105,40).isIn(click)) //right picture

+ 2 - 2
hch/CObjectHandler.cpp

@@ -2181,7 +2181,7 @@ int CGCreature::takenAction(const CGHeroInstance *h, bool allowJoin) const
 		myKindCres.insert(subID); //we
 		myKindCres.insert(VLC->creh->creatures[subID].upgrades.begin(),VLC->creh->creatures[subID].upgrades.end()); //our upgrades
 		for(std::vector<CCreature>::iterator i=VLC->creh->creatures.begin(); i!=VLC->creh->creatures.end(); i++)
-			if(vstd::contains(i->upgrades,id)) //it's our base creatures
+			if(vstd::contains(i->upgrades, (ui32) id)) //it's our base creatures
 				myKindCres.insert(i->idNumber);
 
 		int count = 0, //how many creatures of our kind has hero
@@ -3655,7 +3655,7 @@ void CGScholar::onHeroVisit( const CGHeroInstance * h ) const
 	int ssl = h->getSecSkillLevel(bid); //current sec skill level, used if bonusType == 1
 	if((type == 1
 			&& ((ssl == 3)  ||  (!ssl  &&  h->secSkills.size() == SKILL_PER_HERO))) ////hero already has expert level in the skill or (don't know skill and doesn't have free slot)
-		|| (type == 2  &&  (!h->getArt(17) || vstd::contains(h->spells,bid)))) //hero doesn't have a spellbook or already knows the spell
+		|| (type == 2  &&  (!h->getArt(17) || vstd::contains(h->spells, (ui32) bid)))) //hero doesn't have a spellbook or already knows the spell
 	{
 		type = 0;
 		bid = ran() % PRIMARY_SKILLS;

+ 2 - 1
lib/NetPacks.h

@@ -700,7 +700,8 @@ struct TradeComponents : public CPackForClient, public CPackForServer
 
 	template <typename Handler> void serialize(Handler &h, const int version)
 	{
-		h & id & heroid & objectid & available & chosen & bought;
+		//FIXME: Deal with id properly.
+		h /* & id */ & heroid & objectid & available & chosen & bought;
 	}
 
 };