Fix crash when spawning C# object that inherits from abstract C++ class
This commit is contained in:
@@ -46,6 +46,7 @@ typedef Dictionary<Guid, Actor*, HeapAllocation> ActorsLookup;
|
||||
|
||||
#define DECLARE_SCENE_OBJECT_ABSTRACT(type) \
|
||||
DECLARE_SCRIPTING_TYPE_NO_SPAWN(type); \
|
||||
static type* Spawn(const SpawnParams& params) { return nullptr; } \
|
||||
explicit type(const SpawnParams& params)
|
||||
|
||||
#define DECLARE_SCENE_OBJECT_NO_SPAWN(type) \
|
||||
|
||||
@@ -492,6 +492,7 @@ ScriptingObject* ManagedBinaryModule::ManagedObjectSpawn(const ScriptingObjectSp
|
||||
ScriptingObject* object = nativeTypePtr->Script.Spawn(params);
|
||||
if (!object)
|
||||
{
|
||||
LOG(Error, "Failed to spawn object of type {0} with native base type {1}.", managedTypePtr->ToString(), nativeTypePtr->ToString());
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user