Browse Source

Added a missing rturn in CGameHandler::isAllowedExchangeForQuery. Fixed several typos.

Frank Zago 14 years ago
parent
commit
c4b8039c1e

+ 2 - 2
client/CBattleInterface.h

@@ -75,7 +75,7 @@ public:
 	virtual void nextFrame()=0; //call every new frame
 	virtual void endAnim(); //to be called mostly internally; in this class it removes animation from pendingAnims list
 
-	bool isEarliest(bool perStackConcurrency); //determines if this animation is earlies of all
+	bool isEarliest(bool perStackConcurrency); //determines if this animation is earliest of all
 
 	unsigned int ID; //unique identifier
 
@@ -439,7 +439,7 @@ private:
 	const CStack * stackToActivate; //when animation is playing, we should wait till the end to make the next stack active; NULL of none
 	void activateStack(); //sets activeStack to stackToActivate etc.
 	int mouseHoveredStack; //stack hovered by mouse; if -1 -> none
-    time_t lastMouseHoveredStackAnimationTime; // time when last mouse hovered animation occured
+    time_t lastMouseHoveredStackAnimationTime; // time when last mouse hovered animation occurred
     static const time_t HOVER_ANIM_DELTA;
 	std::vector<THex> occupyableHexes, //hexes available for active stack
 		attackableHexes; //hexes attackable by active stack

+ 2 - 2
client/CCreatureAnimation.cpp

@@ -75,7 +75,7 @@ CCreatureAnimation::CCreatureAnimation(std::string name) : internalFrame(0), onc
 		}
 		/*int unknown2 = readNormalNr<4>(i,FDef);*/ i+=4; //TODO use me
 		/*int unknown3 = readNormalNr<4>(i,FDef);*/ i+=4; //TODO use me
-		i+=13*totalInBlock; //ommiting names
+		i+=13*totalInBlock; //omitting names
 		for (j=0; j<totalInBlock; j++)
 		{ 
 			SEntries[totalEntries+j].offset = readNormalNr<4>(i,FDef); i+=4;
@@ -314,7 +314,7 @@ inline void CCreatureAnimation::putPixel(
 		else if (palc == 5) //selection highlight or transparent
 		{
 			if(blueBorder)
-				ColorPutter<bpp, 0>::PutColor(p, color.B, color.G - 0xf0 + animCount, color.R - 0xf0 + animCount); //shouldnt it be reversed? its bgr instead of rgb
+				ColorPutter<bpp, 0>::PutColor(p, color.B, color.G - 0xf0 + animCount, color.R - 0xf0 + animCount); //shouldn't it be reversed? its bgr instead of rgb
 			else if (yellowBorder)
 				ColorPutter<bpp, 0>::PutColor(p, color.R - 0xf0 + animCount, color.G - 0xf0 + animCount, color.B);
 		}

+ 1 - 1
client/CMT.cpp

@@ -433,7 +433,7 @@ void processCommand(const std::string &message)
 			conf.SetResolution(j->first.first, j->first.second);
 			conf.cc.screenx = j->first.first;
 			conf.cc.screeny = j->first.second;
-			tlog0 << "Screen resolution set to " << conf.cc.resx << " x " << conf.cc.resy <<". It will be aplied when the game starts.\n";
+			tlog0 << "Screen resolution set to " << conf.cc.resx << " x " << conf.cc.resy <<". It will be applied when the game starts.\n";
 		}
 	}
 	else if(message=="get txt")

+ 1 - 1
client/CPlayerInterface.cpp

@@ -690,7 +690,7 @@ void CPlayerInterface::battleStacksRemoved(const BattleStacksRemoved & bsr)
 	}
 }
 
