Skip to content

Commit

Permalink
Glorious bugfixes!
Browse files Browse the repository at this point in the history
  • Loading branch information
ricky26 committed May 23, 2010
1 parent 18d1689 commit 8cde6b8
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions sources/impl/MeshLoaderCollada.cpp
Expand Up @@ -2130,7 +2130,8 @@ namespace hpl {
{
//Get number of chars in prefix.
int lPrefixChars =1;
while( apNode->msName[lPrefixChars]!= '_' &&
while(lPrefixChars < apNode->msName.size() &&
apNode->msName[lPrefixChars]!= '_' &&
apNode->msName[lPrefixChars]!='\0') {
lPrefixChars++;
}
Expand Down Expand Up @@ -2359,7 +2360,7 @@ namespace hpl {

//Get number of digits
lDigits =1;
while(apNode->msName[lStartChar+4+lDigits] != '_' && apNode->msName[7+lDigits] != 0) lDigits++;
while(apNode->msName.length() > lStartChar+4+lDigits && apNode->msName[lStartChar+4+lDigits] != '_' && apNode->msName[7+lDigits] != 0) lDigits++;

sNum = cString::Sub(apNode->msName,lStartChar+4,lDigits);
//int lTargetSector = cString::ToInt(sNum.c_str(),-1);
Expand Down
2 changes: 1 addition & 1 deletion sources/impl/MeshLoaderColladaHelpers.cpp
Expand Up @@ -39,7 +39,7 @@

namespace hpl {

#define GetAdress(sStr) if(sStr[0]=='#') sStr = cString::Sub(sStr,1);
#define GetAdress(sStr) { if(sStr.length() > 0 && sStr[0]=='#') { sStr = cString::Sub(sStr,1); } }
//////////////////////////////////////////////////////////////////////////
// PRIVATE METHODS
//////////////////////////////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion sources/impl/MeshLoaderColladaLoader.cpp
Expand Up @@ -1240,7 +1240,7 @@ namespace hpl {
pGeometry->mvVertexVec.resize(lSize);

tFloatVec vRawData;
vRawData.reserve(lSize * 3);
vRawData.resize(lSize * 3); // We can't use the vector as an array unless we actually allocate the memory! -- Ricky26

/////////////////////////////////
// Positions
Expand Down
1 change: 1 addition & 0 deletions sources/physics/PhysicsWorld.cpp
Expand Up @@ -165,6 +165,7 @@ namespace hpl {
pBody->Destroy();
hplDelete(pBody);
mlstBodies.erase(it);
return; // You can't continue using broken iterators! -- Ricky26
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion sources/system/SerializeClass.cpp
Expand Up @@ -1042,7 +1042,7 @@ namespace hpl {
iSerializable *pContData = (iSerializable*)pContIt->NextPtr();
hplDelete(pContData);
}
hplDelete(pContIt);
//hplDelete(pContIt);
pCont->Clear();

TiXmlElement *pVarElem = apElement->FirstChildElement();
Expand Down

0 comments on commit 8cde6b8

Please sign in to comment.