From 577d0cea5e25e09d9ab8c25848947ff172366a3a Mon Sep 17 00:00:00 2001 From: Spoike Date: Sun, 12 Dec 2004 18:43:57 +0000 Subject: [PATCH] Fix for vectors in unions/structs. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@634 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/qclib/qcc_pr_comp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/engine/qclib/qcc_pr_comp.c b/engine/qclib/qcc_pr_comp.c index b0f67706c..ee4d282c5 100644 --- a/engine/qclib/qcc_pr_comp.c +++ b/engine/qclib/qcc_pr_comp.c @@ -6801,6 +6801,8 @@ QCC_def_t *QCC_PR_DummyFieldDef(QCC_type_t *type, char *name, QCC_def_t *scope, sprintf(newname, "%s%s", parttype->name, array); ftype = QCC_PR_NewType("FIELD TYPE", ev_field); ftype->aux_type = parttype; + if (parttype->type == ev_vector) + ftype->size = parttype->size; //vector fields create a _y and _z too, so we need this still. def = QCC_PR_GetDef(NULL, newname, scope, false, 1); if (!def) { @@ -6841,7 +6843,7 @@ QCC_def_t *QCC_PR_DummyFieldDef(QCC_type_t *type, char *name, QCC_def_t *scope, } } - *fieldofs = maxfield; + *fieldofs = maxfield; //final size of the union. return first; }