-void CPlayerInterface::battleNewRound(int round) //called at the beggining of each turn, round=-1 is the tactic phase, round=0 is the first "normal" turn
+void CPlayerInterface::battleNewRound(int round) //called at the beginning of each turn, round=-1 is the tactic phase, round=0 is the first "normal" turn
 {
 	if(LOCPLINT != this)
 	{ //another local interface should do this

+ 1 - 1
client/CPlayerInterface.h

@@ -219,7 +219,7 @@ public:
 	void battleAttack(const BattleAttack *ba) OVERRIDE; //stack performs attack
 	void battleEnd(const BattleResult *br) OVERRIDE; //end of battle
 	void battleNewRoundFirst(int round) OVERRIDE; //called at the beginning of each turn before changes are applied; used for HP regen handling
-	void battleNewRound(int round) OVERRIDE; //called at the beggining of each turn, round=-1 is the tactic phase, round=0 is the first "normal" turn
+	void battleNewRound(int round) OVERRIDE; //called at the beginning of each turn, round=-1 is the tactic phase, round=0 is the first "normal" turn
 	void battleStackMoved(const CStack * stack, std::vector<THex> dest, int distance) OVERRIDE;
 	void battleSpellCast(const BattleSpellCast *sc) OVERRIDE;
 	void battleStacksEffectsSet(const SetStackEffect & sse) OVERRIDE; //called when a specific effect is set to stacks

+ 1 - 1
client/GUIClasses.cpp

@@ -4998,7 +4998,7 @@ void LRClickableAreaWTextComp::clickRight(tribool down, bool previousState)
 		}
 	}
 
-	LRClickableAreaWText::clickRight(down, previousState); //only if with-component variant not occured
+	LRClickableAreaWText::clickRight(down, previousState); //only if with-component variant not occurred
 }
 
 CHeroArea::CHeroArea(int x, int y, const CGHeroInstance * _hero):hero(_hero)

+ 1 - 1
client/GUIClasses.h

@@ -1034,7 +1034,7 @@ public:
 
 	AdventureMapButton * leftArtRoll, * rightArtRoll;
 	bool allowedAssembling;
-	std::multiset<const CArtifactInstance*> artifactsOnAltar; //artifacts id that are technically present in backpack but in GUI are moved to the altar - they'll be ommited in backpack slots
+	std::multiset<const CArtifactInstance*> artifactsOnAltar; //artifacts id that are technically present in backpack but in GUI are moved to the altar - they'll be omitted in backpack slots
 	boost::function<void(CArtPlace*)> highlightModeCallback; //if set, clicking on art place doesn't pick artifact but highlights the slot and calls this function
 
 	void realizeCurrentTransaction(); //calls callback with parameters stored in commonInfo

+ 1 - 1
client/NetPacksClient.cpp

@@ -711,7 +711,7 @@ void PackageApplied::applyCl( CClient *cl )
 	if(cl->waitingRequest.get() == packType)
 		cl->waitingRequest.setn(false);
 	else if(cl->waitingRequest.get())
-		tlog3 << "Suprising server message!\n";
+		tlog3 << "Surprising server message!\n";
 }
 
 void SystemMessage::applyCl( CClient *cl )

+ 2 - 2
client/mapHandler.cpp

@@ -247,7 +247,7 @@ void CMapHandler::initObjectRects()
 		const CGObjectInstance *obj = map->objects[f];
 		if(	!obj
 			|| (obj->ID==HEROI_TYPE && static_cast<const CGHeroInstance*>(obj)->inTownGarrison) //garrisoned hero
-			|| (obj->ID==8 && static_cast<const CGBoat*>(obj)->hero) //boat wih hero (hero graphics is used)
+			|| (obj->ID==8 && static_cast<const CGBoat*>(obj)->hero) //boat with hero (hero graphics is used)
 			|| !obj->defInfo
 			|| !graphics->getDef(obj)) //no graphic...
 		{
@@ -349,7 +349,7 @@ void CMapHandler::init()
 	sizes.y = map->height;
 	sizes.z = map->twoLevel+1;
 
-	// Total number of visible tiles. Substract the center tile, then
+	// Total number of visible tiles. Subtract the center tile, then
 	// compute the number of tiles on each side, and reassemble.
 	int t1, t2;
 	t1 = (mapW-32)/2;

+ 4 - 4
lib/CArtHandler.cpp

@@ -440,7 +440,7 @@ void CArtHandler::erasePickedArt (si32 id)
 		default: //special artifacts should not be erased
 			return;
 	}
