Merge branch 'bugfixes'

Conflicts:
	src/template.cpp
master
vexed 2013-11-14 21:14:26 -05:00
commit c142724c2a
2 changed files with 12 additions and 4 deletions

View File

@ -216,8 +216,8 @@ static void calcTileIllum(UDWORD tileX, UDWORD tileY)
{
finalVector = finalVector + normals[i];
}
Vector3f sunVector(theSun.x, theSun.y, -theSun.z);
dotProduct = normalise(finalVector) * sunVector;
dotProduct = normalise(finalVector) * theSun;
val = abs(dotProduct) / 16;
if (val == 0)

View File

@ -487,7 +487,7 @@ void fillTemplateList(std::vector<DROID_TEMPLATE *> &pList, STRUCTURE *psFactory
pList.clear();
DROID_TEMPLATE *psCurr;
UDWORD iCapacity = psFactory->capacity;
BODY_SIZE iCapacity = (BODY_SIZE)psFactory->pFunctionality->factory.capacity;
/* Add the templates to the list*/
for (std::list<DROID_TEMPLATE>::iterator i = localTemplates.begin(); i != localTemplates.end(); ++i)
@ -513,9 +513,17 @@ void fillTemplateList(std::vector<DROID_TEMPLATE *> &pList, STRUCTURE *psFactory
}
//check the factory can cope with this sized body
if (!((asBodyStats + psCurr->asParts[COMP_BODY])->size > iCapacity) )
if (((asBodyStats + psCurr->asParts[COMP_BODY])->size <= iCapacity))
{
pList.push_back(psCurr);
}
else if (bMultiPlayer && (iCapacity == SIZE_HEAVY))
{
// Special case for Super heavy bodyies (Super Transporter)
if((asBodyStats + psCurr->asParts[COMP_BODY])->size == SIZE_SUPER_HEAVY)
{
pList.push_back(psCurr);
}
}
}
}