From 118b5df52b693736631e560ec99bc4c8e0d4af38 Mon Sep 17 00:00:00 2001 From: Spoike Date: Tue, 12 Mar 2013 22:40:43 +0000 Subject: [PATCH] ------------------------------------------------------------------------ r4184 | acceptthis | 2013-01-29 03:23:16 +0000 (Tue, 29 Jan 2013) | 1 line Allow passing __NULL__ as an entity argument. ------------------------------------------------------------------------ git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4182 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/qclib/qcc_pr_comp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/qclib/qcc_pr_comp.c b/engine/qclib/qcc_pr_comp.c index 4269d8cfb..0a231dba0 100644 --- a/engine/qclib/qcc_pr_comp.c +++ b/engine/qclib/qcc_pr_comp.c @@ -3834,8 +3834,8 @@ QCC_def_t *QCC_PR_ParseFunctionCall (QCC_def_t *func) //warning, the func could e = QCC_PR_Statement(pr_opcodes+OP_CONV_FTOI, e, NULL, NULL); else if (p->type == ev_float && e->type->type == ev_integer) //convert float -> int... is this a constant? e = QCC_PR_Statement(pr_opcodes+OP_CONV_ITOF, e, NULL, NULL); - else if ((p->type == ev_function || p->type == ev_field || p->type == ev_string || p->type == ev_pointer) && e->type->type == ev_integer && e->constant && !((int*)qcc_pr_globals)[e->ofs]) - { //you're allowed to use int 0 to pass a null function/field/string/pointer + else if ((p->type == ev_function || p->type == ev_field || p->type == ev_string || p->type == ev_pointer || p->type == ev_entity) && e->type->type == ev_integer && e->constant && !((int*)qcc_pr_globals)[e->ofs]) + { //you're allowed to use int 0 to pass a null function/field/string/pointer/entity //this is basically because __NULL__ is defined as 0i (int 0) //note that we don't allow passing 0.0f for null. //WARNING: field 0 is actually a valid field, and is commonly modelindex.