-	ptr->erase (std::find(ptr->begin(), ptr->end(), art)); //remove the artifact from avaliable list
+	ptr->erase (std::find(ptr->begin(), ptr->end(), art)); //remove the artifact from available list
 }
 ui16 CArtHandler::getRandomArt(int flags)
 {
@@ -474,7 +474,7 @@ void CArtHandler::getAllowed(std::vector<ConstTransitivePtr<CArtifact> > &out, i
 		getAllowedArts (out, &majors, CArtifact::ART_MAJOR);
 		getAllowedArts (out, &relics, CArtifact::ART_RELIC);
 	}
-	if (!out.size()) //no arts are avaliable at all
+	if (!out.size()) //no arts are available at all
 	{
 		out.resize (64);
 		std::fill_n (out.begin(), 64, artifacts[2]); //Give Grail - this can't be banned (hopefully)
@@ -482,7 +482,7 @@ void CArtHandler::getAllowed(std::vector<ConstTransitivePtr<CArtifact> > &out, i
 }
 void CArtHandler::getAllowedArts(std::vector<ConstTransitivePtr<CArtifact> > &out, std::vector<CArtifact*> *arts, int flag)
 {
-	if (arts->empty()) //restock avaliable arts
+	if (arts->empty()) //restock available arts
 	{
 		for (int i = 0; i < allowedArtifacts.size(); ++i)
 		{
@@ -1466,4 +1466,4 @@ si32 CCreatureArtifactSet::getArtTypeId(ui16 pos) const
 		return -1;
 	}
 	return a->artType->id;
-}
+}

+ 1 - 1
lib/CArtHandler.h

@@ -73,7 +73,7 @@ public:
 
 	int firstAvailableSlot(const CGHeroInstance *h) const;
 	int firstBackpackSlot(const CGHeroInstance *h) const;
-	int getGivenSpellID() const; //to be used with scrolls (and similiar arts), -1 if none
+	int getGivenSpellID() const; //to be used with scrolls (and similar arts), -1 if none
 
 	virtual bool canBePutAt(const ArtifactLocation &al, bool assumeDestRemoved = false) const;
 	virtual bool canBeDisassembled() const;

+ 1 - 1
lib/CBuildingHandler.cpp

@@ -43,7 +43,7 @@ static CBuilding * readBg(std::string &buf, int& it)
 	for(int res=0;res<7;res++)
 		nb->resources[res] = readNr(buf,it);
 	/*nb->refName = */readTo(buf,it,'\n');
-	//reference name is ommitted, it's seems to be useless
+	//reference name is omitted, it's seems to be useless
 	return nb;
 }
 void CBuildingHandler::loadBuildings()

+ 2 - 2
lib/CGameState.cpp

@@ -466,7 +466,7 @@ CGHeroInstance * CGameState::HeroesPool::pickHeroFor(bool native, int player, co
 			if(pavailable.find(i->first)->second & 1<<player
 				&& i->second->type->heroType/2 == town->typeID)
 			{
-				pool.push_back(i->second); //get all avaliable heroes
+				pool.push_back(i->second); //get all available heroes
 			}
 		}
 		if(!pool.size())
@@ -2963,4 +2963,4 @@ CPathfinder::CPathfinder(CPathsInfo &_out, CGameState *_gs, const CGHeroInstance
 {
 	useSubterraneanGates = true;
 	allowEmbarkAndDisembark = true;
-}
+}

+ 1 - 1
lib/CGameState.h

@@ -73,7 +73,7 @@ namespace boost
 	class shared_mutex;
 }
 
