summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/script.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 856b2d95e..ad239ddcd 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -2537,7 +2537,10 @@ void get_val(struct script_state* st, struct script_data* data)
data->ref ? *data->ref:
name[1] == '@' ? st->stack->var_function:// instance/scope variable
st->script->script_vars;// npc variable
- data->u.str = (char*)idb_get(n,reference_getuid(data));
+ if( n )
+ data->u.str = (char*)idb_get(n,reference_getuid(data));
+ else
+ data->u.str = NULL;
}
break;
case '\'':
@@ -2599,7 +2602,10 @@ void get_val(struct script_state* st, struct script_data* data)
data->ref ? *data->ref:
name[1] == '@' ? st->stack->var_function:// instance/scope variable
st->script->script_vars;// npc variable
- data->u.num = (int)idb_iget(n,reference_getuid(data));
+ if( n )
+ data->u.num = (int)idb_iget(n,reference_getuid(data));
+ else
+ data->u.num = 0;
}
break;
case '\'':