From 79ba2a8807cac2cea235ba6ee734b06010123261 Mon Sep 17 00:00:00 2001 From: epoch Date: Wed, 4 Jan 2017 16:39:14 -0600 Subject: added proper calculation of expected amount of arguments for addshape --- src/hackvr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/hackvr.c b/src/hackvr.c index 6984a56..381e424 100644 --- a/src/hackvr.c +++ b/src/hackvr.c @@ -241,8 +241,8 @@ int load_stdin() { } if(!strcmp(command,"addshape")) { if(len > 3) { - if(len != (strtold(a[2],0)*3)+3) { - printf("# ERROR: wrong amount of parts for addshape. got: %d expected %d\n",len,((int)strtold(a[2],0))*3+3); + if(len != ((strtold(a[2],0)+(strtold(a[2],0)==1))*3)+3) { + printf("# ERROR: wrong amount of parts for addshape. got: %d expected %d\n",len,((int)strtold(a[2],0)+(strtold(a[2],0)==1))*3+3); continue; } global.shape[i]=malloc(sizeof(struct c3_shape)); -- cgit v1.2.3