-//numbers of creatures are exact numbers if detailed else they are quantity ids (0 - a few, 1 - several and so on; additionaly -1 - unknown)
+//numbers of creatures are exact numbers if detailed else they are quantity ids (0 - a few, 1 - several and so on; additionally -1 - unknown)
 struct ArmyDescriptor : public std::map<TSlot, CStackBasicDescriptor>
 {
 	bool isDetailed; 

+ 1 - 1
lib/CHeroHandler.cpp

@@ -367,7 +367,7 @@ void CHeroHandler::loadHeroClasses()
 	const int BUFFER_SIZE = 5000;
 	char buffer[BUFFER_SIZE+1];
 
-	for(int i=0; i<3; ++i) str.getline(buffer, BUFFER_SIZE); //omiting rubbish
+	for(int i=0; i<3; ++i) str.getline(buffer, BUFFER_SIZE); //omitting rubbish
 
 
 	for(int ss=0; ss<18; ++ss) //18 classes of hero (including conflux)

+ 7 - 7
lib/CObjectHandler.cpp

@@ -719,7 +719,7 @@ void CGHeroInstance::initHero()
 	else //remove placeholder
 		spells -= 0xffffffff;
 
-	if(!getArt(Arts::MACH4) && !getArt(Arts::SPELLBOOK) && type->startingSpell >= 0) //no catapult means we haven't read pre-existant set -> use default rules for spellbook
+	if(!getArt(Arts::MACH4) && !getArt(Arts::SPELLBOOK) && type->startingSpell >= 0) //no catapult means we haven't read pre-existent set -> use default rules for spellbook
 		putArtifact(Arts::SPELLBOOK, CArtifactInstance::createNewArtifactInstance(0));
 
 	if(!getArt(Arts::MACH4))
@@ -809,7 +809,7 @@ void CGHeroInstance::initArmy(IArmyDescriptor *dst /*= NULL*/)
 			if(!getArt(slot))
 				putArtifact(slot, CArtifactInstance::createNewArtifactInstance(aid));
 			else
-				tlog3 << "Hero " << name << " already has artifact at " << slot << ", ommiting giving " << aid << std::endl;
+				tlog3 << "Hero " << name << " already has artifact at " << slot << ", omitting giving " << aid << std::endl;
 		}
 		else
 			dst->setCreature(stackNo-warMachinesGiven, creID, count);
@@ -968,7 +968,7 @@ void CGHeroInstance::initObj()
 				bonus->type = Bonus::SECONDARY_SKILL_PREMY; //value will be calculated later
 				speciality.addNewBonus(bonus);
 				break;
-			case 3://spell damage bonus, level dependant but calculated elsehwere
+			case 3://spell damage bonus, level dependent but calculated elsewhere
 				bonus->type = Bonus::SPECIAL_SPELL_LEV;
 				bonus->subtype = it->subtype;
 				speciality.addNewBonus(bonus);
@@ -2069,7 +2069,7 @@ void CGTownInstance::newTurn() const
 					StackLocation sl(this, pos);
 
 					const CCreature *c = getCreature(pos);
-					if (rand()%100 < 90 || c->upgrades.empty()) //increase number if no upgrade avaliable
+					if (rand()%100 < 90 || c->upgrades.empty()) //increase number if no upgrade available
 					{
 						cb->changeStackCount(sl, c->growth);
 					}
@@ -2113,7 +2113,7 @@ ui8 CGTownInstance::getPassableness() const
 {
 	if (!armedGarrison())//empty castle - anyone can visit
 		return ALL_PLAYERS;
-	if ( tempOwner == 255 )//neutral guarded - noone can visit
+	if ( tempOwner == 255 )//neutral guarded - no one can visit
 		return 0;
 		
 	ui8 mask = 0;
@@ -4478,7 +4478,7 @@ void CGSeerHut::finishQuest(const CGHeroInstance * h, ui32 accept) const
 			default:
 				break;
 		}
-		cb->setObjProperty(id,11,0); //no more mission avaliable	
+		cb->setObjProperty(id,11,0); //no more mission available	
 		completeQuest(h); //make sure to remove QuestQuard at the very end	
 	}
 }
