]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - tools/quake3/q3map2/leakfile.c
Merge commit 'bf6dd1f2d186c799adf11f1e744a1ff57aa8d335' into garux-merge
[xonotic/netradiant.git] / tools / quake3 / q3map2 / leakfile.c
index be3f157fc9e148da55ff81938c6d5763c45f255b..243af8a3c45ea0e3dc10775ed00da2be74c711f6 100644 (file)
@@ -43,7 +43,7 @@
 
    LEAK FILE GENERATION
 
-   Save out name.line for qe3 to read
+   Save out name.lin for qe3 to read
    ==============================================================================
  */
 
    TTimo: builds a polyline xml node
    =============
  */
-xmlNodePtr LeakFile( tree_t *tree ){
+xmlNodePtr LeakFile( tree_t *tree, const char *filename ){
        vec3_t mid;
        FILE    *linefile;
-       char filename[1024];
        node_t  *node;
        int count;
        xmlNodePtr xml_node, point;
@@ -76,21 +75,20 @@ xmlNodePtr LeakFile( tree_t *tree ){
        //
        // write the points to the file
        //
-       sprintf( filename, "%s.lin", source );
        linefile = fopen( filename, "w" );
        if ( !linefile ) {
                Error( "Couldn't open %s\n", filename );
        }
 
-       xml_node = xmlNewNode( NULL, "polyline" );
+       xml_node = xmlNewNode( NULL, (xmlChar*)"polyline" );
 
        count = 0;
        node = &tree->outside_node;
        while ( node->occupied > 1 )
        {
                int next;
-               portal_t    *p, *nextportal;
-               node_t      *nextnode;
+               portal_t    *p, *nextportal = NULL;
+               node_t      *nextnode = NULL;
                int s;
 
                // find the best portal exit