summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/map/script.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 9fd0693e4..c9cb65f63 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -2342,8 +2342,11 @@ void get_val(struct script_state* st, struct script_data* data)
case '\'':
{
struct linkdb_node** n = NULL;
- if( st->instance_id )
+ if (st->instance_id) {
n = &instance[st->instance_id].svar;
+ } else {
+ ShowWarning("script:get_val: cannot access instance variable '%s', defaulting to 0\n", name);
+ }
data->u.str = (char*)linkdb_search(n, (void*)reference_getuid(data));
}
break;