mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2024-11-22 00:48:09 +01:00
Now get_global in Engine won't print an error if the global isn't exists, instead it will just return null.
This commit is contained in:
parent
a1865fd1af
commit
f9de65e101
@ -92,9 +92,13 @@ void Engine::add_global(const String &p_name, const Variant &p_global) {
|
||||
_globals.set(p_name, p_global);
|
||||
}
|
||||
Variant Engine::get_global(const String &p_name) {
|
||||
ERR_FAIL_COND_V(!_globals.has(p_name), Variant());
|
||||
Variant *vptr = _globals.getptr(p_name);
|
||||
|
||||
return _globals[p_name];
|
||||
if (!vptr) {
|
||||
return Variant();
|
||||
}
|
||||
|
||||
return *vptr;
|
||||
}
|
||||
void Engine::remove_global(const String &p_name) {
|
||||
ERR_FAIL_COND(!_globals.has(p_name));
|
||||
|
Loading…
Reference in New Issue
Block a user