]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - tools/quake3/q3map2/vis.c
ported over the 1.5 branch version of q3map2 which is newer
[xonotic/netradiant.git] / tools / quake3 / q3map2 / vis.c
index 464b23ecde6a3b3582820a387d27de152e7f8110..4ee843a0b96800a08c89f28b36fb124f7149a430 100644 (file)
@@ -1,4 +1,5 @@
-/*
+/* -------------------------------------------------------------------------------
+
 Copyright (C) 1999-2007 id Software, Inc. and contributors.
 For a list of contributors, see the accompanying CONTRIBUTORS file.
 
@@ -65,7 +66,7 @@ fixedWinding_t *NewFixedWinding( int points )
        if (points > MAX_POINTS_ON_WINDING)
                Error ("NewWinding: %i points", points);
        
-       size = (int)((fixedWinding_t *)0)->points[points];
+       size = (int)((size_t)((fixedWinding_t *)0)->points[points]);
        w = safe_malloc (size);
        memset (w, 0, size);
        
@@ -870,7 +871,7 @@ void LoadPortals (char *name)
        Sys_Printf ("%6i portalclusters\n", portalclusters);
        Sys_Printf ("%6i numportals\n", numportals);
        Sys_Printf ("%6i numfaces\n", numfaces);
-
+       
        // these counts should take advantage of 64 bit systems automatically
        leafbytes = ((portalclusters+63)&~63)>>3;
        leaflongs = leafbytes/sizeof(long);
@@ -1094,6 +1095,13 @@ int VisMain (int argc, char **argv)
        Sys_Printf( "Loading %s\n", portalfile );
        LoadPortals( portalfile );
        
+       /* ydnar: exit if no portals, hence no vis */
+       if( numportals == 0 )
+       {
+               Sys_Printf( "No portals means no vis, exiting.\n" );
+               return 0;
+       }
+       
        /* ydnar: for getting far plane */
        ParseEntities();