Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 424193
Collapse All | Expand All

(-)vcmi-0.89.orig/Global.h (-1 / +1 lines)
Lines 330-336 Link Here
330
	{
330
	{
331
		assert(r.size());
331
		assert(r.size());
332
		index %= r.size();
332
		index %= r.size();
333
		auto itr = std::begin(r);
333
		auto itr = r.begin();
334
		std::advance(itr, index);
334
		std::advance(itr, index);
335
		return *itr;
335
		return *itr;
336
	}
336
	}
(-)vcmi-0.89.orig/lib/BattleState.cpp (-1 / +1 lines)
Lines 2594-2600 Link Here
2594
		if(vstd::contains(obs->getAffectedTiles(), tile))
2594
		if(vstd::contains(obs->getAffectedTiles(), tile))
2595
			return obs;
2595
			return obs;
2596
2596
2597
	return NULL;
2597
	return shared_ptr<CObstacleInstance>();
2598
}
2598
}
2599
2599
2600
const CStack * BattleInfo::getStackIf(boost::function<bool(const CStack*)> pred) const
2600
const CStack * BattleInfo::getStackIf(boost::function<bool(const CStack*)> pred) const
(-)vcmi-0.89.orig/lib/CGameState.cpp (-1 / +1 lines)
Lines 648-654 Link Here
648
648
649
			//golem factory is not in list of cregens but can be placed as random object
649
			//golem factory is not in list of cregens but can be placed as random object
650
			static const int factoryCreatures[] = {32, 33, 116, 117};
650
			static const int factoryCreatures[] = {32, 33, 116, 117};
651
			std::vector<int> factory(std::begin(factoryCreatures), std::end(factoryCreatures));
651
			std::vector<int> factory(factoryCreatures, factoryCreatures + sizeof(factoryCreatures)/sizeof(*factoryCreatures) - 1);
652
			if (vstd::contains(factory, cid))
652
			if (vstd::contains(factory, cid))
653
				result = std::pair<int,int>(20, 1);
653
				result = std::pair<int,int>(20, 1);
654
654
(-)vcmi-0.89.orig/lib/CObjectHandler.cpp (-1 / +1 lines)
Lines 2360-2366 Link Here
2360
2360
2361
bool CGTownInstance::addBonusIfBuilt(int building, int type, int val, int subtype /*= -1*/)
2361
bool CGTownInstance::addBonusIfBuilt(int building, int type, int val, int subtype /*= -1*/)
2362
{
2362
{
2363
	return addBonusIfBuilt(building, type, val, NULL, subtype);
2363
	return addBonusIfBuilt(building, type, val, TPropagatorPtr(), subtype);
2364
}
2364
}
2365
2365
2366
bool CGTownInstance::addBonusIfBuilt(int building, int type, int val, TPropagatorPtr prop, int subtype /*= -1*/)
2366
bool CGTownInstance::addBonusIfBuilt(int building, int type, int val, TPropagatorPtr prop, int subtype /*= -1*/)
(-)vcmi-0.89.orig/lib/CObstacleInstance.cpp (-2 / +2 lines)
Lines 134-138 Link Here
134
{
134
{
135
	//rrr... need initializer lists
135
	//rrr... need initializer lists
136
	static const BattleHex moatHexes[] = {11, 28, 44, 61, 77, 111, 129, 146, 164, 181};
136
	static const BattleHex moatHexes[] = {11, 28, 44, 61, 77, 111, 129, 146, 164, 181};
137
	return std::vector<BattleHex>(std::begin(moatHexes), std::end(moatHexes));
137
	return std::vector<BattleHex>(moatHexes, moatHexes + sizeof(moatHexes)/sizeof(*moatHexes) - 1);
138
}
138
}
(-)vcmi-0.89.orig/lib/IGameCallback.cpp (-2 / +2 lines)
Lines 416-422 Link Here
416
shared_ptr<const CObstacleInstance> CBattleInfoCallback::battleGetObstacleOnPos(BattleHex tile, bool onlyBlocking /*= true*/)
416
shared_ptr<const CObstacleInstance> CBattleInfoCallback::battleGetObstacleOnPos(BattleHex tile, bool onlyBlocking /*= true*/)
417
{
417
{
418
	if(!gs->curB)
418
	if(!gs->curB)
419
		return NULL;
419
		return shared_ptr<const CObstacleInstance>();
420
420
421
	BOOST_FOREACH(auto &obs, battleGetAllObstacles())
421
	BOOST_FOREACH(auto &obs, battleGetAllObstacles())
422
	{
422
	{
Lines 426-432 Link Here
426
			return obs;
426
			return obs;
427
		}
427
		}
428
	}
428
	}
429
	return NULL;
429
	return shared_ptr<const CObstacleInstance>();
430
}
430
}
431
431
432
int CBattleInfoCallback::battleGetMoatDmg()
432
int CBattleInfoCallback::battleGetMoatDmg()
(-)vcmi-0.89.orig/server/CGameHandler.cpp (-2 / +2 lines)
Lines 999-1005 Link Here
999
	{
999
	{
1000
		// send one package with the creature path information
1000
		// send one package with the creature path information
1001
1001
1002
		shared_ptr<const CObstacleInstance> obstacle = NULL; //obstacle that interrupted movement
1002
		shared_ptr<const CObstacleInstance> obstacle = shared_ptr<const CObstacleInstance>(); //obstacle that interrupted movement
1003
		std::vector<BattleHex> tiles;
1003
		std::vector<BattleHex> tiles;
1004
		int tilesToMove = std::max((int)(path.first.size() - creSpeed), 0);
1004
		int tilesToMove = std::max((int)(path.first.size() - creSpeed), 0);
1005
		int v = path.first.size()-1;
1005
		int v = path.first.size()-1;
Lines 1036-1042 Link Here
1036
			//if stack didn't die in explosion, continue movement
1036
			//if stack didn't die in explosion, continue movement
1037
			if(!obstacle->stopsMovement() && curStack->alive())
1037
			if(!obstacle->stopsMovement() && curStack->alive())
1038
			{
1038
			{
1039
				obstacle = NULL;
1039
				obstacle = shared_ptr<const CObstacleInstance>();
1040
				tiles.clear();
1040
				tiles.clear();
1041
				v--;
1041
				v--;
1042
				goto startWalking; //TODO it's so evil
1042
				goto startWalking; //TODO it's so evil

Return to bug 424193