------------------------------------------------------------------------

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
This commit is contained in:
Spoike 2013-03-12 22:40:43 +00:00
parent 02f7e7e9f2
commit 118b5df52b
1 changed files with 2 additions and 2 deletions

View File

@ -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.