enigma-dev/enigma-dev — pull request #824 by Heathtech (2014-09-20 23:41:59+00:00)
Title: Fixes #822 globalvar variable access in scripts

It seems that using globalvar works fairly well already, but when accessing a globalvar from a script, the self. part it places in front of variables was causing all of the issues. Since variables defined with globalvar are placed in the highest scope already, there should not be any varaccess calls necessary to get the value. My change basically forces the self. part to disappear.

Note that local variables that temporarily override globals still work, so long as varaccess is not necessary. The only problematic situation I can think of is a case like other.globvar where the other. part will get deleted despite the programmer's intended access to the object's version of globvar, but that is an unlikely situation because the ambiguous scope would be dangerous anyway.