summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorepoch <epoch@hacking.allowed.org>2017-01-04 16:39:14 -0600
committerepoch <epoch@hacking.allowed.org>2017-01-04 16:39:14 -0600
commit79ba2a8807cac2cea235ba6ee734b06010123261 (patch)
tree45476596b06f786ef5ce0aa2db4f35274416ccfe /src
parentfab99221e68f2f494ea3c7a46858d427c6d9c9f8 (diff)
downloadhackvr-79ba2a8807cac2cea235ba6ee734b06010123261.tar.gz
hackvr-79ba2a8807cac2cea235ba6ee734b06010123261.zip
added proper calculation of expected amount of arguments for addshape
Diffstat (limited to 'src')
-rw-r--r--src/hackvr.c4
1 files changed, 2 insertions, 2 deletions
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));