From 1ce9e472f8a40b141450845f9e7e0deff514f175 Mon Sep 17 00:00:00 2001 From: GodLesZ Date: Tue, 13 Dec 2011 11:51:35 +0000 Subject: Added error message if a script tries to access an instance variable while no instance is attached (bugreport:4962) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15089 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/script.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; -- cgit v1.2.3-70-g09d2