summaryrefslogtreecommitdiff
path: root/library/DataDefs.cpp
diff options
context:
space:
mode:
authorAlexander Gavrilov2012-03-24 12:43:53 +0400
committerAlexander Gavrilov2012-03-24 12:43:53 +0400
commit053bfe345c566864b2337a8429072a24a2558493 (patch)
treefdebeeb5241140536eafad23f1da54f91e338862 /library/DataDefs.cpp
parent7fe5fc9a906710bc603bf93b3e282872990a3361 (diff)
downloaddfhack-053bfe345c566864b2337a8429072a24a2558493.tar.gz
dfhack-053bfe345c566864b2337a8429072a24a2558493.tar.bz2
dfhack-053bfe345c566864b2337a8429072a24a2558493.tar.xz
Implement allocation and copy for c++ objects in the lua wrapper.
Diffstat (limited to 'library/DataDefs.cpp')
-rw-r--r--library/DataDefs.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/library/DataDefs.cpp b/library/DataDefs.cpp
index 6fcd1141..712d4563 100644
--- a/library/DataDefs.cpp
+++ b/library/DataDefs.cpp
@@ -164,6 +164,9 @@ void struct_identity::doInit(Core *core)
bool struct_identity::is_subclass(struct_identity *actual)
{
+ if (!has_children && actual != this)
+ return false;
+
for (; actual; actual = actual->getParent())
if (actual == this) return true;