Explorar o código

A bunch of minor fixes, including enforced conversion warnings.

DjWarmonger %!s(int64=16) %!d(string=hai) anos
pai
achega
9dbb6b03dd
Modificáronse 3 ficheiros con 5 adicións e 5 borrados
  1. 1 1
      hch/CHeroHandler.cpp
  2. 2 2
      hch/CObjectHandler.cpp
  3. 2 2
      hch/CObjectHandler.h

+ 1 - 1
hch/CHeroHandler.cpp

@@ -412,7 +412,7 @@ ui64 CHeroHandler::reqExp(unsigned int level)
 		//	exp*=1.2;
 		//}
 		//return exp;
-		return reqExp(level - 1) + (reqExp(level - 1) - reqExp(level - 2)) * 1.2; //inefficient but follows exactly H3 values
+		return (ui64)(reqExp(level - 1) + (reqExp(level - 1) - reqExp(level - 2)) * 1.2); //inefficient but follows exactly H3 values
 	}
 }
 

+ 2 - 2
hch/CObjectHandler.cpp

@@ -1803,7 +1803,7 @@ int CGCreature::takenAction(const CGHeroInstance *h, bool allowJoin) const
 		if(hlp >= 7)
 			factor = 11;
 		else if(hlp >= 1)
-			factor = 2*(hlp-1);
+			factor = (int)(2*(hlp-1));
 		else if(hlp >= 0.5)
 			factor = -1;
 		else if(hlp >= 0.333)
@@ -3824,7 +3824,7 @@ void CGSirens::onHeroVisit( const CGHeroInstance * h ) const
 		sg.garrs[h->id] = h->army;
 		for (std::map<si32,std::pair<ui32,si32> >::const_iterator i = h->army.slots.begin(); i != h->army.slots.end(); i++)
 		{
-			int drown = i->second.second * 0.3;
+			int drown = (int)(i->second.second * 0.3);
 			if(drown)
 			{
 				sg.garrs[h->id].slots[i->first].second -= drown;

+ 2 - 2
hch/CObjectHandler.h

@@ -852,9 +852,9 @@ class DLL_EXPORT CBank : public CArmedInstance
 	public:
 	int index; //banks have unusal numbering - see ZCRBANK.txt and initObj()
 	BankConfig *bc;
-	ui8 multiplier; //for improved banks script, in percent
+	float multiplier; //for improved banks script, in percent
 	std::vector<si32> artifacts; //fixed and deterministic
-	mutable ui32 daycounter;
+	ui32 daycounter;
 
 	void initObj();
 	void setPropertyDer (ui8 what, ui32 val);