diff options
author | GodLesZ <GodLesZ@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-12-13 11:51:35 +0000 |
---|---|---|
committer | GodLesZ <GodLesZ@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-12-13 11:51:35 +0000 |
commit | 1ce9e472f8a40b141450845f9e7e0deff514f175 (patch) | |
tree | a996d2dd0482a1fe1c58daaba39876e19ba3b311 /src/map | |
parent | ad87c74ec7948f583e15f7ffebbd7bc027f8dc23 (diff) | |
download | hercules-1ce9e472f8a40b141450845f9e7e0deff514f175.tar.gz hercules-1ce9e472f8a40b141450845f9e7e0deff514f175.tar.bz2 hercules-1ce9e472f8a40b141450845f9e7e0deff514f175.tar.xz hercules-1ce9e472f8a40b141450845f9e7e0deff514f175.zip |
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
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/script.c | 5 |
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; |