@@ -5456,7 +5456,7 @@ ui8 CGGarrison::getPassableness() const
 {
 	if ( !stacksCount() )//empty - anyone can visit
 		return ALL_PLAYERS;
-	if ( tempOwner == 255 )//neutral guarded - noone can visit
+	if ( tempOwner == 255 )//neutral guarded - no one can visit
 		return 0;
 		
 	ui8 mask = 0;

+ 1 - 1
lib/CObjectHandler.h

@@ -684,7 +684,7 @@ class DLL_EXPORT CGCreature : public CArmedInstance //creatures on map
 {
 public:
 	ui32 identifier; //unique code for this monster (used in missions)
-	si8 character; //chracter of this set of creatures (0 - the most friendly, 4 - the most hostile) => on init changed to 0 (compliant) - 10 value (savage)
+	si8 character; //character of this set of creatures (0 - the most friendly, 4 - the most hostile) => on init changed to 0 (compliant) - 10 value (savage)
 	std::string message; //message printed for attacking hero
 	std::vector<ui32> resources; //[res_id], resources given to hero that has won with monsters
 	si32 gainedArtifact; //ID of artifact gained to hero, -1 if none

+ 1 - 1
lib/Connection.h

@@ -899,7 +899,7 @@ public:
 	TSocket * socket;
 	bool logging;
 	bool connected;
-	bool myEndianess, contactEndianess; //true if little endian, if ednianess is different we'll have to revert recieved multi-byte vars
+	bool myEndianess, contactEndianess; //true if little endian, if endianess is different we'll have to revert received multi-byte vars
     boost::asio::io_service *io_service;
 	std::string name; //who uses this connection
 

+ 3 - 3
lib/HeroBonus.h

@@ -51,7 +51,7 @@ namespace PrimarySkill
 	BONUS_NAME(NONEVIL_ALIGNMENT_MIX) /*good and neutral creatures can be mixed without morale penalty*/  \
 	BONUS_NAME(SECONDARY_SKILL_PREMY) /*%*/  \
 	BONUS_NAME(SURRENDER_DISCOUNT) /*%*/  \
-	BONUS_NAME(STACKS_SPEED)  /*additional info - percent of speed bonus applied after direct bonuses; >0 - added, <0 - substracted to this part*/ \
+	BONUS_NAME(STACKS_SPEED)  /*additional info - percent of speed bonus applied after direct bonuses; >0 - added, <0 - subtracted to this part*/ \
 	BONUS_NAME(FLYING_MOVEMENT) /*subtype 1 - without penalty, 2 - with penalty*/ \
 	BONUS_NAME(SPELL_DURATION) \
 	BONUS_NAME(AIR_SPELL_DMG_PREMY) \
@@ -175,7 +175,7 @@ namespace PrimarySkill
 	BONUS_NAME(CREATURE_ENCHANT_POWER) /* total duration of spells casted by creature */ \
 	BONUS_NAME(REBIRTH) /* val - percent of life restored, subtype = 0 - regular, 1 - at least one unit (sacred Phoenix) */
 
-/// Struct for handling bonuses of several types. Can be transfered to any hero
+/// Struct for handling bonuses of several types. Can be transferred to any hero
 struct DLL_EXPORT Bonus
 {
 	enum BonusType
@@ -245,7 +245,7 @@ struct DLL_EXPORT Bonus
 	ui8 valType; //by ValueType enum
 
 	si32 additionalInfo;
-	ui8 effectRange; //if not NO_LIMIT, bonus will be ommitted by default
+	ui8 effectRange; //if not NO_LIMIT, bonus will be omitted by default
 
 	boost::shared_ptr<ILimiter> limiter;
 	boost::shared_ptr<IPropagator> propagator;

+ 1 - 1
lib/NetPacks.h

@@ -624,7 +624,7 @@ struct SetHeroesInTown : public CPackForClient //508
 // 		h & hid & artifacts & artifWorn;
 // 	}
 // 
-// 	std::vector<const CArtifact*> equiped, unequiped; //used locally
+// 	std::vector<const CArtifact*> equipped, unequipped; //used locally
 // 	BonusList gained, lost; //used locally as hlp when applying
 // };   
 

+ 2 - 2
lib/NetPacksLib.cpp

@@ -685,7 +685,7 @@ DLL_EXPORT void AssembledArtifact::applyGs( CGameState *gs )
 
 	CCombinedArtifactInstance *combinedArt = new CCombinedArtifactInstance(builtArt);
 	gs->map->addNewArtifactInstance(combinedArt);
-	//retreive all constituents
+	//retrieve all constituents
 	BOOST_FOREACH(si32 constituentID, *builtArt->constituents)
 	{
 		int pos = h->getArtPos(constituentID);
@@ -1322,4 +1322,4 @@ DLL_EXPORT Component::Component(const CStackBasicDescriptor &stack)
 	:id(CREATURE), subtype(stack.type->idNumber), val(stack.count), when(0)
 {
 
-}
+}

+ 3 - 3
lib/map.cpp

@@ -1761,7 +1761,7 @@ void Mapa::readObjects( const unsigned char * bufor, int &i)
 				CGHeroPlaceholder *hp = new CGHeroPlaceholder();;
 				nobj = hp;
 
-				int a = bufor[i++]; //unkown byte, seems to be always 0 (if not - scream!)
+				int a = bufor[i++]; //unknown byte, seems to be always 0 (if not - scream!)
 				tlog2 << "Unhandled Hero Placeholder detected: "<<a<<"\n";
 
 				int htid = bufor[i++]; //hero type id
@@ -1953,7 +1953,7 @@ void Mapa::loadQuest(CQuest * guard, const unsigned char * bufor, int & i)
 			{
 				int artid = readNormalNr(bufor,i, 2); i+=2;
 				guard->m5arts.push_back(artid); 
-				allowedArtifact[artid] = false; //these are unavaliable for random generation
+				allowedArtifact[artid] = false; //these are unavailable for random generation
 			}
 			break;
 		}
@@ -2178,4 +2178,4 @@ bool TerrainTile::isCoastal() const
 bool TerrainTile::hasFavourableWinds() const
 {
 	return siodmyTajemniczyBajt & 128;
-}
+}

+ 1 - 1
lib/map.h

@@ -100,7 +100,7 @@ struct DLL_EXPORT PlayerInfo
 	ui32 AITactic; //(00 - random, 01 -  warrior, 02 - builder, 03 - explorer)
 	ui32 allowedFactions; //(01 - castle; 02 - rampart; 04 - tower; 08 - inferno; 16 - necropolis; 32 - dungeon; 64 - stronghold; 128 - fortress; 256 - conflux);
 	ui8 isFactionRandom;
-	ui32 mainHeroPortrait; //it's ID of hero with choosen portrait; 255 if standard
+	ui32 mainHeroPortrait; //it's ID of hero with chosen portrait; 255 if standard
 	std::string mainHeroName;
 	std::vector<SheroName> heroesNames;
 	ui8 hasMainTown;

+ 5 - 3
server/CGameHandler.cpp

@@ -1293,7 +1293,7 @@ void CGameHandler::setupBattle( int3 tile, const CArmedInstance *armies[2], cons
 void CGameHandler::checkForBattleEnd( std::vector<CStack*> &stacks )
 {
 	//checking winning condition
-	bool hasStack[2]; //hasStack[0] - true if attacker has a living stack; defender similarily
+	bool hasStack[2]; //hasStack[0] - true if attacker has a living stack; defender similarly
 	hasStack[0] = hasStack[1] = false;
 	for(int b = 0; b<stacks.size(); ++b)
 	{
@@ -3153,7 +3153,7 @@ bool CGameHandler::makeBattleAction( BattleAction &ba )
 				break;
 			}
 			int wallInitHP = gs->curB->si.wallState[attackedPart];
-			int dmgAlreadyDealt = 0; //in successive iterations damage is dealt but not yet substracted from wall's HPs
+			int dmgAlreadyDealt = 0; //in successive iterations damage is dealt but not yet subtracted from wall's HPs
 			for(int g=0; g<sbi.shots; ++g)
 			{
 				if(wallInitHP + dmgAlreadyDealt == 3) //it's not destroyed
@@ -4004,6 +4004,8 @@ bool CGameHandler::isAllowedExchangeForQuery(int id1, int id2) {
 		if((id1 == i->second.first && id2 == i->second.second) ||
 		   (id2 == i->second.first && id1 == i->second.second))
 			return true;
+
+	return false;
 }
 
 bool CGameHandler::isAllowedExchange( int id1, int id2 )
@@ -4444,7 +4446,7 @@ void CGameHandler::handleAfterAttackCasting( const BattleAttack & bat )
 		staredCreatures += attacker->type->level * attacker->valOfBonuses(Bonus::DEATH_STARE, 1);
 		if (staredCreatures)
 		{
-			if (bat.bsa.size() && bat.bsa[0].newAmount > 0) //TODO: death stare was not originally avaliable for multiple-hex attacks, but...
+			if (bat.bsa.size() && bat.bsa[0].newAmount > 0) //TODO: death stare was not originally available for multiple-hex attacks, but...
 			handleSpellCasting(79, 0, gs->curB->getStack(bat.bsa[0].stackAttacked)->position,
 				!attacker->attackerOwned, attacker->owner, NULL, NULL, staredCreatures, SpellCasting::AFTER_ATTACK_CASTING, attacker);
 		}