From: <wel...@us...> - 2011-02-15 14:37:48
|
Revision: 6957 http://planeshift.svn.sourceforge.net/planeshift/?rev=6957&view=rev Author: weltall2 Date: 2011-02-15 14:37:42 +0000 (Tue, 15 Feb 2011) Log Message: ----------- fixed check for duplicates Modified Paths: -------------- trunk/src/tools/ccheck/ccheck.cpp Modified: trunk/src/tools/ccheck/ccheck.cpp =================================================================== --- trunk/src/tools/ccheck/ccheck.cpp 2011-02-15 13:58:39 UTC (rev 6956) +++ trunk/src/tools/ccheck/ccheck.cpp 2011-02-15 14:37:42 UTC (rev 6957) @@ -259,8 +259,9 @@ csRef<iDocumentNode> fileNode = node->GetNode("file"); if(fileNode.IsValid()) { - size_t l = shaders.PushSmart(fileNode->GetContentsValue()); - if(l == shaders.GetSize()-1) + size_t prevSize = shaders.GetSize(); + shaders.PushSmart(fileNode->GetContentsValue()); + if(prevSize != shaders.GetSize()) { csRef<iDocumentNode> newNode = newShaders->CreateNodeBefore(CS_NODE_ELEMENT); CS::DocSystem::CloneNode(node, newNode); @@ -286,8 +287,9 @@ while(itr->HasNext()) { csRef<iDocumentNode> node = itr->Next(); - size_t l = textures.PushSmart(node->GetAttributeValue("name")); - if(l == textures.GetSize()-1) + size_t prevSize = textures.GetSize(); + textures.PushSmart(node->GetAttributeValue("name")); + if(prevSize != textures.GetSize()) { csRef<iDocumentNode> newNode = newTextures->CreateNodeBefore(CS_NODE_ELEMENT); CS::DocSystem::CloneNode(node, newNode); @@ -310,8 +312,9 @@ while(itr->HasNext()) { csRef<iDocumentNode> node = itr->Next(); - size_t l = materials.PushSmart(node->GetAttributeValue("name")); - if(l == materials.GetSize()-1) + size_t prevSize = materials.GetSize(); + materials.PushSmart(node->GetAttributeValue("name")); + if(prevSize != materials.GetSize()) { csRef<iDocumentNode> newNode = newMaterials->CreateNodeBefore(CS_NODE_ELEMENT); if(strip) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |