diff options
author | Hein-Pieter van Braam <hp@tmm.cx> | 2017-08-27 23:49:13 +0200 |
---|---|---|
committer | Hein-Pieter van Braam <hp@tmm.cx> | 2017-08-27 23:49:13 +0200 |
commit | 8064fbb1747568729236e7d2eb21cdc3e3e555fd (patch) | |
tree | 0c9393871abb942d63a9d1617ab7a7b302bf47d6 /modules | |
parent | 9e0fbb49c12a4bb12c275194b0599fdfa0b1aabf (diff) |
Fix a crash in gdscript callbacks
This fixes a crash running the 'goltorus' project.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gdscript/gd_function.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/gdscript/gd_function.cpp b/modules/gdscript/gd_function.cpp index 81bf4664d8..e6f65fe0c2 100644 --- a/modules/gdscript/gd_function.cpp +++ b/modules/gdscript/gd_function.cpp @@ -1418,7 +1418,7 @@ Variant GDFunctionState::_signal_callback(const Variant **p_args, int p_argcount // If the return value is a GDFunctionState reference, // then the function did yield again after resuming. if (ret.is_ref()) { - GDFunctionState *gdfs = Object::cast_to<GDFunctionState>((Object *)&ret); + GDFunctionState *gdfs = Object::cast_to<GDFunctionState>(ret); if (gdfs && gdfs->function == function) completed = false; } @@ -1474,7 +1474,7 @@ Variant GDFunctionState::resume(const Variant &p_arg) { // If the return value is a GDFunctionState reference, // then the function did yield again after resuming. if (ret.is_ref()) { - GDFunctionState *gdfs = Object::cast_to<GDFunctionState>((Object *)&ret); + GDFunctionState *gdfs = Object::cast_to<GDFunctionState>(ret); if (gdfs && gdfs->function == function) completed = false; } |