summaryrefslogtreecommitdiffstats
path: root/core/object/object.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-09-25 17:18:05 +0200
committerRémi Verschelde <rverschelde@gmail.com>2023-09-25 17:18:05 +0200
commitd759f91f8d5406a7a13f2e21f0d73b5d9811bcaf (patch)
treedc3b27910d16f08f829124f445fa7a14abbc8059 /core/object/object.cpp
parent9fdf24fa6766b30cbc7ce4deb70119b3c1025246 (diff)
parent2df37a237a4b2d1fb8c39078b4d320dc92050800 (diff)
downloadredot-engine-d759f91f8d5406a7a13f2e21f0d73b5d9811bcaf.tar.gz
Merge pull request #81101 from 398utubzyt/dotnet/abstract-class-support
C#: Add abstract class support
Diffstat (limited to 'core/object/object.cpp')
-rw-r--r--core/object/object.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/object/object.cpp b/core/object/object.cpp
index 3fd7fe36e0..0e231622b6 100644
--- a/core/object/object.cpp
+++ b/core/object/object.cpp
@@ -880,7 +880,10 @@ void Object::set_script(const Variant &p_script) {
}
Ref<Script> s = p_script;
- ERR_FAIL_COND_MSG(s.is_null() && !p_script.is_null(), "Invalid parameter, it should be a reference to a valid script (or null).");
+ if (!p_script.is_null()) {
+ ERR_FAIL_COND_MSG(s.is_null(), "Cannot set object script. Parameter should be null or a reference to a valid script.");
+ ERR_FAIL_COND_MSG(s->is_abstract(), vformat("Cannot set object script. Script '%s' should not be abstract.", s->get_path()));
+ }
script = p_script;