mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-17 01:11:45 +00:00
Allow nil to be assigned to field variables.
Note, this is the field variable itself, not the field in the entity. eg: .integer x = nil;
This commit is contained in:
parent
87b240f469
commit
4fd6bdae6f
1 changed files with 3 additions and 1 deletions
|
@ -162,6 +162,8 @@ get_type (expr_t *e)
|
|||
case ex_value:
|
||||
if (e->e.value.type == ev_pointer)
|
||||
return pointer_type (e->e.value.v.pointer.type);
|
||||
if (e->e.value.type == ev_field)
|
||||
return field_type (e->e.value.v.pointer.type);
|
||||
if (e->e.value.type == ev_integer
|
||||
&& options.code.progsversion == PROG_ID_VERSION) {
|
||||
e->e.value.type = ev_float;
|
||||
|
@ -1188,7 +1190,7 @@ convert_nil (expr_t *e, type_t *t)
|
|||
{
|
||||
memset (&e->e.value, 0, sizeof (e->e.value));
|
||||
e->e.value.type = low_level_type (t);
|
||||
if (t->type == ev_pointer)
|
||||
if (t->type == ev_pointer || t->type == ev_field)
|
||||
e->e.value.v.pointer.type = t->t.fldptr.type;
|
||||
e->type = ex_value;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue