1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-13 13:31:48 +00:00

Merge pull request #84597 from KoBeWi/zeroed_existence

Keep Variant type after `zero()`
This commit is contained in:
Rémi Verschelde
2023-11-08 19:10:23 +01:00

View File

@@ -1291,7 +1291,13 @@ void Variant::zero() {
break; break;
default: default:
Type prev_type = type;
this->clear(); 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; break;
} }
} }