Browse Source

nviz_cmd: don't check slices when nslices is 0

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@47344 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 14 years ago
parent
commit
36e88247f7
1 changed files with 4 additions and 2 deletions
  1. 4 2
      visualization/nviz2/cmd/args.c

+ 4 - 2
visualization/nviz2/cmd/args.c

@@ -869,6 +869,8 @@ int opt_get_num_answers(const struct Option *opt)
 	}
     }
 
+    G_debug(3, "opt_get_num_answers(): opt=%s num=%d", opt->key, i);
+    
     return i;
 }
 
@@ -1065,13 +1067,13 @@ void check_parameters(const struct GParams *params)
 
     /* slice transparency */
     nconsts = opt_get_num_answers(params->slice_transp);
-    if (nslices != nconsts)
+    if (nslices > 0 && nslices != nconsts)
 	G_fatal_error(_("Inconsistent number of attributes (<%s> %d: <%s> %d)"),
 			params->slice->key, nslices, params->slice_transp->key, nconsts);
 
     /* slice position */
     ncoords = opt_get_num_answers(params->slice_pos);
-    if (ncoords != 6 * nslices)
+    if (nslices > 0 && ncoords != 6 * nslices)
 	G_fatal_error(_("Inconsistent number of attributes (<%s> %d: <%s> %d x 6)"),
 			  params->slice->key, nslices, params->slice_pos->key, ncoords/6);