mirror of
https://github.com/godotengine/godot.git
synced 2025-01-23 11:03:13 -05:00
Merge pull request #100632 from Namey5/decal-duplication-crash
Fix crash when duplicating `Decal` or `Light3D` nodes
This commit is contained in:
commit
024b6bc1ce
2 changed files with 16 additions and 16 deletions
|
@ -46,14 +46,14 @@ void Decal::set_texture(DecalTexture p_type, const Ref<Texture2D> &p_texture) {
|
|||
RID texture_rid = p_texture.is_valid() ? p_texture->get_rid() : RID();
|
||||
|
||||
#ifdef DEBUG_ENABLED
|
||||
if (
|
||||
p_texture->is_class("AnimatedTexture") ||
|
||||
p_texture->is_class("AtlasTexture") ||
|
||||
p_texture->is_class("CameraTexture") ||
|
||||
p_texture->is_class("CanvasTexture") ||
|
||||
p_texture->is_class("MeshTexture") ||
|
||||
p_texture->is_class("Texture2DRD") ||
|
||||
p_texture->is_class("ViewportTexture")) {
|
||||
if (p_texture.is_valid() &&
|
||||
(p_texture->is_class("AnimatedTexture") ||
|
||||
p_texture->is_class("AtlasTexture") ||
|
||||
p_texture->is_class("CameraTexture") ||
|
||||
p_texture->is_class("CanvasTexture") ||
|
||||
p_texture->is_class("MeshTexture") ||
|
||||
p_texture->is_class("Texture2DRD") ||
|
||||
p_texture->is_class("ViewportTexture"))) {
|
||||
WARN_PRINT(vformat("%s cannot be used as a Decal texture (%s). As a workaround, assign the value returned by %s's `get_image()` instead.", p_texture->get_class(), get_path(), p_texture->get_class()));
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -202,14 +202,14 @@ void Light3D::set_projector(const Ref<Texture2D> &p_texture) {
|
|||
RID tex_id = projector.is_valid() ? projector->get_rid() : RID();
|
||||
|
||||
#ifdef DEBUG_ENABLED
|
||||
if (
|
||||
p_texture->is_class("AnimatedTexture") ||
|
||||
p_texture->is_class("AtlasTexture") ||
|
||||
p_texture->is_class("CameraTexture") ||
|
||||
p_texture->is_class("CanvasTexture") ||
|
||||
p_texture->is_class("MeshTexture") ||
|
||||
p_texture->is_class("Texture2DRD") ||
|
||||
p_texture->is_class("ViewportTexture")) {
|
||||
if (p_texture.is_valid() &&
|
||||
(p_texture->is_class("AnimatedTexture") ||
|
||||
p_texture->is_class("AtlasTexture") ||
|
||||
p_texture->is_class("CameraTexture") ||
|
||||
p_texture->is_class("CanvasTexture") ||
|
||||
p_texture->is_class("MeshTexture") ||
|
||||
p_texture->is_class("Texture2DRD") ||
|
||||
p_texture->is_class("ViewportTexture"))) {
|
||||
WARN_PRINT(vformat("%s cannot be used as a Light3D projector texture (%s). As a workaround, assign the value returned by %s's `get_image()` instead.", p_texture->get_class(), get_path(), p_texture->get_class()));
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue