Fix crash when using C# script that inherits from C++ script

This commit is contained in:
Wojtek Figat
2021-04-20 11:47:32 +02:00
parent 5b31a8222c
commit 9857fb12c4

View File

@@ -181,9 +181,12 @@ void Script::SetupType()
while (typeHandle != Script::TypeInitializer) while (typeHandle != Script::TypeInitializer)
{ {
auto& type = typeHandle.GetType(); auto& type = typeHandle.GetType();
_tickUpdate |= type.Script.ScriptVTable[8] != nullptr; if (type.Script.ScriptVTable)
_tickLateUpdate |= type.Script.ScriptVTable[9] != nullptr; {
_tickFixedUpdate |= type.Script.ScriptVTable[10] != nullptr; _tickUpdate |= type.Script.ScriptVTable[8] != nullptr;
_tickLateUpdate |= type.Script.ScriptVTable[9] != nullptr;
_tickFixedUpdate |= type.Script.ScriptVTable[10] != nullptr;
}
typeHandle = type.GetBaseType(); typeHandle = type.GetBaseType();
} }
} }