You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
Fix a crash in gdscript callbacks
This fixes a crash running the 'goltorus' project.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user