mirror of
https://github.com/godotengine/godot
synced 2024-09-04 22:08:29 +00:00
Keep Variant type after zero()
This commit is contained in:
parent
3e7f638d7b
commit
275e9d7028
|
@ -1291,7 +1291,13 @@ void Variant::zero() {
|
|||
break;
|
||||
|
||||
default:
|
||||
Type prev_type = type;
|
||||
this->clear();
|
||||
if (type != prev_type) {
|
||||
// clear() changes type to NIL, so it needs to be restored.
|
||||
Callable::CallError ce;
|
||||
Variant::construct(prev_type, *this, nullptr, 0, ce);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue